diff options
Diffstat (limited to 'toolchain')
-rw-r--r-- | toolchain/Config.in | 37 | ||||
-rw-r--r-- | toolchain/helpers.mk | 9 | ||||
-rw-r--r-- | toolchain/toolchain-external/pkg-toolchain-external.mk | 3 |
3 files changed, 31 insertions, 18 deletions
diff --git a/toolchain/Config.in b/toolchain/Config.in index 1cba82af8e..c2192a52b1 100644 --- a/toolchain/Config.in +++ b/toolchain/Config.in @@ -69,18 +69,35 @@ comment "Toolchain Generic Options" config BR2_TOOLCHAIN_HAS_BINUTILS_BUG_19615 bool -# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64735 -# exception_ptr, nested_exception, and future from libstdc++ are not -# available for architectures not supporting always lock-free atomic -# ints before GCC 7 +# Atomic types can be: +# - never lock-free +# - sometimes lock-free +# - always lock-free +# see https://en.cppreference.com/w/c/atomic/ATOMIC_LOCK_FREE_consts +# +# On most architectures, gcc provides "always lock-free" atomic types, +# but a few architectures are limited to "sometimes lock-free" +# types. This hidden option allows to know if the architecture +# provides "always lock-free" atomic types. +config BR2_TOOLCHAIN_SUPPORTS_ALWAYS_LOCKFREE_ATOMIC_INTS + bool + default y + depends on !BR2_nios2 + depends on !BR2_ARM_CPU_ARMV4 + depends on !BR2_ARM_CPU_ARMV5 + depends on !BR2_sparc_v8 + depends on !BR2_m68k_cf5208 + +# Prior to gcc 7.x, exception_ptr, nested_exception and future from +# libstdc++ would only be provided on architectures that support +# always lock-free atomic ints. See +# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64735. This issue has +# been removed in GCC 7.x, where exception propagation is now +# supported without lock-free atomic int. config BR2_TOOLCHAIN_HAS_GCC_BUG_64735 bool - default y if BR2_nios2 - default y if BR2_ARM_CPU_ARMV4 - default y if BR2_ARM_CPU_ARMV5 - default y if BR2_sparc_v8 - default y if BR2_m68k_cf5208 - depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_7 + default y if !BR2_TOOLCHAIN_SUPPORTS_ALWAYS_LOCKFREE_ATOMIC_INTS && \ + !BR2_TOOLCHAIN_GCC_AT_LEAST_7 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85180. This bug no # longer exists in gcc 8.x. diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk index 1792286add..e5520c00c3 100644 --- a/toolchain/helpers.mk +++ b/toolchain/helpers.mk @@ -241,14 +241,11 @@ check_glibc = \ # $2: cross-readelf path check_musl = \ __CROSS_CC=$(strip $1) ; \ - __CROSS_READELF=$(strip $2) ; \ - echo 'void main(void) {}' | $${__CROSS_CC} -x c -o $(BUILD_DIR)/.br-toolchain-test.tmp - >/dev/null 2>&1; \ - if ! $${__CROSS_READELF} -l $(BUILD_DIR)/.br-toolchain-test.tmp 2> /dev/null | grep 'program interpreter: /lib/ld-musl' -q; then \ - rm -f $(BUILD_DIR)/.br-toolchain-test.tmp*; \ + libc_a_path=`$${__CROSS_CC} -print-file-name=libc.a` ; \ + if ! strings $${libc_a_path} | grep -q MUSL_LOCPATH ; then \ echo "Incorrect selection of the C library" ; \ exit -1; \ - fi ; \ - rm -f $(BUILD_DIR)/.br-toolchain-test.tmp* + fi # # Check the conformity of Buildroot configuration with regard to the diff --git a/toolchain/toolchain-external/pkg-toolchain-external.mk b/toolchain/toolchain-external/pkg-toolchain-external.mk index 8b2c283654..02d992531d 100644 --- a/toolchain/toolchain-external/pkg-toolchain-external.mk +++ b/toolchain/toolchain-external/pkg-toolchain-external.mk @@ -557,8 +557,7 @@ define $(2)_CONFIGURE_CMDS $$(call check_uclibc,$$$${SYSROOT_DIR}) ; \ elif test "$$(BR2_TOOLCHAIN_EXTERNAL_MUSL)" = "y" ; then \ $$(call check_musl,\ - "$$(TOOLCHAIN_EXTERNAL_CC) $$(TOOLCHAIN_EXTERNAL_CFLAGS)",\ - $$(TOOLCHAIN_EXTERNAL_READELF)) ; \ + "$$(TOOLCHAIN_EXTERNAL_CC) $$(TOOLCHAIN_EXTERNAL_CFLAGS)") ; \ else \ $$(call check_glibc,$$$${SYSROOT_DIR}) ; \ fi |