[OpenWrt-Devel] [PATCH 2/3] gcc: Activate hardening features for libgcc

Hauke Mehrtens hauke at hauke-m.de
Wed Jan 2 12:18:34 EST 2019


This includes the hardening.mk before the code gets compiled and then
also sets the LDFLAGS for the libgcc and other applications.

Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 include/toolchain-build.mk | 1 +
 toolchain/gcc/common.mk    | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/toolchain-build.mk b/include/toolchain-build.mk
index 883d74d25c..35d8c9380e 100644
--- a/include/toolchain-build.mk
+++ b/include/toolchain-build.mk
@@ -12,6 +12,7 @@ HOST_BUILD_PREFIX:=$(TOOLCHAIN_DIR)
 BUILD_DIR_HOST:=$(BUILD_DIR_TOOLCHAIN)
 
 include $(INCLUDE_DIR)/host-build.mk
+include $(INCLUDE_DIR)/hardening.mk
 
 HOST_STAMP_PREPARED=$(HOST_BUILD_DIR)/.prepared
 
diff --git a/toolchain/gcc/common.mk b/toolchain/gcc/common.mk
index b75fce57ef..e3b3f90821 100644
--- a/toolchain/gcc/common.mk
+++ b/toolchain/gcc/common.mk
@@ -191,7 +191,8 @@ GCC_MAKE:= \
 		CFLAGS="$(HOST_CFLAGS)" \
 		CFLAGS_FOR_TARGET="$(TARGET_CFLAGS)" \
 		CXXFLAGS_FOR_TARGET="$(TARGET_CFLAGS)" \
-		GOCFLAGS_FOR_TARGET="$(TARGET_CFLAGS)"
+		GOCFLAGS_FOR_TARGET="$(TARGET_CFLAGS)" \
+		LDFLAGS_FOR_TARGET="$(TARGET_LDFLAGS)"
 
 define Host/SetToolchainInfo
 	$(SED) 's,TARGET_CROSS=.*,TARGET_CROSS=$(REAL_GNU_TARGET_NAME)-,' $(TOOLCHAIN_DIR)/info.mk
-- 
2.19.2


_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list