summaryrefslogtreecommitdiffstats
path: root/include/hardening.mk
diff options
context:
space:
mode:
authorJulien Dusser <julien.dusser@free.fr>2018-07-17 18:29:34 +0200
committerJohn Crispin <john@phrozen.org>2018-07-30 14:26:16 +0200
commit4dfa6b7a300188db2d97a291f9c1303286a6bcc5 (patch)
tree9bb57448164f5abeef7279f57d6787c68b0e01c4 /include/hardening.mk
parent84c212da44cf5df210ae166ed7e64adf764ccf3f (diff)
downloadopenwrt-4dfa6b7a300188db2d97a291f9c1303286a6bcc5.tar.gz
openwrt-4dfa6b7a300188db2d97a291f9c1303286a6bcc5.tar.bz2
openwrt-4dfa6b7a300188db2d97a291f9c1303286a6bcc5.zip
build: fix ASLR for LTO packages
Fix building packages with LTO when CONFIG_PKG_ASLR_PIE is enabled. Despite comment of PR lto/80838, it seems that GCC needs -fPIC on linker command line, even if all objects are -fPIC. This may change as PR lto/80838 is merged into 8.1 compile-tested: ar71xx, ath79 Fix commits: 6dac92a42e052f89971762173daabb7fd84742ef 8c11133c9de632dca69c8464f911d8e2716effe2 07940acc341ee9bb2887359f193625e48f36207e e7397eef69a20fc630148d0e597523e139d21c0c ef16a394d2b24a363b50b5b4720cb23fe156c9da ef96d1e34a990871c912938c336f51a510b1e32f 47b42137ce1e931ae5871952b1f98438396f5e07 73fc67b61480a3430d31de33478a1c0c2c364b9c 154c0c4006daf41e2cbb6c8b7ad5557f83dfea3e 804c51e1e661819c5a7532e66fb8a12166eef9a9 Signed-off-by: Julien Dusser <julien.dusser@free.fr>
Diffstat (limited to 'include/hardening.mk')
-rw-r--r--include/hardening.mk2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/hardening.mk b/include/hardening.mk
index 42ce1f56b5..60f39428e8 100644
--- a/include/hardening.mk
+++ b/include/hardening.mk
@@ -19,7 +19,7 @@ endif
ifdef CONFIG_PKG_ASLR_PIE
ifeq ($(strip $(PKG_ASLR_PIE)),1)
TARGET_CFLAGS += $(FPIC)
- TARGET_LDFLAGS += -specs=$(INCLUDE_DIR)/hardened-ld-pie.specs
+ TARGET_LDFLAGS += $(FPIC) -specs=$(INCLUDE_DIR)/hardened-ld-pie.specs
endif
endif
ifdef CONFIG_PKG_CC_STACKPROTECTOR_REGULAR