| 1 |
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*- |
| 2 |
# vim: set filetype=python: |
| 3 |
# This Source Code Form is subject to the terms of the Mozilla Public |
| 4 |
# License, v. 2.0. If a copy of the MPL was not distributed with this |
| 5 |
# file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 6 |
|
| 7 |
Library('fuzzer') |
| 8 |
|
| 9 |
EXPORTS += [ |
| 10 |
'FuzzerDefs.h', |
| 11 |
'FuzzerExtFunctions.def', |
| 12 |
'FuzzerExtFunctions.h', |
| 13 |
] |
| 14 |
|
| 15 |
SOURCES += [ |
| 16 |
'FuzzerCrossOver.cpp', |
| 17 |
'FuzzerDataFlowTrace.cpp', |
| 18 |
'FuzzerDriver.cpp', |
| 19 |
'FuzzerExtFunctionsDlsym.cpp', |
| 20 |
'FuzzerExtFunctionsWeak.cpp', |
| 21 |
'FuzzerExtFunctionsWindows.cpp', |
| 22 |
'FuzzerExtraCounters.cpp', |
| 23 |
'FuzzerFork.cpp', |
| 24 |
'FuzzerIO.cpp', |
| 25 |
'FuzzerIOPosix.cpp', |
| 26 |
'FuzzerIOWindows.cpp', |
| 27 |
'FuzzerLoop.cpp', |
| 28 |
'FuzzerMerge.cpp', |
| 29 |
'FuzzerMutate.cpp', |
| 30 |
'FuzzerSHA1.cpp', |
| 31 |
'FuzzerTracePC.cpp', |
| 32 |
'FuzzerUtil.cpp', |
| 33 |
'FuzzerUtilDarwin.cpp', |
| 34 |
'FuzzerUtilFuchsia.cpp', |
| 35 |
'FuzzerUtilLinux.cpp', |
| 36 |
'FuzzerUtilPosix.cpp', |
| 37 |
'FuzzerUtilWindows.cpp', |
| 38 |
] |
| 39 |
|
| 40 |
if CONFIG['CC_TYPE'] == 'clang': |
| 41 |
CXXFLAGS += ['-Wno-unreachable-code-return'] |
| 42 |
|
| 43 |
# According to the LLVM docs, LibFuzzer isn't supposed to be built with any |
| 44 |
# sanitizer flags and in fact, building it with ASan coverage currently causes |
| 45 |
# Clang 3.9+ to crash, so we filter out all sanitizer-related flags here. |
| 46 |
for flags_var in ('OS_CFLAGS', 'OS_CXXFLAGS'): |
| 47 |
COMPILE_FLAGS[flags_var] = [ |
| 48 |
f for f in COMPILE_FLAGS.get(flags_var, []) |
| 49 |
if not f.startswith(('-fsanitize', '-fno-sanitize-')) |
| 50 |
] |
| 51 |
|
| 52 |
LINK_FLAGS['OS'] = [ |
| 53 |
f for f in LINK_FLAGS.get('OS', []) |
| 54 |
if not f.startswith(('-fsanitize', '-fno-sanitize-')) |
| 55 |
] |