From 325096a07f4c6cb04b459ba9359c3ba0b40941aa Mon Sep 17 00:00:00 2001 From: Jason Ish Date: Thu, 4 Feb 2021 15:47:05 -0600 Subject: [PATCH] github-ci: add -fsanitize=address to LDFLAGS for asan builds With fPIC, -fsanitize-address also needs to be added to LDFLAGS to build with ASAN support. Also fix what looks to be a copy and paste typo. --- .github/workflows/builds.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 0bd6457faa..5ea599284e 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -374,6 +374,7 @@ jobs: - run: ./autogen.sh - run: CC="clang" CFLAGS="$DEFAULT_CFLAGS -Wshadow -fsanitize=address -fno-omit-frame-pointer" ./configure --enable-debug --enable-unittests --disable-shared --enable-rust-strict env: + LDFLAGS: "-fsanitize=address" ac_cv_func_realloc_0_nonnull: "yes" ac_cv_func_malloc_0_nonnull: "yes" - run: make -j2 @@ -447,6 +448,7 @@ jobs: - run: ./autogen.sh - run: CC="clang" CFLAGS="$DEFAULT_CFLAGS -Wshadow -fsanitize=address -fno-omit-frame-pointer" ./configure --enable-debug --enable-unittests --disable-shared --enable-rust-strict env: + LDFLAGS: "-fsanitize=address" ac_cv_func_realloc_0_nonnull: "yes" ac_cv_func_malloc_0_nonnull: "yes" - run: make -j2 @@ -1093,9 +1095,9 @@ jobs: mkdir -p $HOME/.cargo/bin cp prep/cbindgen $HOME/.cargo/bin chmod 755 $HOME/.cargo/bin/cbindgen - echo "$HOME/.cargo/bin" >> $GITHUB_PATH - run: tar xf prep/libhtp.tar.gz + echo "$HOME/.cargo/bin" >> $GITHUB_PATH - run: ./autogen.sh - - run: AFL_HARDEN=1 ac_cv_func_realloc_0_nonnull=yes ac_cv_func_malloc_0_nonnull=yes CFLAGS="-fsanitize=address -fno-omit-frame-pointer" CXXFLAGS=$CFLAGS CC=afl-clang-fast CXX=afl-clang-fast++ ./configure --enable-fuzztargets --disable-shared + - run: AFL_HARDEN=1 ac_cv_func_realloc_0_nonnull=yes ac_cv_func_malloc_0_nonnull=yes CFLAGS="-fsanitize=address -fno-omit-frame-pointer" CXXFLAGS=$CFLAGS CC=afl-clang-fast CXX=afl-clang-fast++ LDFLAGS="-fsanitize=address" ./configure --enable-fuzztargets --disable-shared - run: AFL_HARDEN=1 make -j2 # An Ubuntu 16.04 build using the tarball generated in the CentOS 8