Skip to contentSkip to conversation

x86emul/test: suppress GNU ld 2.39 warning about RWX load segments

PATCH In review Jan Beulich 2 participants 2 messages Sep 9, 2022 – Mar 14, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86emul/test: suppress GNU ld 2.39 warning about RWX load segments

Commit 68f5aac012b9 ("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.

tools/tests/x86_emulator/testcase.mk +2 -0
@@ -6,6 +6,8 @@ $(call cc-options-add,CFLAGS,CC,$(filter
 
 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
 
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Jan Beulich

Commit 68f5aac012b9 ("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.

My preference however would be to do this in configure, so if other use-cases appear on the tools we could perform the check only once.

Thanks, Roger.