Optimize (-O2) host binaries by default
authorPeter Korsgaard <jacmet@sunsite.dk>
Fri, 29 Oct 2010 19:00:26 +0000 (21:00 +0200)
committerPeter Korsgaard <jacmet@sunsite.dk>
Fri, 29 Oct 2010 19:00:26 +0000 (21:00 +0200)
Default HOST_CFLAGS to -O2, so host tools (like the cross compiler) are
built with optimization by default.

Based on a patch by Will Newton <will.newton@gmail.com>.

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

index 22c3801d111a3f943bc0579927d9287f72d96a8d..efc42ffc863a857785cfaca0267f0db2d3367748 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -148,15 +148,6 @@ HOSTLD:=$(shell which $(HOSTLD) || type -p $(HOSTLD) || echo ld)
 HOSTLN:=$(shell which $(HOSTLN) || type -p $(HOSTLN) || echo ln)
 HOSTNM:=$(shell which $(HOSTNM) || type -p $(HOSTNM) || echo nm)
 
-ifndef CFLAGS_FOR_BUILD
-CFLAGS_FOR_BUILD:=-g -O2
-endif
-ifndef CXXFLAGS_FOR_BUILD
-CXXFLAGS_FOR_BUILD:=-g -O2
-endif
-ifndef FCFLAGS_FOR_BUILD
-FCFLAGS_FOR_BUILD:=-g -O2
-endif
 export HOSTAR HOSTAS HOSTCC HOSTCXX HOSTFC HOSTLD
 
 # bash prints the name of the directory on 'cd <dir>' if CDPATH is
index fb09083de45946c6f42577f90ed81b53736146e3..971a7edc74a4eb7978315b6c949f047d344e9422 100644 (file)
@@ -169,6 +169,7 @@ FLEX:=$(shell which flex || type -p flex)
 BISON:=$(shell which bison || type -p bison)
 SED:=$(shell which sed || type -p sed) -i -e
 
+HOST_CFLAGS   ?= -O2
 HOST_CFLAGS   += -I$(HOST_DIR)/include -I$(HOST_DIR)/usr/include
 HOST_CXXFLAGS += -I$(HOST_DIR)/include -I$(HOST_DIR)/usr/include
 HOST_LDFLAGS  += -L$(HOST_DIR)/lib -L$(HOST_DIR)/usr/lib -Wl,-rpath,$(HOST_DIR)/usr/lib
index 48abbaa506828ce9d761f7851b54e83a6113edee..f387e2d9cef04f18932fc8aea4740911f27a86fd 100644 (file)
@@ -16,7 +16,7 @@ SSTRIP_HOST:=$(STAGING_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-sstrip
 
 $(SSTRIP_HOST): $(SSTRIP_SOURCE_FILE)
        mkdir -p $(@D) $(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME)/bin
-       $(HOSTCC) $(CFLAGS_FOR_BUILD) $(SSTRIP_SOURCE_FILE) -o $(SSTRIP_HOST)
+       $(HOSTCC) $(HOST_CFLAGS) $(SSTRIP_SOURCE_FILE) -o $(SSTRIP_HOST)
        ln -snf ../../bin/$(REAL_GNU_TARGET_NAME)-sstrip \
                $(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME)/bin/sstrip
        ln -snf $(REAL_GNU_TARGET_NAME)-sstrip \