hostapd/tests/fuzzing/rules.include

39 lines
797 B
Text
Raw Normal View History

FUZZ_RULES := $(lastword $(MAKEFILE_LIST))
include $(dir $(FUZZ_RULES))../../src/build.rules
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
FUZZ_CFLAGS += -DCONFIG_NO_RANDOM_POOL -DTEST_FUZZ
export FUZZ_CFLAGS
CFLAGS ?= -MMD -O2 -Wall -g
CFLAGS += $(FUZZ_CFLAGS)
ifdef LIBFUZZER
CFLAGS += -DTEST_LIBFUZZER
LDFLAGS += $(FUZZ_FLAGS)
endif
WPAS_SRC=../../../wpa_supplicant
SRC=../../../src
CFLAGS += -I$(SRC) -I$(SRC)/utils -I$(WPAS_SRC)
OBJS += ../fuzzer-common.o
# for the lib builds
export TEST_FUZZ=y