]>
Commit | Line | Data |
---|---|---|
7d5d8d6e JP |
1 | From bbd2d5a8120771ec59b86a80a1f51884e0a26e53 Mon Sep 17 00:00:00 2001 |
2 | From: Christian Ehrhardt <christian.ehrhardt@canonical.com> | |
3 | Date: Mon, 14 Dec 2020 16:09:38 +0100 | |
4 | Subject: [PATCH] build: -no-pie is no functional linker flag | |
5 | ||
6 | Recent binutils changes dropping unsupported options [1] caused a build | |
7 | issue in regard to the optionroms. | |
8 | ||
9 | ld -m elf_i386 -T /<<PKGBUILDDIR>>/pc-bios/optionrom//flat.lds -no-pie \ | |
10 | -s -o multiboot.img multiboot.o | |
11 | ld.bfd: Error: unable to disambiguate: -no-pie (did you mean --no-pie ?) | |
12 | ||
13 | This isn't really a regression in ld.bfd, filing the bug upstream | |
14 | revealed that this never worked as a ld flag [2] - in fact it seems we | |
15 | were by accident setting --nmagic). | |
16 | ||
17 | Since it never had the wanted effect this usage of LDFLAGS_NOPIE, should be | |
18 | droppable without any effect. This also is the only use-case of LDFLAGS_NOPIE | |
19 | in .mak, therefore we can also remove it from being added there. | |
20 | ||
21 | [1]: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=983d925d | |
22 | [2]: https://sourceware.org/bugzilla/show_bug.cgi?id=27050#c5 | |
23 | ||
24 | Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com> | |
25 | Message-Id: <20201214150938.1297512-1-christian.ehrhardt@canonical.com> | |
26 | Cc: qemu-stable@nongnu.org | |
27 | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> | |
28 | --- | |
29 | configure | 3 --- | |
30 | pc-bios/optionrom/Makefile | 1 - | |
31 | 2 files changed, 4 deletions(-) | |
32 | ||
33 | diff --git a/configure b/configure | |
34 | index cb21108d34c..c228f7c21e7 100755 | |
35 | --- a/configure | |
36 | +++ b/configure | |
37 | @@ -2137,7 +2137,6 @@ EOF | |
38 | # Check we support --no-pie first; we will need this for building ROMs. | |
39 | if compile_prog "-Werror -fno-pie" "-no-pie"; then | |
40 | CFLAGS_NOPIE="-fno-pie" | |
41 | - LDFLAGS_NOPIE="-no-pie" | |
42 | fi | |
43 | ||
44 | if test "$static" = "yes"; then | |
45 | @@ -2153,7 +2152,6 @@ if test "$static" = "yes"; then | |
46 | fi | |
47 | elif test "$pie" = "no"; then | |
92618e32 JP |
48 | CONFIGURE_CFLAGS="$CFLAGS_NOPIE $CONFIGURE_CFLAGS" |
49 | - CONFIGURE_LDFLAGS="$LDFLAGS_NOPIE $CONFIGURE_LDFLAGS" | |
7d5d8d6e | 50 | elif compile_prog "-Werror -fPIE -DPIE" "-pie"; then |
92618e32 JP |
51 | CONFIGURE_CFLAGS="-fPIE -DPIE $CONFIGURE_CFLAGS" |
52 | CONFIGURE_LDFLAGS="-pie $CONFIGURE_LDFLAGS" | |
7d5d8d6e | 53 | @@ -6714,7 +6712,6 @@ echo "QEMU_CXXFLAGS=$QEMU_CXXFLAGS" >> $config_host_mak |
92618e32 JP |
54 | echo "GLIB_CFLAGS=$glib_cflags" >> $config_host_mak |
55 | echo "GLIB_LIBS=$glib_libs" >> $config_host_mak | |
7d5d8d6e JP |
56 | echo "QEMU_LDFLAGS=$QEMU_LDFLAGS" >> $config_host_mak |
57 | -echo "LDFLAGS_NOPIE=$LDFLAGS_NOPIE" >> $config_host_mak | |
7d5d8d6e | 58 | echo "LD_I386_EMULATION=$ld_i386_emulation" >> $config_host_mak |
92618e32 JP |
59 | echo "EXESUF=$EXESUF" >> $config_host_mak |
60 | echo "HOST_DSOSUF=$HOST_DSOSUF" >> $config_host_mak | |
61 | diff --git a/pc-bios/optionrom/Makefile b/pc-bios/optionrom/Makefile | |
62 | index 084fc10f054..30771f8d17c 100644 | |
63 | --- a/pc-bios/optionrom/Makefile | |
64 | +++ b/pc-bios/optionrom/Makefile | |
65 | @@ -41,7 +41,6 @@ override CFLAGS += $(call cc-option, $(Wa)-32) | |
7d5d8d6e | 66 | |
92618e32 JP |
67 | LD_I386_EMULATION ?= elf_i386 |
68 | override LDFLAGS = -m $(LD_I386_EMULATION) -T $(SRC_DIR)/flat.lds | |
69 | -override LDFLAGS += $(LDFLAGS_NOPIE) | |
7d5d8d6e | 70 | |
92618e32 | 71 | all: multiboot.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin pvh.bin |
7d5d8d6e | 72 |