[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[XEN PATCH 27/57] tools/fuzz/libelf: rework makefile
- To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
- Date: Mon, 6 Dec 2021 17:02:10 +0000
- Authentication-results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
- Cc: Anthony PERARD <anthony.perard@xxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, "Stefano Stabellini" <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
- Delivery-date: Mon, 06 Dec 2021 17:08:09 +0000
- Ironport-data: A9a23:o7nY7azFhEaYtWPCfgh6t+eswSrEfRIJ4+MujC+fZmUNrF6WrkVSy WYeDD+BO6mNNzHwe95yPN+y/RhX6JfWm9FmGlNrpCAxQypGp/SeCIXCJC8cHc8zwu4v7q5Dx 59DAjUVBJlsFhcwnvopW1TYhSEUOZugH9IQM8aZfHAuLeNYYH1500s6wbZn2tQAbeWRWGthh /uj+6UzB3f9s9JEGjp8B3Wr8U4HUFza4Vv0j3RmDRx5lAa2e0o9VfrzEZqZPXrgKrS4K8bhL wr1IBNVyUuCl/slIovNfr8W6STmSJaKVeSFoiI+t6RPHnGuD8H9u0o2HKN0VKtZt9mGt4Eo+ e1ui4eecgwKFIqLnu88bDBUFRgraMWq+JefSZS+mcmazkmAeHrw2fR+SkoxOOX0+M4uXzsIr 6ZBbmlQMFbT3Ipaw5riIgVors0lMMnsOpJZonx6xCvVJf0nXYrCU+PB4towMDIY25EVR6qGN pZxhTxHSBXyXw1kKkksBbUejOjr33PdfRYCtwfAzUYwyzeKl1EguFT3C/LXZ9iLSMN9jkue4 GXc8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DXr5JyvaslXNhh4K zCZs6POmrBAyxeQaHE0D3XMgbJQiJlmVMqmF7Pey4BlQub4u8I=
- Ironport-hdrordr: A9a23:N+xA662ldZKWd4fSpzOQyQqjBLQkLtp133Aq2lEZdPRUGvb2qy nIpoV96faUskdpZJhOo7G90cW7LE80sKQFg7X5Xo3SODUO2lHJEGgK1+KLqFfd8m/Fh4tgPM 9bAs5D4bbLY2SS4/yX3ODBKadC/OW6
- Ironport-sdr: awMe2UEYGgJ6YVSNJTcx4uOQBPZtcMozEo6Gb0XSc5/gjJpI/J1x5WSIwh5RKy0Sst6+qLRvHY +kvYfuB/0MtGUz2UzWeeoaJSPcFPAM6+dV82njyVa/NqTe0mV2aiTfMhqadskkpyaY6mSgk2VB qsXkg38jpOkufAuoZeWpSIJh9IYqG1RIsol4Db+vogdA9jzn2r5aqrglEFYLgcLcOH1HccN5x6 BF5SsHhzI6K9Yh3I5cXWZ7XQ0PT2n9/Oilfr1yT4gl7EArt4aoZPK0LYMuB44+tE6dUIgptUGn 25SxMsOVel72n0dmof0BCmui
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
Rename ELF_LIB_OBJS to LIBELF_OBJS as to have the same name as in
libs/guest/.
Replace "-I" by "-iquote".
Remove the use of "vpath". It will not works when we will convert this
makefile to subdirmk. Instead, we create symlinks to the source files.
Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
---
.gitignore | 1 +
tools/fuzz/libelf/Makefile | 21 ++++++++++-----------
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/.gitignore b/.gitignore
index c31fa9b841..4267bb4dee 100644
--- a/.gitignore
+++ b/.gitignore
@@ -197,6 +197,7 @@ tools/flask/utils/flask-setenforce
tools/flask/utils/flask-set-bool
tools/flask/utils/flask-label-pci
tools/fuzz/libelf/afl-libelf-fuzzer
+tools/fuzz/libelf/libelf-*.c
tools/fuzz/x86_instruction_emulator/asm
tools/fuzz/x86_instruction_emulator/afl-harness
tools/fuzz/x86_instruction_emulator/afl-harness-cov
diff --git a/tools/fuzz/libelf/Makefile b/tools/fuzz/libelf/Makefile
index 9eb30ee40c..9211f75951 100644
--- a/tools/fuzz/libelf/Makefile
+++ b/tools/fuzz/libelf/Makefile
@@ -1,25 +1,24 @@
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))
+LIBELF_OBJS := libelf-tools.o libelf-loader.o libelf-dominfo.o
-$(patsubst %.c,%.o,$(ELF_SRCS-y)): CFLAGS += -Wno-pointer-sign
-
-$(ELF_LIB_OBJS): CFLAGS += -DFUZZ_NO_LIBXC $(CFLAGS_xeninclude)
+CFLAGS += -iquote ../../../xen/common/libelf
+$(LIBELF_OBJS): CFLAGS += -Wno-pointer-sign
+$(LIBELF_OBJS): CFLAGS += -DFUZZ_NO_LIBXC $(CFLAGS_xeninclude)
libelf-fuzzer.o: CFLAGS += $(CFLAGS_xeninclude)
-libelf.a: libelf-fuzzer.o $(ELF_LIB_OBJS)
+$(LIBELF_OBJS:.o=.c): libelf-%.c: ../../../xen/common/libelf/libelf-%.c FORCE
+ ln -nsf $< $@
+
+libelf.a: libelf-fuzzer.o $(LIBELF_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)
+afl-libelf-fuzzer: afl-libelf-fuzzer.o libelf-fuzzer.o $(LIBELF_OBJS)
$(CC) $(CFLAGS) $^ -o $@
# Common targets
@@ -31,7 +30,7 @@ distclean: clean
.PHONY: clean
clean:
- rm -f *.o .*.d *.a *-libelf-fuzzer
+ rm -f *.o .*.d *.a *-libelf-fuzzer $(LIBELF_OBJS:.o=.c)
.PHONY: install
install: all
--
Anthony PERARD
|