From 2b6fc9a9436f1ff7381b0f859a75481229c92e02 Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Wed, 8 May 2019 16:35:18 +0200 Subject: [PATCH] [libxslt] Adjust build script (#2389) - Link targets with fuzz.o - Move code block for readability --- projects/libxslt/build.sh | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/projects/libxslt/build.sh b/projects/libxslt/build.sh index 4257c4f96..25700085d 100755 --- a/projects/libxslt/build.sh +++ b/projects/libxslt/build.sh @@ -21,11 +21,6 @@ if [ "$SANITIZER" = undefined ]; then export CXXFLAGS="$CXXFLAGS -fno-sanitize=unsigned-integer-overflow,float-divide-by-zero" fi -cd ../libxml2 -./autogen.sh --without-python --disable-shared -make -j$(nproc) V=1 - -cd ../libxslt if [ "$SANITIZER" = memory ]; then # This would require an instrumented libgcrypt build. CRYPTO_CONF=--without-crypto @@ -34,19 +29,28 @@ else CRYPTO_CONF=--with-crypto CRYPTO_LIBS=-lgcrypt fi + +cd ../libxml2 +./autogen.sh --without-python --disable-shared +make -j$(nproc) V=1 + +cd ../libxslt ./autogen.sh --without-python $CRYPTO_CONF --disable-shared \ --with-libxml-src=../libxml2 make -j$(nproc) V=1 -for fuzzer in xpath xslt; do +for file in xpath xslt fuzz; do # Compile as C $CC $CFLAGS \ -I. -I../libxml2/include \ - -c tests/fuzz/$fuzzer.c \ - -o tests/fuzz/$fuzzer.o \ + -c tests/fuzz/$file.c \ + -o tests/fuzz/$file.o +done + +for fuzzer in xpath xslt; do # Link with $CXX $CXX $CXXFLAGS \ - tests/fuzz/$fuzzer.o \ + tests/fuzz/$fuzzer.o tests/fuzz/fuzz.o \ -o $OUT/$fuzzer \ $LIB_FUZZING_ENGINE \ libexslt/.libs/libexslt.a libxslt/.libs/libxslt.a \