aboutsummaryrefslogtreecommitdiff
path: root/infra/base-images/base-builder
diff options
context:
space:
mode:
authorAbhishek Arya <inferno@chromium.org>2021-02-01 21:16:56 -0800
committerGitHub <noreply@github.com>2021-02-01 21:16:56 -0800
commitebe4848a52977bea02a9a35a8e090820a534b746 (patch)
tree236e3ab52214361d84499a1113fe7edb543dccb9 /infra/base-images/base-builder
parent05cac485d3f82263f551bea4cba977fee8627536 (diff)
downloadoss-fuzz-ebe4848a52977bea02a9a35a8e090820a534b746.tar.gz
Properly fix stripping of -fsanitize=fuzzer-no-link for afl++ (#5090)
Fixes several builds - ibmswtpm2, tpm2-tss, etc
Diffstat (limited to 'infra/base-images/base-builder')
-rwxr-xr-xinfra/base-images/base-builder/compile4
-rw-r--r--infra/base-images/base-builder/compile_afl7
2 files changed, 4 insertions, 7 deletions
diff --git a/infra/base-images/base-builder/compile b/infra/base-images/base-builder/compile
index 19a9c62d2..2bf20b1e3 100755
--- a/infra/base-images/base-builder/compile
+++ b/infra/base-images/base-builder/compile
@@ -73,8 +73,8 @@ then
export COVERAGE_FLAGS="${!COVERAGE_FLAGS_VAR}"
fi
- # Don't need coverage instrumentation for engine-less builds.
-if [ $FUZZING_ENGINE = "none" ]; then
+ # Don't need coverage instrumentation for engine-less, afl++ builds.
+if [ $FUZZING_ENGINE = "none" ] || [ $FUZZING_ENGINE = "afl" ]; then
export COVERAGE_FLAGS=
fi
diff --git a/infra/base-images/base-builder/compile_afl b/infra/base-images/base-builder/compile_afl
index 2ea2c1dd7..269ce7d8a 100644
--- a/infra/base-images/base-builder/compile_afl
+++ b/infra/base-images/base-builder/compile_afl
@@ -28,11 +28,8 @@ unset CXXFLAGS
unset CFLAGS
make clean
AFL_NO_X86=1 PYTHON_INCLUDE=/ make
-# ensure no coverage or fuzzer sanitizers are set
-CFLAGS=$(echo " $INITIAL_CFLAGS"|sed 's/-fsanitize=fuzz[a-z-]*//'|sed 's/-fsanitize-coverage=[a-z-]*//')
-CXXFLAGS=$(echo " $INITIAL_CXXFLAGS"|sed 's/-fsanitize=fuzz[a-z-]*//'|sed 's/-fsanitize-coverage=[a-z-]*//')
-export CFLAGS
-export CXXFLAGS
+CFLAGS=$INITIAL_CFLAGS
+CXXFLAGS=$INITIAL_CXXFLAGS
# Build afl++ driver with existing CFLAGS, CXXFLAGS.
make -C utils/aflpp_driver