]> xenbits.xensource.com Git - xtf.git/commitdiff
build: suppress GNU ld 2.39 warning about RWX load segments
authorJan Beulich <jbeulich@suse.com>
Thu, 29 Sep 2022 10:04:28 +0000 (12:04 +0200)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 3 Oct 2022 11:29:02 +0000 (12:29 +0100)
We cannot really avoid such and we're also not really at risk because of
them, as we control page table permissions ourselves rather than relying
on a loader of some sort.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
build/common.mk

index 90c216960c9c73c1f4c2e46669d1d3cec33af2bb..63345b3de299ae8b625512b85f8ff710b7567fbb 100644 (file)
@@ -20,9 +20,15 @@ COMMON_FLAGS := -pipe -I$(ROOT)/include -I$(ROOT)/arch/x86/include -MMD -MP
 cc-option = $(shell if [ -z "`echo 'int p=1;' | $(CC) $(1) -S -o /dev/null -x c - 2>&1`" ]; \
                        then echo y; else echo n; fi)
 
+ld-option = $(shell if $(LD) -v $(1) >/dev/null 2>&1; then echo y; else echo n; fi)
+
 # Disable PIE, but need to check if compiler supports it
 COMMON_CFLAGS-$(call cc-option,-no-pie) += -no-pie
 
+# Suppress warnings about LOAD segments with RWX permissions, as what we build
+# aren't normal user-mode executables.
+LDFLAGS-$(call ld-option,--warn-rwx-segments) += --no-warn-rwx-segments
+
 COMMON_AFLAGS := $(COMMON_FLAGS) -D__ASSEMBLY__
 COMMON_CFLAGS := $(COMMON_FLAGS) $(COMMON_CFLAGS-y)
 COMMON_CFLAGS += -Wall -Wextra -Werror -std=gnu99 -Wstrict-prototypes -O3 -g