diff options
author | Franziskus Kiefer <franziskuskiefer@gmail.com> | 2017-01-24 15:46:16 +0100 |
---|---|---|
committer | Franziskus Kiefer <franziskuskiefer@gmail.com> | 2017-01-24 15:46:16 +0100 |
commit | 578a7ce768dc5fa3014655c8edf784822582ff3a (patch) | |
tree | 84faaf5c2c7e57b80c8b892c9411387be77b4c41 | |
parent | 584c481caa0d769271ca3d80785b9581d5bce917 (diff) | |
download | nss-hg-578a7ce768dc5fa3014655c8edf784822582ff3a.tar.gz |
Bug 1177759 - build script for oss-fuzz, r=ttaubert
Differential Revision: https://nss-review.dev.mozaws.net/D172
-rw-r--r-- | automation/ossfuzz/build.sh | 28 | ||||
-rwxr-xr-x | build.sh | 6 |
2 files changed, 34 insertions, 0 deletions
diff --git a/automation/ossfuzz/build.sh b/automation/ossfuzz/build.sh new file mode 100644 index 000000000..565cb39a1 --- /dev/null +++ b/automation/ossfuzz/build.sh @@ -0,0 +1,28 @@ +#!/bin/bash -eu +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +################################################################################ + +# List of targets disabled for oss-fuzz. +declare -A disabled=([pkcs8]=1) + +# Build the library. +CXX="$CXX -stdlib=libc++" CXXFLAGS="$CXXFLAGS -I$SRC/libfuzzer" \ + LDFLAGS="$CFLAGS" ./build.sh -c -v --fuzz=oss --fuzz=tls --disable-tests + +# Find fuzzing targets. +for fuzzer in $(find ../dist/Debug/bin -name "nssfuzz-*" -printf "%f\n"); do + name=${fuzzer:8} + [ "${disabled[$name]}" ] && continue; + + # Copy the binary. + cp ../dist/Debug/bin/$fuzzer $OUT/$name + + # Zip and copy the corpus, if any. + if [ -d "$SRC/nss-corpus/$name" ]; then + zip $OUT/${name}_seed_corpus.zip $SRC/nss-corpus/$name/* + fi +done @@ -1,4 +1,10 @@ #!/usr/bin/env bash +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +################################################################################ +# # This script builds NSS with gyp and ninja. # # This build system is still under development. It does not yet support all |