diff mbox series

hvmloader: suppress GNU ld 2.39 warning about RWX load segments

Message ID 90070a25-445f-4b82-be19-d87b25fc9b8c@suse.com (mailing list archive)
State New, archived
Headers show
Series hvmloader: suppress GNU ld 2.39 warning about RWX load segments | expand

Commit Message

Jan Beulich Feb. 7, 2024, 2:03 p.m. UTC
This aspect is simply meaningless for this component.

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

Comments

Andrew Cooper Feb. 7, 2024, 2:31 p.m. UTC | #1
On 07/02/2024 2:03 pm, Jan Beulich wrote:
> This aspect is simply meaningless for this component.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

In principle Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>, but

>
> --- a/tools/firmware/hvmloader/Makefile
> +++ b/tools/firmware/hvmloader/Makefile
> @@ -20,6 +20,8 @@
>  XEN_ROOT = $(CURDIR)/../../..
>  include $(XEN_ROOT)/tools/firmware/Rules.mk
>  
> +ld-option = $(shell if $(LD) -v $(1) >/dev/null 2>&1; then echo y; else echo n; fi)

The root config.mk has cc-option, and one opencoded ld-option for
handling build-id's.

This ought to live there, and ideally clean up the opencoded use while
at at.

~Andrew
Jan Beulich Feb. 7, 2024, 2:34 p.m. UTC | #2
On 07.02.2024 15:31, Andrew Cooper wrote:
> On 07/02/2024 2:03 pm, Jan Beulich wrote:
>> This aspect is simply meaningless for this component.
>>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> In principle Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>, but
> 
>>
>> --- a/tools/firmware/hvmloader/Makefile
>> +++ b/tools/firmware/hvmloader/Makefile
>> @@ -20,6 +20,8 @@
>>  XEN_ROOT = $(CURDIR)/../../..
>>  include $(XEN_ROOT)/tools/firmware/Rules.mk
>>  
>> +ld-option = $(shell if $(LD) -v $(1) >/dev/null 2>&1; then echo y; else echo n; fi)
> 
> The root config.mk has cc-option, and one opencoded ld-option for
> handling build-id's.
> 
> This ought to live there, and ideally clean up the opencoded use while
> at at.

Well, that's what I first meant to do. But: xen/scripts/Kconfig.include
has a different ld-option, and I didn't want to get into the business
of having two fight each other.

Jan
diff mbox series

Patch

--- a/tools/firmware/hvmloader/Makefile
+++ b/tools/firmware/hvmloader/Makefile
@@ -20,6 +20,8 @@ 
 XEN_ROOT = $(CURDIR)/../../..
 include $(XEN_ROOT)/tools/firmware/Rules.mk
 
+ld-option = $(shell if $(LD) -v $(1) >/dev/null 2>&1; then echo y; else echo n; fi)
+
 # SMBIOS spec requires format mm/dd/yyyy
 SMBIOS_REL_DATE ?= $(shell date +%m/%d/%Y)
 
@@ -59,6 +61,10 @@  ROMBIOS_ROM := $(ROMBIOS_DIR)/BIOS-bochs
 ROMS += $(ROMBIOS_ROM) $(STDVGA_ROM) $(CIRRUSVGA_ROM)
 endif
 
+# Suppress the warning about LOAD segments with RWX permissions, as what we
+# build isn't a normal user-mode executable.
+LDFLAGS-$(call ld-option,--warn-rwx-segments) := --no-warn-rwx-segments
+
 .PHONY: all
 all: hvmloader
 
@@ -85,7 +91,7 @@  $(DSDT_FILES): acpi
 build.o: $(DSDT_FILES)
 
 hvmloader: $(OBJS) hvmloader.lds
-	$(LD) $(LDFLAGS_DIRECT) -N -T hvmloader.lds -o $@ $(OBJS)
+	$(LD) $(LDFLAGS_DIRECT) $(LDFLAGS-y) -N -T hvmloader.lds -o $@ $(OBJS)
 
 roms.inc: $(ROMS)
 	echo "/* Autogenerated file. DO NOT EDIT */" > $@.new