Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Bug 1316274 - Fuzzing mode: Move fuzz/ to GYP, remove Makefiles and m…
…anifests r=franziskus

Differential Revision: https://nss-review.dev.mozaws.net/D52
* * *
fixup
From ab8763469977a338a61d610ed69ef045244630f3 Mon Sep 17 00:00:00 2001

--HG--
rename : fuzz/nssfuzz/cert_target.cc => fuzz/cert_target.cc
rename : fuzz/nssfuzz/nssfuzz.cc => fuzz/nssfuzz.cc
rename : fuzz/nssfuzz/pkcs8_target.cc => fuzz/pkcs8_target.cc
rename : fuzz/nssfuzz/registry.h => fuzz/registry.h
rename : fuzz/nssfuzz/shared.h => fuzz/shared.h
rename : fuzz/nssfuzz/spki_target.cc => fuzz/spki_target.cc
  • Loading branch information
Tim Taubert committed Nov 11, 2016
1 parent c3e0471 commit 36bc203
Show file tree
Hide file tree
Showing 20 changed files with 84 additions and 222 deletions.
6 changes: 5 additions & 1 deletion build.sh
Expand Up @@ -85,8 +85,12 @@ enable_fuzz()
gyp_params+=(-Duse_asan=1)
gyp_params+=(-Duse_ubsan=1)
gyp_params+=(-Duse_sancov=edge)

# Adding debug symbols even for opt builds.
nspr_opt+=(--enable-debug-symbols)

# Clone libFuzzer repository.
$cwd/fuzz/clone_libfuzzer.sh &>/dev/null
}

# parse command line arguments
Expand All @@ -97,7 +101,7 @@ while [ $# -gt 0 ]; do
-j) ninja_params+=(-j "$2"); shift ;;
-v) ninja_params+=(-v) ;;
--test) gyp_params+=(-Dtest_build=1) ;;
--fuzz) gyp_params+=(-Dtest_build=1 -Dfuzz=1); check_sanitizer; enable_fuzz ;;
--fuzz) gyp_params+=(-Dtest_build=1 -Dfuzz=1); enable_fuzz ;;
--scan-build) scanbuild=(scan-build) ;;
--scan-build=?*) scanbuild=(scan-build -o "${1#*=}") ;;
--opt|-o) opt_build=1 ;;
Expand Down
42 changes: 0 additions & 42 deletions fuzz/Makefile

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion fuzz/clone_libfuzzer.sh
Expand Up @@ -3,7 +3,7 @@
cd $(dirname $0)
mkdir tmp/
git clone -q https://chromium.googlesource.com/chromium/llvm-project/llvm/lib/Fuzzer tmp/
mv tmp/.git libFuzzer
mv tmp/.git libFuzzer/
rm -fr tmp
cd libFuzzer
git reset --hard 4333f2ca71eb7951fcafcdcb111012fbe25c5e7e
10 changes: 0 additions & 10 deletions fuzz/common.mk

This file was deleted.

33 changes: 33 additions & 0 deletions fuzz/fuzz.gyp
@@ -0,0 +1,33 @@
# 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/.
{
'includes': [
'../coreconf/config.gypi',
'../cmd/platlibs.gypi'
],
'targets': [
{
'target_name': 'nssfuzz',
'type': 'executable',
'sources': [
'cert_target.cc',
'pkcs8_target.cc',
'spki_target.cc',
'nssfuzz.cc',
],
'dependencies': [
'<(DEPTH)/exports.gyp:nss_exports',
'<(DEPTH)/fuzz/libFuzzer/libFuzzer.gyp:libFuzzer'
]
}
],
'target_defaults': {
'include_dirs': [
'libFuzzer',
],
},
'variables': {
'module': 'nss',
}
}
45 changes: 0 additions & 45 deletions fuzz/libFuzzer/Makefile

This file was deleted.

14 changes: 0 additions & 14 deletions fuzz/libFuzzer/config.mk

This file was deleted.

36 changes: 36 additions & 0 deletions fuzz/libFuzzer/libFuzzer.gyp
@@ -0,0 +1,36 @@
# 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/.
{
'includes': [
'../../coreconf/config.gypi'
],
'targets': [
{
'target_name': 'libFuzzer',
'type': 'static_library',
'sources': [
'FuzzerCrossOver.cpp',
'FuzzerDriver.cpp',
'FuzzerExtFunctionsDlsym.cpp',
'FuzzerExtFunctionsWeak.cpp',
'FuzzerIO.cpp',
'FuzzerLoop.cpp',
'FuzzerMutate.cpp',
'FuzzerSHA1.cpp',
'FuzzerTracePC.cpp',
'FuzzerTraceState.cpp',
'FuzzerUtil.cpp',
'FuzzerUtilDarwin.cpp',
'FuzzerUtilLinux.cpp',
],
'cflags': [
'-O2',
],
'cflags/': [
['exclude', '-fsanitize='],
['exclude', '-fsanitize-'],
]
}
],
}
26 changes: 0 additions & 26 deletions fuzz/libFuzzer/manifest.mn

This file was deleted.

8 changes: 0 additions & 8 deletions fuzz/manifest.mn

This file was deleted.

File renamed without changes.
45 changes: 0 additions & 45 deletions fuzz/nssfuzz/Makefile

This file was deleted.

24 changes: 0 additions & 24 deletions fuzz/nssfuzz/manifest.mn

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 0 additions & 4 deletions manifest.mn
Expand Up @@ -11,7 +11,3 @@ IMPORTS = nspr20/v4.8 \
RELEASE = nss

DIRS = coreconf lib cmd gtests

ifdef FUZZ
DIRS += fuzz
endif
11 changes: 9 additions & 2 deletions nss.gyp
Expand Up @@ -233,18 +233,25 @@
[ 'fuzz==1', {
'targets': [
{
'target_name': 'fuzz',
'target_name': 'fuzz_warning',
'type': 'none',
'actions': [
{
'action_name': 'warn_fuzz',
'action_name': 'fuzz_warning',
'action': ['cat', 'fuzz/warning.txt'],
'inputs': ['fuzz/warning.txt'],
'ninja_use_console': 1,
'outputs': ['dummy'],
}
],
},
{
'target_name': 'fuzz',
'type': 'none',
'dependencies': [
'fuzz/fuzz.gyp:nssfuzz',
]
},
],
}],
],
Expand Down

0 comments on commit 36bc203

Please sign in to comment.