diff options
author | Tim Taubert <ttaubert@mozilla.com> | 2016-12-02 09:48:36 +0100 |
---|---|---|
committer | Tim Taubert <ttaubert@mozilla.com> | 2016-12-02 09:48:36 +0100 |
commit | 4f317bf936611026c5cabfd552e13dd5e0ac5eb5 (patch) | |
tree | 0944fa32006b042c2c0593d6d052b122fac67b0d | |
parent | a827ffd804a3d775c3038c3cccddf356ff92bb2f (diff) | |
download | nss-hg-4f317bf936611026c5cabfd552e13dd5e0ac5eb5.tar.gz |
Bug 1321762 - Fix fuzzing speed regressions r=franziskus
Differential Revision: https://nss-review.dev.mozaws.net/D114
-rw-r--r-- | automation/taskcluster/graph/src/extend.js | 2 | ||||
-rwxr-xr-x | build.sh | 4 | ||||
-rw-r--r-- | coreconf/config.gypi | 2 | ||||
-rw-r--r-- | fuzz/fuzz.gyp | 46 |
4 files changed, 34 insertions, 20 deletions
diff --git a/automation/taskcluster/graph/src/extend.js b/automation/taskcluster/graph/src/extend.js index 24d99f03d..d15f6b61e 100644 --- a/automation/taskcluster/graph/src/extend.js +++ b/automation/taskcluster/graph/src/extend.js @@ -279,7 +279,7 @@ async function scheduleFuzzing() { "/bin/bash", "-c", "bin/checkout.sh && " + - "nss/automation/taskcluster/scripts/build_gyp.sh -g -v --fuzz" + "nss/automation/taskcluster/scripts/build_gyp.sh -g -v --fuzz --ubsan" ], artifacts: { public: { @@ -54,7 +54,7 @@ rebuild_gyp=0 target=Debug verbose=0 fuzz=0 -sancov_default=edge,indirect-calls,8bit-counters,trace-cmp +sancov_default=edge,indirect-calls,8bit-counters # parse parameters to store in config params=$(echo "$*" | perl -pe 's/-c|-v|-g|-j [0-9]*|-h//g' | perl -pe 's/^\s*(.*?)\s*$/\1/') @@ -78,10 +78,8 @@ enable_fuzz() { fuzz=1 nspr_sanitizer asan - nspr_sanitizer ubsan nspr_sanitizer sancov $sancov_default gyp_params+=(-Duse_asan=1) - gyp_params+=(-Duse_ubsan=1) gyp_params+=(-Duse_sancov=$sancov_default) # Adding debug symbols even for opt builds. diff --git a/coreconf/config.gypi b/coreconf/config.gypi index b24e8348b..1e4b27b3c 100644 --- a/coreconf/config.gypi +++ b/coreconf/config.gypi @@ -296,7 +296,7 @@ '-Wno-unused-function', ] }], - [ 'use_asan==1 or use_ubsan==1', { + [ 'fuzz==1 or use_asan==1 or use_ubsan==1', { 'cflags': ['-O1'], 'xcode_settings': { 'GCC_OPTIMIZATION_LEVEL': '1', # -O1 diff --git a/fuzz/fuzz.gyp b/fuzz/fuzz.gyp index 3d25d005d..32e76cbea 100644 --- a/fuzz/fuzz.gyp +++ b/fuzz/fuzz.gyp @@ -25,6 +25,21 @@ 'libFuzzer/FuzzerUtilDarwin.cpp', 'libFuzzer/FuzzerUtilLinux.cpp', ], + 'cflags': [ + '-O2', + ], + 'cflags!': [ + '-O1', + ], + 'cflags/': [ + ['exclude', '-fsanitize'], + ], + 'xcode_settings': { + 'GCC_OPTIMIZATION_LEVEL': '2', # -O2 + 'OTHER_CFLAGS/': [ + ['exclude', '-fsanitize'], + ], + }, }, { 'target_name': 'nssfuzz', @@ -38,27 +53,28 @@ 'dependencies': [ '<(DEPTH)/exports.gyp:nss_exports', 'libFuzzer', - ] + ], + 'cflags': [ + '-O2', + ], + 'cflags!': [ + '-O1', + ], + 'cflags/': [ + ['exclude', '-fsanitize-coverage'], + ], + 'xcode_settings': { + 'GCC_OPTIMIZATION_LEVEL': '2', # -O2 + 'OTHER_CFLAGS/': [ + ['exclude', '-fsanitize-coverage'], + ], + }, } ], 'target_defaults': { 'include_dirs': [ 'libFuzzer', ], - 'cflags': [ - '-O2', - ], - 'cflags/': [ - ['exclude', '-fsanitize='], - ['exclude', '-fsanitize-'], - ], - 'xcode_settings': { - 'GCC_OPTIMIZATION_LEVEL': '2', # -O2 - 'OTHER_CFLAGS/': [ - ['exclude', '-fsanitize='], - ['exclude', '-fsanitize-'], - ], - }, }, 'variables': { 'module': 'nss', |