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

Jan Beulich posted 1 patch 1 year, 7 months ago
Failed in applying to current master (apply log)
[PATCH] x86emul/test: suppress GNU ld 2.39 warning about RWX load segments
Posted by Jan Beulich 1 year, 7 months ago
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.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/tools/tests/x86_emulator/testcase.mk
+++ b/tools/tests/x86_emulator/testcase.mk
@@ -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
Re: [PATCH] x86emul/test: suppress GNU ld 2.39 warning about RWX load segments
Posted by Roger Pau Monné 1 year, 1 month ago
On Fri, Sep 09, 2022 at 09:23:31AM +0200, Jan Beulich wrote:
> 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.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Roger Pau Monné <roger.pau@citrix.com>

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.