From: Arran Cudbard-Bell Date: Tue, 2 Nov 2021 14:00:32 +0000 (-0400) Subject: fuzzer-no-link needs to be passed to the compiler and linker step X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d8cf643e90a8bcf30798df4641d624ba3df6486f;p=thirdparty%2Ffreeradius-server.git fuzzer-no-link needs to be passed to the compiler and linker step --- diff --git a/configure b/configure index 30aa6560da6..fd740722571 100755 --- a/configure +++ b/configure @@ -14939,7 +14939,7 @@ printf "%s\n" "$ax_cv_cc_wimplicit_fallthrough_flag" >&6; } fsanitizeflags= if test "x$fuzzer" = "xyes" && test "x$ax_cv_cc_clang" = "xyes"; then - fsanitizeflags="$fsanitizeflags,fuzzer" + fsanitizeflags="$fsanitizeflags,fuzzer-no-link" fi if test "x$coverage" = "xyes" && test "x$ax_cv_cc_clang" = "xyes"; then @@ -15030,7 +15030,7 @@ fi if test "x$fsanitizeflags" != "x"; then fsanitizeflags="$(echo $fsanitizeflags | sed 's/^,*//')" devcflags="-fsanitize=$fsanitizeflags $devcflags" - devldflags="-fsanitize=$(echo $fsanitizeflags | sed 's/fuzzer/fuzzer-no-link/') $devldflags" + devldflags="-fsanitize=$fsanitizeflags $devldflags" fi devcflags="$(echo $devcflags | sed -e 's/\\t//g;s/ //g')" diff --git a/configure.ac b/configure.ac index 75ac277e54b..a85c8d4b495 100644 --- a/configure.ac +++ b/configure.ac @@ -1845,7 +1845,7 @@ if test "x$developer" = "xyes"; then dnl # dnl # -fsanitize=fuzzer - Build with fuzzer support dnl # - fsanitizeflags="$fsanitizeflags,fuzzer" + fsanitizeflags="$fsanitizeflags,fuzzer-no-link" fi dnl # @@ -1912,7 +1912,7 @@ if test "x$developer" = "xyes"; then if test "x$fsanitizeflags" != "x"; then fsanitizeflags="$(echo $fsanitizeflags | sed 's/^,*//')" devcflags="-fsanitize=$fsanitizeflags $devcflags" - devldflags="-fsanitize=$(echo $fsanitizeflags | sed 's/fuzzer/fuzzer-no-link/') $devldflags" + devldflags="-fsanitize=$fsanitizeflags $devldflags" fi dnl # diff --git a/src/bin/fuzzer.mk b/src/bin/fuzzer.mk index 37f32183363..08a9d96f935 100644 --- a/src/bin/fuzzer.mk +++ b/src/bin/fuzzer.mk @@ -22,8 +22,9 @@ SOURCES := fuzzer.c TGT_PREREQS := libfreeradius-$(PROTOCOL).a +TGT_CFLAGS := -fsanitize=fuzzer +TGT_LDFLAGS := -fsanitize=fuzzer TGT_LDLIBS := $(LIBS) -TGT_LDFLAGS := -fsanitize=fuzzer FUZZER_CORPUS_DIR := src/tests/fuzzer-corpus