summaryrefslogtreecommitdiffstats
path: root/security/nss/coreconf/fuzz.sh
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-02-06 11:46:26 +0100
committerwolfbeast <mcwerewolf@gmail.com>2018-02-06 11:46:26 +0100
commitf017b749ea9f1586d2308504553d40bf4cc5439d (patch)
treec6033924a0de9be1ab140596e305898c651bf57e /security/nss/coreconf/fuzz.sh
parent7c728b3c7680662fc4e92b5d03697b8339560b08 (diff)
downloadUXP-f017b749ea9f1586d2308504553d40bf4cc5439d.tar
UXP-f017b749ea9f1586d2308504553d40bf4cc5439d.tar.gz
UXP-f017b749ea9f1586d2308504553d40bf4cc5439d.tar.lz
UXP-f017b749ea9f1586d2308504553d40bf4cc5439d.tar.xz
UXP-f017b749ea9f1586d2308504553d40bf4cc5439d.zip
Update NSS to 3.32.1-RTM
Diffstat (limited to 'security/nss/coreconf/fuzz.sh')
-rw-r--r--security/nss/coreconf/fuzz.sh41
1 files changed, 41 insertions, 0 deletions
diff --git a/security/nss/coreconf/fuzz.sh b/security/nss/coreconf/fuzz.sh
new file mode 100644
index 000000000..67cb7f594
--- /dev/null
+++ b/security/nss/coreconf/fuzz.sh
@@ -0,0 +1,41 @@
+#!/usr/bin/env bash
+# This file is used by build.sh to setup fuzzing.
+
+set +e
+
+# Default to clang if CC is not set.
+if [ -z "$CC" ]; then
+ command -v clang &> /dev/null 2>&1
+ if [ $? != 0 ]; then
+ echo "Fuzzing requires clang!"
+ exit 1
+ fi
+ export CC=clang
+ export CCC=clang++
+ export CXX=clang++
+fi
+
+gyp_params+=(-Dtest_build=1 -Dfuzz=1 -Dsign_libs=0)
+
+# Add debug symbols even for opt builds.
+nspr_params+=(--enable-debug-symbols)
+
+if [ "$fuzz_oss" = 1 ]; then
+ gyp_params+=(-Dno_zdefs=1 -Dfuzz_oss=1)
+else
+ enable_sanitizer asan
+ # Ubsan doesn't build on 32-bit at the moment. Disable it.
+ if [ "$build_64" = 1 ]; then
+ enable_ubsan
+ fi
+ enable_sancov
+fi
+
+if [ "$fuzz_tls" = 1 ]; then
+ gyp_params+=(-Dfuzz_tls=1)
+fi
+
+if [ ! -f "/usr/lib/libFuzzingEngine.a" ]; then
+ echo "Cloning libFuzzer files ..."
+ run_verbose "$cwd"/fuzz/config/clone_libfuzzer.sh
+fi