SHA256
1
0
forked from pool/qemu
qemu/skiboot-build-LDFLAGS-pass-pie-flag-explicitly-to-ld.patch
Bruce Rogers 2f5bc69c34 Accepting request 546543 from home:bfrogers:branches:Virtualization
Remove SDL support for SLE15 usage (still supported for openSUSE, for now) - see fate#324465.
Fix skiboot.lib build issue
Address python compatibility issue.

OBS-URL: https://build.opensuse.org/request/show/546543
OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=376
2017-11-29 21:55:00 +00:00

37 lines
1.2 KiB
Diff

From d150a119e3721e634ca31f0ec255add7b955a56d Mon Sep 17 00:00:00 2001
From: Nicholas Piggin <npiggin@gmail.com>
Date: Tue, 18 Jul 2017 20:40:06 +1000
Subject: [PATCH] build: LDFLAGS pass -pie flag explicitly to ld
When building with some toolchains, the gcc -pie option does not
enable the linker pie without explicitly passing it to ld,
resulting in a non-PIE binary that silently fails (due to
relocation failure). This was observed with the powerpc64le
cross compiler for Debian.
Pass -Wl,-pie explicitly, which allows the powerpc64le toolchain
to create a position independnet binary that boots.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Signed-off-by: Bruce Rogers <brogers@suse.com>
---
Makefile.main | 1 +
1 file changed, 1 insertion(+)
diff --git a/Makefile.main b/Makefile.main
index 35d16095..07e143fd 100644
--- a/Makefile.main
+++ b/Makefile.main
@@ -85,6 +85,7 @@ CFLAGS += $(call try-cflag,$(CC),-Wjump-misses-init) \
CFLAGS += $(CWARNS) $(OPTS) $(DBG)
LDFLAGS := -m64 -static -nostdlib -pie
+LDFLAGS += -Wl,-pie
LDFLAGS += -Wl,-Ttext-segment,$(LD_TEXT) -Wl,-N -Wl,--build-id=none
LDFLAGS += -Wl,--no-multi-toc
LDFLAGS += -mbig-endian -Wl,--oformat,elf64-powerpc
--
2.15.0