toolchain/gcc: pass proper flags for arm hard float build
[openwrt.git] / toolchain / gcc / common.mk
index af971ba..e8ca778 100644 (file)
@@ -95,6 +95,10 @@ endif
 
 GCC_CONFIGURE:= \
        SHELL="$(BASH)" \
+       $(if $(shell gcc --version 2>&1 | grep LLVM), \
+               CFLAGS="-O2 -fbracket-depth=512 -pipe" \
+               CXXFLAGS="-O2 -fbracket-depth=512 -pipe" \
+       ) \
        $(HOST_SOURCE_DIR)/configure \
                --with-bugurl=$(BUGURL) \
                --with-pkgversion="$(PKGVERSION)" \
@@ -158,6 +162,13 @@ ifneq ($(GCC_ARCH),)
   GCC_CONFIGURE+= --with-arch=$(GCC_ARCH)
 endif
 
+ifneq ($(CONFIG_SOFT_FLOAT),y)
+  ifeq ($(CONFIG_arm),y)
+    GCC_CONFIGURE+= \
+               --with-float=hard
+  endif
+endif
+
 GCC_MAKE:= \
        export SHELL="$(BASH)"; \
        $(MAKE) \