Skip to content

Commit

Permalink
Bug 1177759 - build script for oss-fuzz, r=ttaubert
Browse files Browse the repository at this point in the history
Differential Revision: https://nss-review.dev.mozaws.net/D172

--HG--
extra : rebase_source : 24f94455ebb3af8a07abcaebaa81f75a4007a686
extra : amend_source : 0bdc9b3f42ee36a1b0f66836e77c679c74396bec
  • Loading branch information
franziskuskiefer committed Jan 24, 2017
1 parent 44b2296 commit 1459c70
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
28 changes: 28 additions & 0 deletions 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
6 changes: 6 additions & 0 deletions build.sh
@@ -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
Expand Down

0 comments on commit 1459c70

Please sign in to comment.