toolchain/gcc: correct the check expr for newer clang
[openwrt/staging/dedeckeh.git] / toolchain / gcc / common.mk
index 6e8767f707b7927b95a01ed66dde4da70ed71fee..24c923abef51d10f78cea13f3585ffc092f13eb8 100644 (file)
@@ -32,17 +32,21 @@ ifeq ($(PKG_VERSION),5.5.0)
   PKG_HASH:=530cea139d82fe542b358961130c69cfde8b3d14556370b65823d2f91f0ced87
 endif
 
-ifeq ($(PKG_VERSION),7.4.0)
-  PKG_HASH:=eddde28d04f334aec1604456e536416549e9b1aa137fc69204e65eb0c009fe51
+ifeq ($(PKG_VERSION),7.5.0)
+  PKG_HASH:=b81946e7f01f90528a1f7352ab08cc602b9ccc05d4e44da4bd501c5a189ee661
 endif
 
 ifeq ($(PKG_VERSION),8.3.0)
   PKG_HASH:=64baadfe6cc0f4947a84cb12d7f0dfaf45bb58b7e92461639596c21e02d97d2c
 endif
 
+ifeq ($(PKG_VERSION),9.2.0)
+  PKG_HASH:=ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
+endif
+
 PATCH_DIR=../patches/$(GCC_VERSION)
 
-BUGURL=http://www.lede-project.org/bugs/
+BUGURL=http://bugs.openwrt.org/
 PKGVERSION=OpenWrt GCC $(PKG_VERSION) $(REVISION)
 
 HOST_BUILD_PARALLEL:=1
@@ -85,7 +89,7 @@ endif
 
 GCC_CONFIGURE:= \
        SHELL="$(BASH)" \
-       $(if $(shell gcc --version 2>&1 | grep LLVM), \
+       $(if $(shell gcc --version 2>&1 | grep -E "Apple.(LLVM|clang)"), \
                CFLAGS="-O2 -fbracket-depth=512 -pipe" \
                CXXFLAGS="-O2 -fbracket-depth=512 -pipe" \
        ) \
@@ -170,6 +174,11 @@ ifeq ($(CONFIG_arm),y)
                --with-fpu=$(word 2, $(subst +, ",$(CONFIG_CPU_TYPE))) \
                --with-float=hard
   endif
+
+  # Do not let TARGET_CFLAGS get poisoned by extra CPU optimization flags
+  # that do not belong here. The cpu,fpu type should be specified via
+  # --with-cpu and --with-fpu for ARM and not CFLAGS.
+  TARGET_CFLAGS:=$(filter-out -m%,$(call qstrip,$(TARGET_CFLAGS)))
 endif
 
 ifeq ($(CONFIG_TARGET_x86)$(CONFIG_USE_GLIBC)$(CONFIG_INSTALL_GCCGO),yyy)