uclibc: gcc >= 4.9 can build a thumb/thread uclibc
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Fri, 18 Mar 2016 21:08:08 +0000 (22:08 +0100)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tue, 29 Mar 2016 22:15:14 +0000 (00:15 +0200)
Older gcc were not capable of building a uClibc library, with threads
enabled, in Thumb1. However, the issues have been fixed since gcc 4.9,
so this commit narrows down the condition to just gcc 4.7 and 4.8.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/uclibc/uclibc.mk

index c981d80118f770c21a6138a72c5c12627b277883..ad94494bcc9f0362aa4c1891964b09566b825f77 100644 (file)
@@ -75,8 +75,10 @@ define UCLIBC_ARM_ABI_CONFIG
        $(call KCONFIG_ENABLE_OPT,CONFIG_ARM_EABI,$(@D)/.config)
 endef
 
-# Thumb build is broken with threads, build in ARM mode
-ifeq ($(BR2_ARM_INSTRUCTIONS_THUMB)$(BR2_TOOLCHAIN_HAS_THREADS),yy)
+# Thumb1 build is broken with threads with old gcc versions (4.7 and
+# 4.8). Since all cores supporting Thumb1 also support ARM, we use ARM
+# code in this case.
+ifeq ($(BR2_GCC_VERSION_4_7_X)$(BR2_GCC_VERSION_4_8_X):$(BR2_ARM_INSTRUCTIONS_THUMB)$(BR2_TOOLCHAIN_HAS_THREADS),y:yy)
 UCLIBC_EXTRA_CFLAGS += -marm
 endif