Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1177759 - build script for oss-fuzz, r=ttaubert
Differential Revision: https://nss-review.dev.mozaws.net/D172 --HG-- extra : rebase_source : 24f94455ebb3af8a07abcaebaa81f75a4007a686 extra : amend_source : 0bdc9b3f42ee36a1b0f66836e77c679c74396bec
- Loading branch information
1 parent
44b2296
commit 1459c70
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters