From 487e9f4ed606c8388ba854bc37e4df98e312278a Mon Sep 17 00:00:00 2001 From: Mike Aizatsky Date: Fri, 18 Nov 2016 11:45:51 -0800 Subject: [PATCH] [infra] removing FUZZER_LDFLAGS (fixes #73) Workarounds libc++abi issue by folding libc++abi.a into libc++.a. Will keep FUZZER_LDFLAGS empty for a while until tpm2 is fixed. --- docs/new_target.md | 4 +--- .../base-clang/checkout_build_install_llvm.sh | 14 +++++++++++--- infra/base-images/base-libfuzzer/Dockerfile | 2 +- infra/base-images/base-libfuzzer/README.md | 1 - infra/base-images/base-libfuzzer/compile | 1 - infra/templates.py | 2 +- targets/boringssl/build.sh | 4 +--- targets/c-ares/build.sh | 4 +--- targets/curl/build.sh | 2 +- targets/expat/build.sh | 2 +- targets/ffmpeg/build.sh | 5 +---- targets/file/build.sh | 2 +- targets/freetype2/build.sh | 2 +- targets/harfbuzz/build.sh | 3 +-- targets/icu/build.sh | 4 ++-- targets/json/build.sh | 2 +- targets/lcms/build.sh | 2 +- targets/libarchive/build.sh | 2 +- targets/libass/build.sh | 3 +-- targets/libchewing/build.sh | 2 +- targets/libjpeg-turbo/build.sh | 2 +- targets/libpng/build.sh | 2 +- targets/libteken/build.sh | 2 +- targets/libtsm/build.sh | 2 +- targets/libxml2/build.sh | 2 +- targets/nss/build.sh | 2 +- targets/openssl/build.sh | 2 +- targets/ots/build.sh | 4 +--- targets/pcre2/build.sh | 3 +-- targets/re2/build.sh | 2 +- targets/sqlite3/build.sh | 2 +- targets/woff2/build.sh | 3 +-- targets/zlib/build.sh | 2 +- 33 files changed, 42 insertions(+), 51 deletions(-) diff --git a/docs/new_target.md b/docs/new_target.md index fb6c87901..64a6fbce7 100644 --- a/docs/new_target.md +++ b/docs/new_target.md @@ -105,8 +105,7 @@ make -j$(nproc) clean all # build the fuzzer, linking with libFuzzer and libexpat.a $CXX $CXXFLAGS -std=c++11 -Ilib/ \ $SRC/parse_fuzzer.cc -o /out/expat_parse_fuzzer \ - -lfuzzer .libs/libexpat.a \ - $FUZZER_LDFLAGS + -lfuzzer .libs/libexpat.a ``` ### build.sh Script Environment @@ -125,7 +124,6 @@ These flags are provided in following environment variables: | ------------- | -------- | `$CC`, `$CXX`, `$CCC` | The C and C++ compiler binaries. | `$CFLAGS`, `$CXXFLAGS` | C and C++ compiler flags. -| `$FUZZER_LDFLAGS` | Linker flags for fuzzer binaries. Many well-crafted build scripts will automatically use these variables. If not, passing them manually to a build tool might be required. diff --git a/infra/base-images/base-clang/checkout_build_install_llvm.sh b/infra/base-images/base-clang/checkout_build_install_llvm.sh index 019780585..edc2c23e0 100755 --- a/infra/base-images/base-clang/checkout_build_install_llvm.sh +++ b/infra/base-images/base-clang/checkout_build_install_llvm.sh @@ -26,15 +26,23 @@ cd $SRC/llvm/projects && git clone --depth 1 http://llvm.org/git/libcxx.git cd $SRC/llvm/projects && git clone --depth 1 http://llvm.org/git/libcxxabi.git # Build & Install -mkdir -p /work/llvm -cd /work/llvm +mkdir -p $WORK/llvm +cd $WORK/llvm cmake -G "Ninja" \ -DLIBCXX_ENABLE_SHARED=OFF -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON \ -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD="X86" \ $SRC/llvm ninja ninja install -rm -rf /work/llvm +rm -rf $WORK/llvm + +# Merge libc++abi.a into libc++.a +# https://llvm.org/bugs/show_bug.cgi?id=30919 +mkdir $WORK/libcxx +cd $WORK/libcxx +ar -x /usr/local/lib/libc++abi.a +ar -q /usr/local/lib/libc++.a *.o +rm -rf $WORK/libcxx # Copy libfuzzer sources mkdir $SRC/libfuzzer diff --git a/infra/base-images/base-libfuzzer/Dockerfile b/infra/base-images/base-libfuzzer/Dockerfile index 7c8cb1e0f..162b0295c 100644 --- a/infra/base-images/base-libfuzzer/Dockerfile +++ b/infra/base-images/base-libfuzzer/Dockerfile @@ -21,7 +21,7 @@ RUN apt-get install -y git subversion jq zip python3 ENV SANITIZER_FLAGS="-fsanitize=address" ENV COV_FLAGS="-fsanitize-coverage=edge,indirect-calls,8bit-counters" ENV ASAN_OPTIONS="symbolize=1:detect_leaks=0" -ENV FUZZER_LDFLAGS "-Wl,-whole-archive /usr/local/lib/libc++.a /usr/local/lib/libc++abi.a -Wl,-no-whole-archive" +ENV FUZZER_LDFLAGS "" COPY coverage_report compile srcmap reproduce run just_run test \ /usr/local/bin/ diff --git a/infra/base-images/base-libfuzzer/README.md b/infra/base-images/base-libfuzzer/README.md index 2b163dff2..9f8b1f9ca 100644 --- a/infra/base-images/base-libfuzzer/README.md +++ b/infra/base-images/base-libfuzzer/README.md @@ -38,7 +38,6 @@ These flags are provided in following environment variables: | `$CXX`, `$CCC` | The C++ compiler binary. | `$CFLAGS` | C compiler flags. | `$CXXFLAGS` | C++ compiler flags. -| `$FUZZER_LDFLAGS` | Linker flags for fuzzer binaries. Many well-crafted build scripts will automatically use these variables. If not, passing them manually to a build tool might be required. diff --git a/infra/base-images/base-libfuzzer/compile b/infra/base-images/base-libfuzzer/compile index 586f36042..9ec57e917 100755 --- a/infra/base-images/base-libfuzzer/compile +++ b/infra/base-images/base-libfuzzer/compile @@ -33,7 +33,6 @@ echo "CC=$CC" echo "CXX=$CXX" echo "CFLAGS=$CFLAGS" echo "CXXFLAGS=$CXXFLAGS" -echo "FUZZER_LDFLAGS=$FUZZER_LDFLAGS" echo "---------------------------------------------------------------" diff --git a/infra/templates.py b/infra/templates.py index bc9695718..defcf15b7 100755 --- a/infra/templates.py +++ b/infra/templates.py @@ -93,5 +93,5 @@ BUILD_TEMPLATE = """\ # e.g. # $CXX $CXXFLAGS -std=c++11 -Iinclude \\ # /path/to/name_of_fuzzer.cc -o /out/name_of_fuzzer \\ -# -lfuzzer /path/to/library.a $FUZZER_LDFLAGS +# -lfuzzer /path/to/library.a """ diff --git a/targets/boringssl/build.sh b/targets/boringssl/build.sh index 1c5d3256f..832b96654 100755 --- a/targets/boringssl/build.sh +++ b/targets/boringssl/build.sh @@ -20,11 +20,9 @@ cd $WORK/boringssl CFLAGS="$CFLAGS -DBORINGSSL_UNSAFE_FUZZER_MODE" CXXFLAGS="$CXXFLAGS -DBORINGSSL_UNSAFE_FUZZER_MODE" -export LDFLAGS=$FUZZER_LDFLAGS cmake -GNinja -DCMAKE_C_COMPILER=$CC -DCMAKE_CXX_COMPILER=$CXX \ -DCMAKE_C_FLAGS="$CFLAGS" -DCMAKE_CXX_FLAGS="$CXXFLAGS" \ - -DCMAKE_EXE_LINKER_FLAGS="$FUZZER_LDFLAGS" \ $SRC/boringssl/ ninja @@ -35,7 +33,7 @@ find . -name "*.a" for F in $fuzzerFiles; do fuzzerName=$(basename $F .cc) echo "Building fuzzer $fuzzerName" - $CXX $CXXFLAGS $FUZZER_LDFLAGS -std=c++11 \ + $CXX $CXXFLAGS -std=c++11 \ -o $OUT/${fuzzerName} -lfuzzer $F \ -I $SRC/boringssl/include ./ssl/libssl.a ./crypto/libcrypto.a diff --git a/targets/c-ares/build.sh b/targets/c-ares/build.sh index f00703af3..87c92739d 100755 --- a/targets/c-ares/build.sh +++ b/targets/c-ares/build.sh @@ -15,8 +15,6 @@ # ################################################################################ -export LDFLAGS="$FUZZER_LDFLAGS" - # Build the target. ./buildconf ./configure @@ -27,4 +25,4 @@ make CFLAGS= -j$(nproc) all $CXX $CXXFLAGS -std=c++11 -I. \ $SRC/c_ares_ares_create_query_fuzzer.cc \ -o $OUT/c_ares_ares_create_query_fuzzer \ - -lfuzzer $SRC/c-ares/.libs/libcares.a $FUZZER_LDFLAGS + -lfuzzer $SRC/c-ares/.libs/libcares.a diff --git a/targets/curl/build.sh b/targets/curl/build.sh index ccd929353..a119be820 100755 --- a/targets/curl/build.sh +++ b/targets/curl/build.sh @@ -18,5 +18,5 @@ ./buildconf ./configure --disable-shared --enable-debug --enable-maintainer-mode --disable-symbol-hiding --disable-threaded-resolver --enable-ipv6 --with-random=/dev/null make -j$(nproc) -$CXX $CXXFLAGS $SRC/curl_fuzzer.cc -Iinclude lib/.libs/libcurl.a -lssl -lcrypto -lz -lfuzzer -o $OUT/curl_fuzzer $FUZZER_LDFLAGS +$CXX $CXXFLAGS $SRC/curl_fuzzer.cc -Iinclude lib/.libs/libcurl.a -lssl -lcrypto -lz -lfuzzer -o $OUT/curl_fuzzer cp $SRC/*.dict $SRC/*.options $OUT/ diff --git a/targets/expat/build.sh b/targets/expat/build.sh index e7249afb9..06e03612d 100755 --- a/targets/expat/build.sh +++ b/targets/expat/build.sh @@ -22,6 +22,6 @@ make -j$(nproc) all $CXX $CXXFLAGS -std=c++11 -Ilib/ \ $SRC/parse_fuzzer.cc -o $OUT/parse_fuzzer \ - -lfuzzer .libs/libexpat.a $FUZZER_LDFLAGS + -lfuzzer .libs/libexpat.a cp $SRC/*.dict $SRC/*.options $OUT/ diff --git a/targets/ffmpeg/build.sh b/targets/ffmpeg/build.sh index 52965e939..3b8248e99 100755 --- a/targets/ffmpeg/build.sh +++ b/targets/ffmpeg/build.sh @@ -15,8 +15,6 @@ # ################################################################################ -export LDFLAGS="$FUZZER_LDFLAGS" - # Build dependencies. export FFMPEG_DEPS_PATH=$SRC/ffmpeg_deps mkdir -p $FFMPEG_DEPS_PATH @@ -130,7 +128,6 @@ cd $SRC/x265/build/linux cmake -G "Unix Makefiles" \ -DCMAKE_C_COMPILER=$CC -DCMAKE_CXX_COMPILER=$CXX \ -DCMAKE_C_FLAGS="$CFLAGS" -DCMAKE_CXX_FLAGS="$CXXFLAGS" \ - -DCMAKE_EXE_LINKER_FLAGS="$FUZZER_LDFLAGS" \ -DCMAKE_INSTALL_PREFIX="$FFMPEG_DEPS_PATH" -DENABLE_SHARED:bool=off \ ../../source make clean @@ -175,7 +172,7 @@ cd $SRC/ffmpeg export TEMP_VAR_CODEC="AV_CODEC_ID_H264" export TEMP_VAR_CODEC_TYPE="VIDEO" -FFMPEG_FUZZERS_COMMON_FLAGS="-lfuzzer $FUZZER_LDFLAGS \ +FFMPEG_FUZZERS_COMMON_FLAGS="-lfuzzer \ -L$FFMPEG_DEPS_PATH/lib \ -Llibavcodec -Llibavdevice -Llibavfilter -Llibavformat -Llibavresample \ -Llibavutil -Llibpostproc -Llibswscale -Llibswresample \ diff --git a/targets/file/build.sh b/targets/file/build.sh index 39c9bd675..6a5867a5b 100755 --- a/targets/file/build.sh +++ b/targets/file/build.sh @@ -21,7 +21,7 @@ make V=1 all $CXX $CXXFLAGS -std=c++11 -Isrc/ \ $SRC/magic_fuzzer.cc -o $OUT/magic_fuzzer \ - -lfuzzer ./src/.libs/libmagic.a $FUZZER_LDFLAGS + -lfuzzer ./src/.libs/libmagic.a cp ./magic/magic.mgc $OUT/ diff --git a/targets/freetype2/build.sh b/targets/freetype2/build.sh index 6089f3f5a..710f533d9 100755 --- a/targets/freetype2/build.sh +++ b/targets/freetype2/build.sh @@ -20,7 +20,7 @@ ./configure make -j$(nproc) clean all -$CXX $CXXFLAGS $FUZZER_LDFLAGS -std=c++11 \ +$CXX $CXXFLAGS -std=c++11 \ -I./include -I. \ ./src/tools/ftfuzzer/ftfuzzer.cc -o $OUT/ftfuzzer \ ./objs/*.o -lfuzzer \ diff --git a/targets/harfbuzz/build.sh b/targets/harfbuzz/build.sh index 3ba1a4a1f..463234a08 100755 --- a/targets/harfbuzz/build.sh +++ b/targets/harfbuzz/build.sh @@ -17,10 +17,9 @@ # Build the library. ./autogen.sh -export LDFLAGS=$FUZZER_LDFLAGS ./configure make -j$(nproc) clean all $CXX $CXXFLAGS -std=c++11 -Isrc \ $SRC/harfbuzz_fuzzer.cc -o $OUT/harfbuzz_fuzzer \ - -lfuzzer src/.libs/*.o src/hb-ucdn/.libs/*.o $FUZZER_LDFLAGS + -lfuzzer src/.libs/*.o src/hb-ucdn/.libs/*.o diff --git a/targets/icu/build.sh b/targets/icu/build.sh index 3dc30aa59..9cca54847 100755 --- a/targets/icu/build.sh +++ b/targets/icu/build.sh @@ -24,7 +24,7 @@ DEFINES="-DU_CHARSET_IS_UTF8=1 -DU_USING_ICU_NAMESPACE=0 -DU_ENABLE_DYLOAD=0 -DU CFLAGS="$CFLAGS $DEFINES" CXXFLAGS="$CXXFLAGS $DEFINES" -CFLAGS=$CFLAGS CXXFLAGS=$CXXFLAGS CC=$CC CXX=$CXX LDFLAGS=$FUZZER_LDFLAGS \ +CFLAGS=$CFLAGS CXXFLAGS=$CXXFLAGS CC=$CC CXX=$CXX \ /bin/bash $SRC/icu/source/runConfigureICU Linux \ --with-library-bits=64 --with-data-packaging=static --enable-static --disable-shared @@ -42,7 +42,7 @@ for fuzzer in $FUZZERS; do $CXX $CXXFLAGS -std=c++11 \ $SRC/$fuzzer.cc -o $OUT/$fuzzer \ -I$SRC/icu/source/common -I$SRC/icu/source/i18n -L$WORK/icu/lib \ - -lfuzzer -licui18n -licuuc -licutu -licudata $FUZZER_LDFLAGS + -lfuzzer -licui18n -licuuc -licutu -licudata done cp $SRC/*.dict $SRC/*.options $OUT/ diff --git a/targets/json/build.sh b/targets/json/build.sh index 54359bb86..304b7320d 100755 --- a/targets/json/build.sh +++ b/targets/json/build.sh @@ -17,6 +17,6 @@ $CXX $CXXFLAGS -std=c++11 -Isrc/ \ $SRC/parse_fuzzer.cc -o $OUT/parse_fuzzer \ - -lfuzzer $FUZZER_LDFLAGS + -lfuzzer cp $SRC/*.options $OUT/ diff --git a/targets/lcms/build.sh b/targets/lcms/build.sh index 12f900f71..b5a258a4f 100755 --- a/targets/lcms/build.sh +++ b/targets/lcms/build.sh @@ -24,7 +24,7 @@ FUZZERS="cmsIT8_load_fuzzer cms_transform_fuzzer" for F in $FUZZERS; do $CC $CFLAGS -Iinclude \ $SRC/$F.c -o $OUT/$F \ - -lfuzzer src/.libs/liblcms2.a $FUZZER_LDFLAGS + -lfuzzer src/.libs/liblcms2.a done cp $SRC/icc.dict $SRC/*.options $OUT/ diff --git a/targets/libarchive/build.sh b/targets/libarchive/build.sh index c99a4c604..6dd6707a5 100755 --- a/targets/libarchive/build.sh +++ b/targets/libarchive/build.sh @@ -23,5 +23,5 @@ make -j$(nproc) all # build your fuzzer(s) $CXX $CXXFLAGS -Ilibarchive \ $SRC/libarchive_fuzzer.cc -o $OUT/libarchive_fuzzer \ - -lfuzzer .libs/libarchive.a $FUZZER_LDFLAGS \ + -lfuzzer .libs/libarchive.a \ -lbz2 -llzo2 -llzma -lxml2 -lz -lcrypto -llz4 diff --git a/targets/libass/build.sh b/targets/libass/build.sh index a0093fa89..d41ccfddd 100755 --- a/targets/libass/build.sh +++ b/targets/libass/build.sh @@ -30,7 +30,6 @@ make -j$(nproc) $CXX $CXXFLAGS -std=c++11 -I$SRC/libass \ $SRC/libass_fuzzer.cc -o $OUT/libass_fuzzer \ -lfuzzer libass/.libs/libass.a \ - -Wl,-Bstatic -lfontconfig -lfribidi -lfreetype -lz -lpng12 -lexpat -Wl,-Bdynamic \ - $FUZZER_LDFLAGS + -Wl,-Bstatic -lfontconfig -lfribidi -lfreetype -lz -lpng12 -lexpat cp $SRC/*.dict $SRC/*.options $OUT/ diff --git a/targets/libchewing/build.sh b/targets/libchewing/build.sh index 1726d77ac..9693ea462 100755 --- a/targets/libchewing/build.sh +++ b/targets/libchewing/build.sh @@ -29,7 +29,7 @@ for variant in default random_init dynamic_config; do -o $OUT/chewing_${variant}_fuzzer \ $SRC/chewing_${variant}_fuzzer.c $SRC/chewing_fuzzer_common.c \ test/stress.o test/.libs/libtesthelper.a src/.libs/libchewing.a \ - -lfuzzer $FUZZER_LDFLAGS + -lfuzzer done # install data files diff --git a/targets/libjpeg-turbo/build.sh b/targets/libjpeg-turbo/build.sh index a06526692..992134295 100755 --- a/targets/libjpeg-turbo/build.sh +++ b/targets/libjpeg-turbo/build.sh @@ -21,6 +21,6 @@ make "-j$(nproc)" $CXX $CXXFLAGS -std=c++11 -I. \ $SRC/libjpeg_turbo_fuzzer.cc -o $OUT/libjpeg_turbo_fuzzer \ - -lfuzzer ./.libs/libturbojpeg.a $FUZZER_LDFLAGS + -lfuzzer ./.libs/libturbojpeg.a cp $SRC/libjpeg_turbo_fuzzer_seed_corpus.zip $OUT/ diff --git a/targets/libpng/build.sh b/targets/libpng/build.sh index 77c46076a..a5d4760fe 100755 --- a/targets/libpng/build.sh +++ b/targets/libpng/build.sh @@ -28,6 +28,6 @@ make -j$(nproc) clean all # build libpng_read_fuzzer $CXX $CXXFLAGS -std=c++11 -I. -lz \ $SRC/libpng_read_fuzzer.cc -o $OUT/libpng_read_fuzzer \ - -lfuzzer .libs/libpng16.a $FUZZER_LDFLAGS + -lfuzzer .libs/libpng16.a cp $SRC/*.dict $SRC/*.options $OUT/ diff --git a/targets/libteken/build.sh b/targets/libteken/build.sh index 81da4f619..86785ff72 100755 --- a/targets/libteken/build.sh +++ b/targets/libteken/build.sh @@ -23,4 +23,4 @@ CFLAGS="$CFLAGS -D__unused=" pmake -C teken/libteken libteken.a $CC $CFLAGS -Iteken \ -o $OUT/libteken_fuzzer \ libteken_fuzzer.c \ - -lfuzzer teken/libteken/libteken.a $FUZZER_LDFLAGS + -lfuzzer teken/libteken/libteken.a diff --git a/targets/libtsm/build.sh b/targets/libtsm/build.sh index 3208b0bd7..28577ff10 100755 --- a/targets/libtsm/build.sh +++ b/targets/libtsm/build.sh @@ -24,4 +24,4 @@ $CC $CFLAGS -Isrc/tsm \ -o $OUT/libtsm_fuzzer \ $SRC/libtsm_fuzzer.c \ .libs/libtsm.a \ - -lfuzzer $FUZZER_LDFLAGS + -lfuzzer diff --git a/targets/libxml2/build.sh b/targets/libxml2/build.sh index 27a346ce2..12cb3ad19 100755 --- a/targets/libxml2/build.sh +++ b/targets/libxml2/build.sh @@ -23,7 +23,7 @@ make -j$(nproc) clean all for fuzzer in libxml2_xml_read_memory_fuzzer libxml2_xml_regexp_compile_fuzzer; do $CXX $CXXFLAGS -std=c++11 -Iinclude/ \ $SRC/$fuzzer.cc -o $OUT/$fuzzer \ - -lfuzzer .libs/libxml2.a $FUZZER_LDFLAGS + -lfuzzer .libs/libxml2.a done cp $SRC/*.dict $SRC/*.options $OUT/ diff --git a/targets/nss/build.sh b/targets/nss/build.sh index fd2483677..d2a126ed2 100755 --- a/targets/nss/build.sh +++ b/targets/nss/build.sh @@ -57,7 +57,7 @@ for fuzzer in $FUZZERS; do -lfuzzer \ $WORK/nss/lib/libnss.a $WORK/nss/lib/libnssutil.a \ $WORK/nss/lib/libnspr4.a $WORK/nss/lib/libplc4.a $WORK/nss/lib/libplds4.a \ - $WORK/nss/lib/prlog2.o -o $OUT/$fuzzer $FUZZER_LDFLAGS + $WORK/nss/lib/prlog2.o -o $OUT/$fuzzer done # Archive and copy to $OUT seed corpus if the build succeeded. diff --git a/targets/openssl/build.sh b/targets/openssl/build.sh index 18515d972..0ce45f087 100755 --- a/targets/openssl/build.sh +++ b/targets/openssl/build.sh @@ -16,7 +16,7 @@ ################################################################################ ./config enable-fuzz-libfuzzer -DPEDANTIC no-shared --with-fuzzer-lib=/usr/lib/libfuzzer $CFLAGS -make -j$(nproc) EX_LIBS="-ldl $FUZZER_LDFLAGS" +make -j$(nproc) EX_LIBS="-ldl" fuzzers=$(find fuzz -executable -type f '!' -name \*.py '!' -name \*-test) for f in $fuzzers; do diff --git a/targets/ots/build.sh b/targets/ots/build.sh index 6ebe9b7ff..9b516f898 100755 --- a/targets/ots/build.sh +++ b/targets/ots/build.sh @@ -19,14 +19,12 @@ ./autogen.sh ./configure -#export LDFLAGS=$FUZZER_LDFLAGS make libots.a libwoff2.a libbrotli.a # Build the fuzzer. $CXX $CXXFLAGS -std=c++11 -Iinclude \ $SRC/ots_fuzzer.cc -o $OUT/ots_fuzzer \ - -lfuzzer -lz $SRC/ots/libots.a $SRC/ots/libwoff2.a $SRC/ots/libbrotli.a \ - $FUZZER_LDFLAGS + -lfuzzer -lz $SRC/ots/libots.a $SRC/ots/libwoff2.a $SRC/ots/libbrotli.a cp $SRC/ots_fuzzer.options $OUT/ zip $OUT/ots_fuzzer_seed_corpus.zip $SRC/seed_corpus/* diff --git a/targets/pcre2/build.sh b/targets/pcre2/build.sh index 473d89a51..fdcec503f 100755 --- a/targets/pcre2/build.sh +++ b/targets/pcre2/build.sh @@ -24,5 +24,4 @@ make -j$(nproc) clean all # Build the target. $CXX $CXXFLAGS -o $OUT/pcre2_fuzzer \ - -lfuzzer .libs/libpcre2-fuzzsupport.a .libs/libpcre2-8.a \ - $FUZZER_LDFLAGS + -lfuzzer .libs/libpcre2-fuzzsupport.a .libs/libpcre2-8.a diff --git a/targets/re2/build.sh b/targets/re2/build.sh index db9a514fb..066049dc8 100755 --- a/targets/re2/build.sh +++ b/targets/re2/build.sh @@ -30,6 +30,6 @@ make -j$(nproc) obj/libre2.a # Second, build our fuzzers. $CXX $CXXFLAGS -std=c++11 -I. \ $SRC/re2_fuzzer.cc -o $OUT/re2_fuzzer \ - -lfuzzer ./obj/libre2.a $FUZZER_LDFLAGS + -lfuzzer ./obj/libre2.a cp $SRC/*.options $OUT/ diff --git a/targets/sqlite3/build.sh b/targets/sqlite3/build.sh index 93886909d..714cb66ff 100755 --- a/targets/sqlite3/build.sh +++ b/targets/sqlite3/build.sh @@ -29,7 +29,7 @@ make sqlite3.c $CC $CFLAGS -I. \ $SRC/sqlite3/test/ossfuzz.c -o $OUT/ossfuzz \ - -lfuzzer ./sqlite3.o $FUZZER_LDFLAGS + -lfuzzer ./sqlite3.o cp $SRC/*.options $SRC/*.dict $SRC/*.zip $OUT/ diff --git a/targets/woff2/build.sh b/targets/woff2/build.sh index ada580a60..6d113559c 100755 --- a/targets/woff2/build.sh +++ b/targets/woff2/build.sh @@ -26,7 +26,6 @@ cat Makefile | sed -e "s/-no-canonical-prefixes//" \ mv Makefile.temp Makefile # woff2 uses LFLAGS instead of LDFLAGS. -export LFLAGS=$FUZZER_LDFLAGS make -j$(nproc) CC="$CC $CFLAGS" CXX="$CXX $CXXFLAGS" clean all # To avoid multiple main() definitions. @@ -36,6 +35,6 @@ rm src/woff2_compress.o src/woff2_decompress.o fuzzer=convert_woff2ttf_fuzzer $CXX $CXXFLAGS -std=c++11 -Isrc \ $SRC/$fuzzer.cc -o $OUT/$fuzzer \ - -lfuzzer src/*.o brotli/dec/*.o brotli/enc/*.o $FUZZER_LDFLAGS + -lfuzzer src/*.o brotli/dec/*.o brotli/enc/*.o cp $SRC/*.options $OUT/ diff --git a/targets/zlib/build.sh b/targets/zlib/build.sh index 97bde47ea..50f5cbd96 100755 --- a/targets/zlib/build.sh +++ b/targets/zlib/build.sh @@ -5,4 +5,4 @@ make -j$(nproc) clean all $CXX $CXXFLAGS -std=c++11 -I. \ $SRC/zlib_uncompress_fuzzer.cc -o $OUT/zlib_uncompress_fuzzer \ - -lfuzzer ./libz.a $FUZZER_LDFLAGS + -lfuzzer ./libz.a