[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[qemu-xen staging-4.14] build: -no-pie is no functional linker flag



commit d7d6a60e73ee21e82f0bac2036153ccccf996e6c
Author:     Christian Ehrhardt <christian.ehrhardt@xxxxxxxxxxxxx>
AuthorDate: Mon Dec 14 16:09:38 2020 +0100
Commit:     Anthony PERARD <anthony.perard@xxxxxxxxxx>
CommitDate: Wed Apr 7 16:24:21 2021 +0100

    build: -no-pie is no functional linker flag
    
    Recent binutils changes dropping unsupported options [1] caused a build
    issue in regard to the optionroms.
    
      ld -m elf_i386 -T /<<PKGBUILDDIR>>/pc-bios/optionrom//flat.lds -no-pie \
        -s -o multiboot.img multiboot.o
      ld.bfd: Error: unable to disambiguate: -no-pie (did you mean --no-pie ?)
    
    This isn't really a regression in ld.bfd, filing the bug upstream
    revealed that this never worked as a ld flag [2] - in fact it seems we
    were by accident setting --nmagic).
    
    Since it never had the wanted effect this usage of LDFLAGS_NOPIE, should be
    droppable without any effect. This also is the only use-case of 
LDFLAGS_NOPIE
    in .mak, therefore we can also remove it from being added there.
    
    [1]: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=983d925d
    [2]: https://sourceware.org/bugzilla/show_bug.cgi?id=27050#c5
    
    Signed-off-by: Christian Ehrhardt <christian.ehrhardt@xxxxxxxxxxxxx>
    Message-Id: <20201214150938.1297512-1-christian.ehrhardt@xxxxxxxxxxxxx>
    Cc: qemu-stable@xxxxxxxxxx
    Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>
    (cherry picked from commit bbd2d5a8120771ec59b86a80a1f51884e0a26e53)
    Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
---
 configure                  | 3 ---
 pc-bios/optionrom/Makefile | 4 ++--
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/configure b/configure
index 23b5e93752..c74f0910f7 100755
--- a/configure
+++ b/configure
@@ -2116,7 +2116,6 @@ EOF
 # Check we support --no-pie first; we will need this for building ROMs.
 if compile_prog "-Werror -fno-pie" "-no-pie"; then
   CFLAGS_NOPIE="-fno-pie"
-  LDFLAGS_NOPIE="-no-pie"
 fi
 
 if test "$static" = "yes"; then
@@ -2132,7 +2131,6 @@ if test "$static" = "yes"; then
   fi
 elif test "$pie" = "no"; then
   QEMU_CFLAGS="$CFLAGS_NOPIE $QEMU_CFLAGS"
-  QEMU_LDFLAGS="$LDFLAGS_NOPIE $QEMU_LDFLAGS"
 elif compile_prog "-Werror -fPIE -DPIE" "-pie"; then
   QEMU_CFLAGS="-fPIE -DPIE $QEMU_CFLAGS"
   QEMU_LDFLAGS="-pie $QEMU_LDFLAGS"
@@ -7673,7 +7671,6 @@ if test "$sparse" = "yes" ; then
   echo "QEMU_CFLAGS  += -Wbitwise -Wno-transparent-union -Wno-old-initializer 
-Wno-non-pointer-null" >> $config_host_mak
 fi
 echo "QEMU_LDFLAGS=$QEMU_LDFLAGS" >> $config_host_mak
-echo "LDFLAGS_NOPIE=$LDFLAGS_NOPIE" >> $config_host_mak
 echo "LD_REL_FLAGS=$LD_REL_FLAGS" >> $config_host_mak
 echo "LD_I386_EMULATION=$ld_i386_emulation" >> $config_host_mak
 echo "LIBS+=$LIBS" >> $config_host_mak
diff --git a/pc-bios/optionrom/Makefile b/pc-bios/optionrom/Makefile
index e33a24da0d..bbb57ee138 100644
--- a/pc-bios/optionrom/Makefile
+++ b/pc-bios/optionrom/Makefile
@@ -47,10 +47,10 @@ build-all: multiboot.bin linuxboot.bin linuxboot_dma.bin 
kvmvapic.bin pvh.bin
        $(call quiet-command,$(CPP) $(QEMU_INCLUDES) $(QEMU_DGFLAGS) -c -o - $< 
| $(AS) $(ASFLAGS) -o $@,"AS","$(TARGET_DIR)$@")
 
 pvh.img: pvh.o pvh_main.o
-       $(call quiet-command,$(LD) $(LDFLAGS_NOPIE) -m $(LD_I386_EMULATION) -T 
$(SRC_PATH)/pc-bios/optionrom/flat.lds -s -o $@ $^,"BUILD","$(TARGET_DIR)$@")
+       $(call quiet-command,$(LD) -m $(LD_I386_EMULATION) -T 
$(SRC_PATH)/pc-bios/optionrom/flat.lds -s -o $@ $^,"BUILD","$(TARGET_DIR)$@")
 
 %.img: %.o
-       $(call quiet-command,$(LD) $(LDFLAGS_NOPIE) -m $(LD_I386_EMULATION) -T 
$(SRC_PATH)/pc-bios/optionrom/flat.lds -s -o $@ $<,"BUILD","$(TARGET_DIR)$@")
+       $(call quiet-command,$(LD) -m $(LD_I386_EMULATION) -T 
$(SRC_PATH)/pc-bios/optionrom/flat.lds -s -o $@ $<,"BUILD","$(TARGET_DIR)$@")
 
 %.raw: %.img
        $(call quiet-command,$(OBJCOPY) -O binary -j .text $< 
$@,"BUILD","$(TARGET_DIR)$@")
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.