"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>
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