aboutsummaryrefslogtreecommitdiffstats
path: root/toolchain/uClibc
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2015-01-17 14:31:30 +0000
committerJohn Crispin <blogic@openwrt.org>2015-01-17 14:31:30 +0000
commitf7d8dc37026c10907f5c626444ec25598fa2ba05 (patch)
tree0c452dab7c8c558619ded2285a7e804a6ce4b1d7 /toolchain/uClibc
parentfc1b97243345202d7be48b908f21b3bb984f206d (diff)
downloadupstream-f7d8dc37026c10907f5c626444ec25598fa2ba05.tar.gz
upstream-f7d8dc37026c10907f5c626444ec25598fa2ba05.tar.bz2
upstream-f7d8dc37026c10907f5c626444ec25598fa2ba05.zip
Support for building an hardened OpenWRT
Introduce configuration options to build an "hardened" OpenWRT. Options to enable Stack-Smashing Protection, FORTIFY_SOURCE and RELRO have been introduced. uClibc makefile now automatically detects if SSP support is necessary. hostapd makefile has been fixed to use "^" as sed separator since using a comma was problematic when using "-Wl,-z,now" and the like in TARGET_CFLAGS. Currently enabling SSP on user space depends on enabling SSP kernel side, this is due to the fact that TARGET_CFLAGS are used to build kernel modules (at least). Suggestions on how to avoid this are welcome. Using "select" instead of "depends on" doesn't seem to work with choice entries. Tested with a lantiq (WBMR) router, GCC 4.8, uClibc and a subset of the available packages. Needs to be tested with GCC 4.9 and the remaining packages. PIE not currently included. Signed-off-by: Alessandro Di Federico <ale+owrt@clearmind.me> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@44005 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'toolchain/uClibc')
-rw-r--r--toolchain/uClibc/common.mk1
1 files changed, 1 insertions, 0 deletions
diff --git a/toolchain/uClibc/common.mk b/toolchain/uClibc/common.mk
index e507dc6fb0..435e4c2511 100644
--- a/toolchain/uClibc/common.mk
+++ b/toolchain/uClibc/common.mk
@@ -80,6 +80,7 @@ define Host/Configure
-e 's,^.*UCLIBC_HAS_SHADOW.*,UCLIBC_HAS_SHADOW=$(if $(CONFIG_SHADOW_PASSWORDS),y,n),g' \
-e 's,^.*UCLIBC_HAS_LOCALE.*,UCLIBC_HAS_LOCALE=$(if $(CONFIG_BUILD_NLS),y,n),g' \
-e 's,^.*UCLIBC_BUILD_ALL_LOCALE.*,UCLIBC_BUILD_ALL_LOCALE=$(if $(CONFIG_BUILD_NLS),y,n),g' \
+ -e 's,^.*UCLIBC_HAS_SSP.*,UCLIBC_HAS_SSP=$(if $(or $(CONFIG_PKG_CC_STACKPROTECTOR_REGULAR),$(CONFIG_PKG_CC_STACKPROTECTOR_STRONG)),y,n),g' \
$(HOST_BUILD_DIR)/.config.new
cmp -s $(HOST_BUILD_DIR)/.config.new $(HOST_BUILD_DIR)/.config.last || { \
cp $(HOST_BUILD_DIR)/.config.new $(HOST_BUILD_DIR)/.config && \