aboutsummaryrefslogtreecommitdiff
path: root/Makefile.main
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2017-07-18 20:40:06 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-08-22 16:10:34 +1000
commit705d2f190cfd6f2cf6e4d91efc1ca71edfbe18da (patch)
tree2b51a0ad857dfda253ab641469748275aa08bfbf /Makefile.main
parent87f1c8745d338749ef8152505b5f678e76770f3f (diff)
downloadskiboot-705d2f190cfd6f2cf6e4d91efc1ca71edfbe18da.zip
skiboot-705d2f190cfd6f2cf6e4d91efc1ca71edfbe18da.tar.gz
skiboot-705d2f190cfd6f2cf6e4d91efc1ca71edfbe18da.tar.bz2
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>
Diffstat (limited to 'Makefile.main')
-rw-r--r--Makefile.main1
1 files changed, 1 insertions, 0 deletions
diff --git a/Makefile.main b/Makefile.main
index 96447cb..20a8749 100644
--- a/Makefile.main
+++ b/Makefile.main
@@ -105,6 +105,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