aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2017-07-18 20:40:06 +1000
committerVasant Hegde <hegdevasant@linux.vnet.ibm.com>2019-12-04 10:45:14 +0530
commit900ac95cfd173efca5a776590389c18abaa51666 (patch)
tree5c429e994c51377c9045fbc0f90c2640a995adf9
parent5f0d8b1df4fcac19bcb2c0d1e6089b870dc2b15c (diff)
downloadskiboot-900ac95cfd173efca5a776590389c18abaa51666.zip
skiboot-900ac95cfd173efca5a776590389c18abaa51666.tar.gz
skiboot-900ac95cfd173efca5a776590389c18abaa51666.tar.bz2
build: LDFLAGS pass -pie flag explicitly to ld
[ Upstream commit 705d2f190cfd6f2cf6e4d91efc1ca71edfbe18da ] 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: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
-rw-r--r--Makefile.main1
1 files changed, 1 insertions, 0 deletions
diff --git a/Makefile.main b/Makefile.main
index f6d9a43..772b1d1 100644
--- a/Makefile.main
+++ b/Makefile.main
@@ -100,6 +100,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