Get rid of unneeded CFLAGS
authorPeter Korsgaard <jacmet@sunsite.dk>
Mon, 2 May 2011 21:58:20 +0000 (23:58 +0200)
committerPeter Korsgaard <jacmet@sunsite.dk>
Thu, 5 May 2011 21:39:03 +0000 (23:39 +0200)
Now that we use a wrapper for external toolchains (and internal ones
default to the correct setting), we no longer need to explicitly pass
sysroot/march/mtune/mabi/floating point mode in TARGET_CFLAGS.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Makefile
package/Makefile.in
package/qt/qt.mk
toolchain/toolchain-external/ext-tool.mk

index 2c5aefe2a86568f18193bb5083461cb7906237da..5f61b932705d18b44b7019a8ce446f1cd69b1606 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -375,10 +375,10 @@ world: prepare dependencies dirs $(BASE_TARGETS) $(TARGETS_ALL)
 $(O)/toolchainfile.cmake:
        @echo -en "\
        set(CMAKE_SYSTEM_NAME Linux)\n\
-       set(CMAKE_C_COMPILER $(CMAKE_TARGET_CC))\n\
-       set(CMAKE_CXX_COMPILER $(CMAKE_TARGET_CXX))\n\
-       set(CMAKE_C_FLAGS \"\$${CMAKE_C_FLAGS} $(CMAKE_TARGET_CFLAGS)\" CACHE STRING \"Buildroot CFLAGS\" FORCE)\n\
-       set(CMAKE_CXX_FLAGS \"\$${CMAKE_CXX_FLAGS} $(CMAKE_TARGET_CXXFLAGS)\" CACHE STRING \"Buildroot CXXFLAGS\" FORCE)\n\
+       set(CMAKE_C_COMPILER $(TARGET_CC_NOCCACHE))\n\
+       set(CMAKE_CXX_COMPILER $(TARGET_CXX_NOCCACHE))\n\
+       set(CMAKE_C_FLAGS \"\$${CMAKE_C_FLAGS} $(TARGET_CFLAGS)\" CACHE STRING \"Buildroot CFLAGS\" FORCE)\n\
+       set(CMAKE_CXX_FLAGS \"\$${CMAKE_CXX_FLAGS} $(TARGET_CXXFLAGS)\" CACHE STRING \"Buildroot CXXFLAGS\" FORCE)\n\
        set(CMAKE_INSTALL_SO_NO_EXE 0)\n\
        set(CMAKE_PROGRAM_PATH \"$(HOST_DIR)/usr/bin\")\n\
        set(CMAKE_FIND_ROOT_PATH \"$(STAGING_DIR)\")\n\
index faab365f43d9a24faefba15df7c56d216dad2665..31a963920e5b05849b40b581bdaaf596398cb828 100644 (file)
@@ -62,34 +62,12 @@ endif
 
 TARGET_CFLAGS=$(TARGET_OPTIMIZATION) $(TARGET_DEBUGGING)
 
-CC_TARGET_TUNE_:=$(call qstrip,$(BR2_GCC_TARGET_TUNE))
-CC_TARGET_ARCH_:=$(call qstrip,$(BR2_GCC_TARGET_ARCH))
-CC_TARGET_ABI_:=$(call qstrip,$(BR2_GCC_TARGET_ABI))
-
-ifneq ($(CC_TARGET_TUNE_),)
-TARGET_CFLAGS+=-mtune=$(CC_TARGET_TUNE_)
-endif
-ifneq ($(CC_TARGET_ARCH_),)
-TARGET_CFLAGS+=-march=$(CC_TARGET_ARCH_)
-endif
-ifneq ($(CC_TARGET_ABI_),)
-TARGET_CFLAGS+=-mabi=$(CC_TARGET_ABI_)
-endif
-
 ifneq ($(BR2_PREFER_STATIC_LIB),y)
 ifeq ($(BR2_x86_64),y)
 TARGET_CFLAGS+=-fPIC -DPIC
 endif # PIC for dynamic objects on x86_64
 endif
 
-ifeq ($(BR2_SOFT_FLOAT),y)
-TARGET_CFLAGS+=-msoft-float
-endif
-
-ifeq ($(BR2_VFP_FLOAT),y)
-TARGET_CFLAGS+=-mfpu=vfp
-endif
-
 ifeq ($(findstring yy,$(BR2_mips)$(BR2_MIPS_ABI64)),yy)
 TARGET_CFLAGS+=-fno-pic -mno-abicalls
 endif
@@ -99,7 +77,6 @@ TARGET_CFLAGS+=-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
 endif
 
 TARGET_CXXFLAGS=$(TARGET_CFLAGS)
