mirror of
				git://git.openwrt.org/openwrt/openwrt.git
				synced 2025-11-04 06:54:27 -05:00 
			
		
		
		
	toolchain/gcc: clean up CFLAGS
Instead of having two different ways to pass flags to the gcc build process, add them as configure args, which is a reliable way to let gcc pass them around to its various pieces. Also add CXXFLAGS, since gcc started to use c++ for itself recently (~10 years ago now). Signed-off-by: Andre Heider <a.heider@gmail.com>
This commit is contained in:
		
							parent
							
								
									4b8b89da50
								
							
						
					
					
						commit
						ad564cb019
					
				@ -79,10 +79,6 @@ endif
 | 
			
		||||
 | 
			
		||||
GCC_CONFIGURE:= \
 | 
			
		||||
	SHELL="$(BASH)" \
 | 
			
		||||
	$(if $(shell gcc --version 2>&1 | grep -E "Apple.(LLVM|clang)"), \
 | 
			
		||||
		CFLAGS="-O2 -fbracket-depth=512 -pipe" \
 | 
			
		||||
		CXXFLAGS="-O2 -fbracket-depth=512 -pipe" \
 | 
			
		||||
	) \
 | 
			
		||||
	$(HOST_SOURCE_DIR)/configure \
 | 
			
		||||
		--with-bugurl=$(BUGURL) \
 | 
			
		||||
		--with-pkgversion="$(PKGVERSION)" \
 | 
			
		||||
@ -166,14 +162,22 @@ ifeq ($(CONFIG_TARGET_x86)$(CONFIG_USE_GLIBC)$(CONFIG_INSTALL_GCCGO),yyy)
 | 
			
		||||
  TARGET_CFLAGS+=-fno-split-stack
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
GCC_MAKE:= \
 | 
			
		||||
	export SHELL="$(BASH)"; \
 | 
			
		||||
	$(MAKE) \
 | 
			
		||||
		CFLAGS="$(HOST_CFLAGS)" \
 | 
			
		||||
CFLAGS:=$(HOST_CFLAGS) -pipe
 | 
			
		||||
ifneq ($(shell gcc --version 2>&1 | grep -E "Apple.(LLVM|clang)"),)
 | 
			
		||||
  CFLAGS+= -fbracket-depth=512
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
GCC_CONFIGURE+= \
 | 
			
		||||
	CFLAGS="$(CFLAGS)" \
 | 
			
		||||
	CXXFLAGS="$(CFLAGS)" \
 | 
			
		||||
	CFLAGS_FOR_TARGET="$(TARGET_CFLAGS)" \
 | 
			
		||||
	CXXFLAGS_FOR_TARGET="$(TARGET_CFLAGS)" \
 | 
			
		||||
	GOCFLAGS_FOR_TARGET="$(TARGET_CFLAGS)"
 | 
			
		||||
 | 
			
		||||
GCC_MAKE:= \
 | 
			
		||||
	export SHELL="$(BASH)"; \
 | 
			
		||||
	$(MAKE)
 | 
			
		||||
 | 
			
		||||
define Host/SetToolchainInfo
 | 
			
		||||
	$(SED) 's,TARGET_CROSS=.*,TARGET_CROSS=$(REAL_GNU_TARGET_NAME)-,' $(TOOLCHAIN_DIR)/info.mk
 | 
			
		||||
	$(SED) 's,GCC_VERSION=.*,GCC_VERSION=$(GCC_VERSION),' $(TOOLCHAIN_DIR)/info.mk
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user