Files
xen/tools/fuzz/libelf/Makefile
T
Andrew Cooper 3a54f72491 tools/fuzz: Include LLVMFuzzerTestOneInput() in the generated .a
Otherwise they are not suitable for use with libfuzz.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
2017-03-20 16:45:20 +00:00

41 lines
894 B
Makefile

XEN_ROOT = $(CURDIR)/../../..
include $(XEN_ROOT)/tools/Rules.mk
# libelf fuzz target
vpath %.c ../../../xen/common/libelf
CFLAGS += -I../../../xen/common/libelf
ELF_SRCS-y += libelf-tools.c libelf-loader.c libelf-dominfo.c
ELF_LIB_OBJS := $(patsubst %.c,%.o,$(ELF_SRCS-y))
$(patsubst %.c,%.o,$(ELF_SRCS-y)): CFLAGS += -Wno-pointer-sign
$(ELF_LIB_OBJS): CFLAGS += -DFUZZ_NO_LIBXC $(CFLAGS_xeninclude)
libelf-fuzzer.o: CFLAGS += $(CFLAGS_xeninclude)
libelf.a: libelf-fuzzer.o $(ELF_LIB_OBJS)
$(AR) rc $@ $^
.PHONY: libelf-fuzzer-all
libelf-fuzzer-all: libelf.a libelf-fuzzer.o
afl-libelf-fuzzer: afl-libelf-fuzzer.o libelf-fuzzer.o $(ELF_LIB_OBJS)
$(CC) $(CFLAGS) $^ -o $@
# Common targets
.PHONY: all
all: libelf-fuzzer-all
.PHONY: distclean
distclean: clean
.PHONY: clean
clean:
rm -f *.o .*.d *.a *-libelf-fuzzer
.PHONY: install
install: all
.PHONY: afl
afl: afl-libelf-fuzzer