summaryrefslogtreecommitdiffstats
path: root/toolchain
diff options
context:
space:
mode:
Diffstat (limited to 'toolchain')
-rw-r--r--toolchain/helpers.mk2
-rw-r--r--toolchain/toolchain-external/toolchain-external-codesourcery-niosII/Config.in1
-rw-r--r--toolchain/toolchain-wrapper.c3
-rw-r--r--toolchain/toolchain-wrapper.mk6
-rw-r--r--toolchain/toolchain/toolchain.mk12
5 files changed, 16 insertions, 8 deletions
diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk
index 63ef6fb4b0..1792286add 100644
--- a/toolchain/helpers.mk
+++ b/toolchain/helpers.mk
@@ -421,7 +421,7 @@ check_unusable_toolchain = \
#
check_toolchain_ssp = \
__CROSS_CC=$(strip $1) ; \
- __HAS_SSP=`echo 'void main(){}' | $${__CROSS_CC} -fstack-protector -x c - -o $(BUILD_DIR)/.br-toolchain-test.tmp >/dev/null 2>&1 && echo y` ; \
+ __HAS_SSP=`echo 'void main(){}' | $${__CROSS_CC} -Werror -fstack-protector -x c - -o $(BUILD_DIR)/.br-toolchain-test.tmp >/dev/null 2>&1 && echo y` ; \
if [ "$(BR2_TOOLCHAIN_HAS_SSP)" != "y" -a "$${__HAS_SSP}" = "y" ] ; then \
echo "SSP support available in this toolchain, please enable BR2_TOOLCHAIN_EXTERNAL_HAS_SSP" ; \
exit 1 ; \
diff --git a/toolchain/toolchain-external/toolchain-external-codesourcery-niosII/Config.in b/toolchain/toolchain-external/toolchain-external-codesourcery-niosII/Config.in
index 7563995eb6..4ac9c95c86 100644
--- a/toolchain/toolchain-external/toolchain-external-codesourcery-niosII/Config.in
+++ b/toolchain/toolchain-external/toolchain-external-codesourcery-niosII/Config.in
@@ -5,7 +5,6 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII
depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
depends on !BR2_STATIC_LIBS
select BR2_TOOLCHAIN_EXTERNAL_GLIBC
- select BR2_TOOLCHAIN_HAS_SSP
select BR2_TOOLCHAIN_HAS_NATIVE_RPC
select BR2_INSTALL_LIBSTDCPP
select BR2_HOSTARCH_NEEDS_IA32_LIBS
diff --git a/toolchain/toolchain-wrapper.c b/toolchain/toolchain-wrapper.c
index 2928ea42d0..c5eb813dd0 100644
--- a/toolchain/toolchain-wrapper.c
+++ b/toolchain/toolchain-wrapper.c
@@ -82,6 +82,9 @@ static char *predef_args[] = {
#ifdef BR_NO_FUSED_MADD
"-mno-fused-madd",
#endif
+#ifdef BR_FP_CONTRACT_OFF
+ "-ffp-contract=off",
+#endif
#ifdef BR_BINFMT_FLAT
"-Wl,-elf2flt",
#endif
diff --git a/toolchain/toolchain-wrapper.mk b/toolchain/toolchain-wrapper.mk
index 7f72a0cade..6e95545ebf 100644
--- a/toolchain/toolchain-wrapper.mk
+++ b/toolchain/toolchain-wrapper.mk
@@ -28,8 +28,14 @@ endif
# Avoid FPU bug on XBurst CPUs
ifeq ($(BR2_mips_xburst),y)
+# Before gcc 4.6, -mno-fused-madd was needed, after -ffp-contract is
+# needed
+ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_4_6),y)
+TOOLCHAIN_WRAPPER_ARGS += -DBR_FP_CONTRACT_OFF
+else
TOOLCHAIN_WRAPPER_ARGS += -DBR_NO_FUSED_MADD
endif
+endif
ifeq ($(BR2_CCACHE_USE_BASEDIR),y)
TOOLCHAIN_WRAPPER_ARGS += -DBR_CCACHE_BASEDIR='"$(BASE_DIR)"'
diff --git a/toolchain/toolchain/toolchain.mk b/toolchain/toolchain/toolchain.mk
index b55b0c712c..179c09edf1 100644
--- a/toolchain/toolchain/toolchain.mk
+++ b/toolchain/toolchain/toolchain.mk
@@ -13,18 +13,18 @@ endif
TOOLCHAIN_ADD_TOOLCHAIN_DEPENDENCY = NO
# Apply a hack that Rick Felker suggested[1] to avoid conflicts between libc
-# headers and kernel headers. This is a temporary measure until musl finds a
-# better solution.
+# headers and kernel headers. This is needed for kernel headers older than
+# 4.15. Kernel headers 4.15 and newer don't require __GLIBC__ to be defined.
#
# Augment the original suggestion with __USE_MISC since recent kernels
-# require this glibc internal macro. Also, as musl defines IFF_LOWER_UP,
-# IFF_DORMANT and IFF_ECHO, add another macro to suppress them in the
-# kernel header, and avoid macro/enum conflict.
+# (older than 4.15) require this glibc internal macro. Also, as musl defines
+# IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO, add another macro to suppress
+# them in the kernel header, and avoid macro/enum conflict.
#
# Kernel version 3.12 introduced the libc-compat.h header.
#
# [1] http://www.openwall.com/lists/musl/2015/10/08/2
-ifeq ($(BR2_TOOLCHAIN_USES_MUSL)$(BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_12),yy)
+ifeq ($(BR2_TOOLCHAIN_USES_MUSL)$(BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_12):$(BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_15),yy:)
define TOOLCHAIN_MUSL_KERNEL_HEADERS_COMPATIBILITY_HACK
$(SED) 's/^#if defined(__GLIBC__)$$/#if 1/' \
$(STAGING_DIR)/usr/include/linux/libc-compat.h
OpenPOWER on IntegriCloud