Files
xen/tools/tests/x86_emulator/testcase.mk
T
Jan Beulich 4252432be8 x86emul/test: suppress GNU ld 2.39 warning about RWX load segments
Commit 68f5aac012 ("build: suppress future GNU ld warning about RWX
load segments") didn't quite cover all the cases: I missed ones in the
building of the test code blobs. Clone the workaround to the helper
Makefile in question, kind of open-coding the hypervisor build system's
ld-option macro.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
2023-03-14 10:42:51 +01:00

25 lines
773 B
Makefile

XEN_ROOT = $(CURDIR)/../../..
CFLAGS :=
include $(XEN_ROOT)/tools/Rules.mk
$(call cc-options-add,CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS))
CFLAGS += -fno-builtin -g0 $($(TESTCASE)-cflags)
LDFLAGS_DIRECT += $(shell { $(LD) -v --warn-rwx-segments; } >/dev/null 2>&1 && echo --no-warn-rwx-segments)
.PHONY: all
all: $(TESTCASE).bin
%.bin: %.c
$(CC) $(filter-out -M% .%,$(CFLAGS)) -c $<
$(LD) $(LDFLAGS_DIRECT) -N -Ttext 0x100000 -o $*.tmp $*.o
$(OBJCOPY) -O binary -R .note.gnu.property $*.tmp $@
rm -f $*.tmp
%-opmask.bin: opmask.S
$(CC) $(filter-out -M% .%,$(CFLAGS)) -c $< -o $(basename $@).o
$(LD) $(LDFLAGS_DIRECT) -N -Ttext 0x100000 -o $(basename $@).tmp $(basename $@).o
$(OBJCOPY) -O binary -R .note.gnu.property $(basename $@).tmp $@
rm -f $(basename $@).tmp