mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
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>
25 lines
773 B
Makefile
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
|