From: Jouni Malinen Date: Sun, 6 Nov 2022 14:50:28 +0000 (+0200) Subject: tests: Fix CC and CFLAGS default processing for fuzzing X-Git-Tag: hostap_2_11~1564 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2e840fb2ab202e44090b089330805a8b4aca1a26;p=thirdparty%2Fhostap.git tests: Fix CC and CFLAGS default processing for fuzzing "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 --- diff --git a/tests/fuzzing/rules.include b/tests/fuzzing/rules.include index e2cf577af..04f0a3e0c 100644 --- a/tests/fuzzing/rules.include +++ b/tests/fuzzing/rules.include @@ -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