-
-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: move again stuff using libfuzzer
And fix documentation.
- Loading branch information
1 parent
9797bd7
commit fa2ab06
Showing
16 changed files
with
25 additions
and
26 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
15 changes: 7 additions & 8 deletions
15
tests/build-fuzzer.sh → tests/fuzzer/build.sh
100644 → 100755
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 |
---|---|---|
@@ -1,30 +1,29 @@ | ||
#!/bin/bash -eu | ||
|
||
build(){ | ||
build() { | ||
export CFLAGS="$1" | ||
export CXXFLAGS="$1" | ||
|
||
./autogen.sh | ||
./configure CC="$CC" CFLAGS="$CFLAGS" LDFLAGS="$CFLAGS" \ | ||
./configure CC="${CC:-clang}" CFLAGS="$CFLAGS" LDFLAGS="$CFLAGS" \ | ||
--enable-fuzzer=yes --disable-shared --disable-hardening --enable-pie | ||
|
||
make -j$(nproc) | ||
mkdir -p tests/seed/fuzz-decode_Corpus | ||
mkdir -p tests/fuzzer/corpus | ||
} | ||
|
||
run(){ | ||
run() { | ||
cd tests | ||
./fuzz-decode seed/fuzz-decode_Corpus seed/fuzz-decode_seed_corpus | ||
./fuzz-decode fuzzer/corpus fuzzer/seed-corpus | ||
} | ||
|
||
help(){ | ||
help() { | ||
echo "use: ./$0 ASan | UBSan | MSan | Run" | ||
} | ||
|
||
case $1 in | ||
ASan) build "-O1 -fno-omit-frame-pointer -gline-tables-only -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=address -fsanitize-address-use-after-scope -fsanitize=fuzzer-no-link" ;; | ||
UBSan) build "-O1 -fno-omit-frame-pointer -gline-tables-only -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=array-bounds,bool,builtin,enum,float-divide-by-zero,function,integer-divide-by-zero,null,object-size,return,returns-nonnull-attribute,shift,signed-integer-overflow,unsigned-integer-overflow,unreachable,vla-bound,vptr -fno-sanitize-recover=array-bounds,bool,builtin,enum,float-divide-by-zero,function,integer-divide-by-zero,null,object-size,return,returns-nonnull-attribute,shift,signed-integer-overflow,unreachable,vla-bound,vptr -fsanitize=fuzzer-no-link" ;; | ||
MSan) build "-O1 -fno-omit-frame-pointer -gline-tables-only -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=memory -fsanitize-memory-track-origins -fsanitize=fuzzer-no-link" ;; | ||
run) run $2 ;; | ||
run) run ${2:-} ;; | ||
*) help ;; | ||
esac |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.