-TARGET_SYSROOT_OPT=--sysroot=$(STAGING_DIR)
 
 ifeq ($(BR2_TOOLCHAIN_BUILDROOT)$(BR2_TOOLCHAIN_CTNG),y)
 TARGET_CROSS=$(HOST_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-
@@ -114,11 +91,11 @@ TARGET_PATH="$(HOST_DIR)/bin:$(HOST_DIR)/usr/bin:$(HOST_DIR)/usr/sbin/:$(PATH)"
 # including the --sysroot option where necessary.
 TARGET_AR       = $(TARGET_CROSS)ar
 TARGET_AS       = $(TARGET_CROSS)as
-TARGET_CC       = $(TARGET_CROSS)gcc $(TARGET_SYSROOT_OPT)
-TARGET_CPP      = $(TARGET_CROSS)cpp $(TARGET_SYSROOT_OPT)
-TARGET_CXX      = $(TARGET_CROSS)g++ $(TARGET_SYSROOT_OPT)
-TARGET_FC       = $(TARGET_CROSS)gfortran $(TARGET_SYSROOT_OPT)
-TARGET_LD       = $(TARGET_CROSS)ld $(TARGET_SYSROOT_OPT)
+TARGET_CC       = $(TARGET_CROSS)gcc
+TARGET_CPP      = $(TARGET_CROSS)cpp
+TARGET_CXX      = $(TARGET_CROSS)g++
+TARGET_FC       = $(TARGET_CROSS)gfortran
+TARGET_LD       = $(TARGET_CROSS)ld
 TARGET_NM       = $(TARGET_CROSS)nm
 TARGET_RANLIB   = $(TARGET_CROSS)ranlib
 TARGET_OBJCOPY  = $(TARGET_CROSS)objcopy
@@ -132,14 +109,6 @@ TARGET_CC  := $(CCACHE) $(TARGET_CC)
 TARGET_CXX := $(CCACHE) $(TARGET_CXX)
 endif
 
-# * CMake doesn't support having the --sysroot option directly in the
-#   compiler path, so move this option to CFLAGS/CXXFLAGS variables.
-# * Don't use ccache because then CMake will fail to detect compiler.
-CMAKE_TARGET_CC = $(filter-out --sysroot=%,$(TARGET_CC_NOCCACHE))
-CMAKE_TARGET_CXX = $(filter-out --sysroot=%,$(TARGET_CXX_NOCCACHE))
-CMAKE_TARGET_CFLAGS = $(filter --sysroot=%,$(TARGET_CC_NOCCACHE)) $(TARGET_CFLAGS)
-CMAKE_TARGET_CXXFLAGS = $(filter --sysroot=%,$(TARGET_CXX_NOCCACHE)) $(TARGET_CXXFLAGS)
-
 ifeq ($(BR2_STRIP_strip),y)
 STRIP_DISCARD_ALL:=--discard-all
 STRIP_STRIP_UNNEEDED:=--strip-unneeded
index 8d7238eab54431db8bb70da8beb265c7a11a76d5..7ec7ccc5ed9d9af0dc6a1a32e665033838654c84 100644 (file)
@@ -451,16 +451,16 @@ define QT_CONFIGURE_CMDS
        $(QT_CONFIGURE_IPV6)
        $(QT_CONFIGURE_CONFIG_FILE)
        # Fix compiler path
-       $(call QT_QMAKE_SET,CC,$(filter-out --sysroot=%,$(TARGET_CC)),$(@D))
-       $(call QT_QMAKE_SET,CXX,$(filter-out --sysroot=%,$(TARGET_CXX)),$(@D))
+       $(call QT_QMAKE_SET,CC,$(TARGET_CC),$(@D))
+       $(call QT_QMAKE_SET,CXX,$(TARGET_CXX),$(@D))
        $(call QT_QMAKE_SET,LINK,$(TARGET_CXX),$(@D))
        $(call QT_QMAKE_SET,LINK_SHLIB,$(TARGET_CXX),$(@D))
        $(call QT_QMAKE_SET,AR,$(TARGET_AR) cqs,$(@D))
        $(call QT_QMAKE_SET,OBJCOPY,$(TARGET_OBJCOPY),$(@D))
        $(call QT_QMAKE_SET,RANLIB,$(TARGET_RANLIB),$(@D))
        $(call QT_QMAKE_SET,STRIP,$(TARGET_STRIP),$(@D))
-       $(call QT_QMAKE_SET,CFLAGS,$(TARGET_SYSROOT_OPT) $(TARGET_CFLAGS),$(@D))
-       $(call QT_QMAKE_SET,CXXFLAGS,$(TARGET_SYSROOT_OPT) $(TARGET_CXXFLAGS),$(@D))
+       $(call QT_QMAKE_SET,CFLAGS,$(TARGET_CFLAGS),$(@D))
+       $(call QT_QMAKE_SET,CXXFLAGS,$(TARGET_CXXFLAGS),$(@D))
        $(call QT_QMAKE_SET,LFLAGS,$(TARGET_LDFLAGS),$(@D))
 # Don't use TARGET_CONFIGURE_OPTS here, qmake would be compiled for the target
 # instead of the host then. So set PKG_CONFIG* manually.
index 0034ddfb3b5540714e3295a360ad2a8569973108..328f9088fab8de6924332faa37e78b02686bfb73 100644 (file)
@@ -126,6 +126,10 @@ TOOLCHAIN_EXTERNAL_WRAPPER_ARGS = \
        -DBR_CROSS_PATH='"$(TOOLCHAIN_EXTERNAL_BIN)/"' \
        -DBR_SYSROOT='"$(STAGING_DIR)"'
 
+CC_TARGET_TUNE_:=$(call qstrip,$(BR2_GCC_TARGET_TUNE))
+CC_TARGET_ARCH_:=$(call qstrip,$(BR2_GCC_TARGET_ARCH))
+CC_TARGET_ABI_:=$(call qstrip,$(BR2_GCC_TARGET_ABI))
+
 # march/mtune/floating point mode needs to be passed to the external toolchain
 # to select the right multilib variant
 ifneq ($(CC_TARGET_TUNE_),)