mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
Source code and Makefile to fuzz libelf in Google's oss-fuzz infrastructure. Introduce FUZZ_NO_LIBXC in libelf-private.h. That macro will be set when compiling libelf fuzzer target because libxc is not required in libelf fuzzing. Signed-off-by: Wei Liu <wei.liu2@citrix.com> Reviewed-by: Jan Beulich <jbeulich@suse.com>
32 lines
693 B
Makefile
32 lines
693 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: $(ELF_LIB_OBJS)
|
|
$(AR) rc $@ $^
|
|
|
|
.PHONY: libelf-fuzzer-all
|
|
libelf-fuzzer-all: libelf.a libelf-fuzzer.o
|
|
|
|
# Common targets
|
|
.PHONY: all
|
|
all: libelf-fuzzer-all
|
|
|
|
.PHONY: distclean
|
|
distclean: clean
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
rm -f *.o *.a
|