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 <j@w1.fi>
This commit is contained in:
Jouni Malinen 2022-11-06 16:50:28 +02:00
parent 1ca5c2ec2a
commit 2e840fb2ab

View 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