]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Fix CC and CFLAGS default processing for fuzzing
authorJouni Malinen <j@w1.fi>
Sun, 6 Nov 2022 14:50:28 +0000 (16:50 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 6 Nov 2022 15:11:47 +0000 (17:11 +0200)
"make LIBFUZZER=y" was supposed to set CC and CFLAGS to working values
by default if not overridden by something external. That did not seem to
work since the defaults from the other build system components ended up
setting these variables before the checks here. Fix this by replacing
the known default values for non-fuzzing builds.

Signed-off-by: Jouni Malinen <j@w1.fi>
tests/fuzzing/rules.include

index e2cf577af811091c24b759b26b53255b110ae6bb..04f0a3e0cb3087c55df99631309b1575ec56b204 100644 (file)
@@ -5,10 +5,17 @@ FUZZ_CFLAGS =
 
 ifdef LIBFUZZER
 CC ?= clang
+ifeq ($(CC),cc)
+CC = clang
+endif
 #FUZZ_FLAGS ?= -fsanitize=fuzzer,address,signed-integer-overflow,unsigned-integer-overflow
 FUZZ_FLAGS ?= -fsanitize=fuzzer,address
 ifndef CFLAGS
 FUZZ_CFLAGS += $(FUZZ_FLAGS)
+else
+ifeq ($(CFLAGS),-MMD -O2 -Wall -g)
+FUZZ_CFLAGS += $(FUZZ_FLAGS)
+endif
 endif
 endif