Skip to content

Commit

Permalink
follow the latest version of clang
Browse files Browse the repository at this point in the history
  • Loading branch information
K.Kosako committed Aug 7, 2019
1 parent 86bfc9b commit 51e40ec
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions build_harnesses.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,15 @@ make clean
autoreconf -vfi

# build the library with ASAN
#NO_LINK="-fsanitize=fuzzer-no-link"
NO_LINK=""
./configure CC=clang LD=clang CFLAGS="-g -fsanitize=address -fno-omit-frame-pointer $NO_LINK" LDFLAGS="-g -fsanitize=address -fno-omit-frame-pointer $NO_LINK"
./configure CC=clang LD=clang CFLAGS="-g -fsanitize=address -fno-omit-frame-pointer" LDFLAGS="-g -fsanitize=address -fno-omit-frame-pointer"
make -j4

OUT=`pwd`/fuzzers
mkdir -p $OUT
LIBFUZZER_FLAGS="-fsanitize=fuzzer,address -fno-omit-frame-pointer"
#LIBS="src/.libs/libonig.a"
LIBS="src/.libs/libonig.a /usr/local/lib/libLLVMFuzzerMain.a"
LIBS="src/.libs/libonig.a"

CFLAGS="-Isrc -g $LIBFUZZER_FLAGS"
CFLAGS="-Isrc -g -fsanitize=fuzzer,address -fno-omit-frame-pointer"
CFLAGS_M="-Isrc -g -fsanitize=fuzzer-no-link,address -fno-omit-frame-pointer"

# Libfuzzer builds
clang++ contributed/libfuzzer-onig.cpp $LIBS $CFLAGS -o $OUT/libfuzzer-onig
Expand All @@ -25,7 +22,8 @@ clang harnesses/deluxe-encode-harness.c $LIBS $CFLAGS -o $OUT/deluxe-encode-libf

clang -DUTF16_BE harnesses/encode-harness.c $LIBS $CFLAGS -o $OUT/utf16-be-libfuzzer
clang -DUTF16_LE harnesses/encode-harness.c $LIBS $CFLAGS -o $OUT/utf16-le-libfuzzer
clang -DWITH_READ_MAIN harnesses/encode-harness.c src/.libs/libonig.a $CFLAGS -o $OUT/main-encode
clang -DWITH_READ_MAIN -DUTF16_LE harnesses/encode-harness.c src/.libs/libonig.a $CFLAGS -o $OUT/main-utf16-le
clang -DWITH_READ_MAIN -DUTF16_BE harnesses/encode-harness.c src/.libs/libonig.a $CFLAGS -o $OUT/main-utf16-be
clang -DWITH_READ_MAIN harnesses/deluxe-encode-harness.c $LIBS $CFLAGS -o $OUT/main-deluxe-encode

clang -DWITH_READ_MAIN harnesses/encode-harness.c src/.libs/libonig.a $CFLAGS_M -o $OUT/main-encode
clang -DWITH_READ_MAIN -DUTF16_LE harnesses/encode-harness.c src/.libs/libonig.a $CFLAGS_M -o $OUT/main-utf16-le
clang -DWITH_READ_MAIN -DUTF16_BE harnesses/encode-harness.c src/.libs/libonig.a $CFLAGS_M -o $OUT/main-utf16-be
clang -DWITH_READ_MAIN harnesses/deluxe-encode-harness.c $LIBS $CFLAGS_M -o $OUT/main-deluxe-encode

0 comments on commit 51e40ec

Please sign in to comment.