summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--automation/taskcluster/graph/src/extend.js2
-rwxr-xr-xbuild.sh4
-rw-r--r--coreconf/config.gypi2
-rw-r--r--fuzz/fuzz.gyp46
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: {
diff --git a/build.sh b/build.sh
index 806d4fbc7..9c215eb59 100755
--- a/build.sh
+++ b/build.sh
@@ -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',