[U-Boot] [PATCH 2/2] arm, powerpc: Update cc-version tests to check for cc-name as well

Tom Rini trini at konsulko.com
Wed Jan 20 02:39:02 CET 2016


For compatibility clang will report some gcc version.  However since we
are checking gcc versions in order to then fail to build, we should
limit these tests only to when we are using gcc and not clang.

Signed-off-by: Tom Rini <trini at konsulko.com>
---
 arch/arm/config.mk     |    3 ++-
 arch/powerpc/config.mk |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/arm/config.mk b/arch/arm/config.mk
index 0550225..a3e14a8 100644
--- a/arch/arm/config.mk
+++ b/arch/arm/config.mk
@@ -40,7 +40,8 @@ ifeq ($(CONFIG_SYS_THUMB_BUILD),y)
 archprepare: checkthumb
 
 checkthumb:
-	@if test "$(call cc-version)" -lt "0404"; then \
+	@if test "$(call cc-name)" = "gcc" -a \
+			"$(call cc-version)" -lt "0404"; then \
 		echo -n '*** Your GCC does not produce working '; \
 		echo 'binaries in THUMB mode.'; \
 		echo '*** Your board is configured for THUMB mode.'; \
diff --git a/arch/powerpc/config.mk b/arch/powerpc/config.mk
index 6b44a37..b0ed374 100644
--- a/arch/powerpc/config.mk
+++ b/arch/powerpc/config.mk
@@ -41,7 +41,8 @@ archprepare: checkgcc4
 # that U-Boot wants.
 # See http://lists.denx.de/pipermail/u-boot/2012-September/135156.html
 checkgcc4:
-	@if test $(call cc-version) -lt 0400; then \
+	@if test "$(call cc-name)" = "gcc" -a \
+			$(call cc-version) -lt 0400; then \
 		echo -n '*** Your GCC is too old, please upgrade to GCC 4.x or newer'; \
 		false; \
 	fi
-- 
1.7.9.5



More information about the U-Boot mailing list