SHA256
1
0
forked from pool/qemu
qemu/build-no-pie-is-no-functional-linker-fla.patch
Bruce Rogers 5b17093cb1 Accepting request 860516 from home:bfrogers:branches:Virtualization
- Fix crash when spice used and the qemu-audio-spice package isn't
  installed (boo#1180210)
  audio-add-sanity-check.patch
- Add some stable patches from upstream
  block-Fix-deadlock-in-bdrv_co_yield_to_d.patch
  block-Fix-locking-in-qmp_block_resize.patch
  block-nfs-fix-int-overflow-in-nfs_client.patch
  block-Simplify-qmp_block_resize-error-pa.patch
  build-no-pie-is-no-functional-linker-fla.patch

OBS-URL: https://build.opensuse.org/request/show/860516
OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=599
2021-01-05 17:40:44 +00:00

75 lines
3.0 KiB
Diff

From: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Date: Mon, 14 Dec 2020 16:09:38 +0100
Subject: build: -no-pie is no functional linker flag
Git-commit: bbd2d5a8120771ec59b86a80a1f51884e0a26e53
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@canonical.com>
Message-Id: <20201214150938.1297512-1-christian.ehrhardt@canonical.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Bruce Rogers <brogers@suse.com>
---
configure | 3 ---
pc-bios/optionrom/Makefile | 1 -
2 files changed, 4 deletions(-)
diff --git a/configure b/configure
index 18c26e0389741643748c70ac7788..7ce723bbe769dac2af8456079e89 100755
--- a/configure
+++ b/configure
@@ -2121,7 +2121,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
@@ -2137,7 +2136,6 @@ if test "$static" = "yes"; then
fi
elif test "$pie" = "no"; then
CONFIGURE_CFLAGS="$CFLAGS_NOPIE $CONFIGURE_CFLAGS"
- CONFIGURE_LDFLAGS="$LDFLAGS_NOPIE $CONFIGURE_LDFLAGS"
elif compile_prog "-Werror -fPIE -DPIE" "-pie"; then
CONFIGURE_CFLAGS="-fPIE -DPIE $CONFIGURE_CFLAGS"
CONFIGURE_LDFLAGS="-pie $CONFIGURE_LDFLAGS"
@@ -6756,7 +6754,6 @@ echo "QEMU_CXXFLAGS=$QEMU_CXXFLAGS" >> $config_host_mak
echo "GLIB_CFLAGS=$glib_cflags" >> $config_host_mak
echo "GLIB_LIBS=$glib_libs" >> $config_host_mak
echo "QEMU_LDFLAGS=$QEMU_LDFLAGS" >> $config_host_mak
-echo "LDFLAGS_NOPIE=$LDFLAGS_NOPIE" >> $config_host_mak
echo "LD_I386_EMULATION=$ld_i386_emulation" >> $config_host_mak
echo "EXESUF=$EXESUF" >> $config_host_mak
echo "HOST_DSOSUF=$HOST_DSOSUF" >> $config_host_mak
diff --git a/pc-bios/optionrom/Makefile b/pc-bios/optionrom/Makefile
index 084fc10f0540b62df06c476bb11c..30771f8d17cb2143eb7bbb004ceb 100644
--- a/pc-bios/optionrom/Makefile
+++ b/pc-bios/optionrom/Makefile
@@ -41,7 +41,6 @@ override CFLAGS += $(call cc-option, $(Wa)-32)
LD_I386_EMULATION ?= elf_i386
override LDFLAGS = -m $(LD_I386_EMULATION) -T $(SRC_DIR)/flat.lds
-override LDFLAGS += $(LDFLAGS_NOPIE)
all: multiboot.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin pvh.bin