From patchwork Wed Nov 2 06:54:02 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfgang Denk X-Patchwork-Id: 123231 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 7BACDB6F67 for ; Wed, 2 Nov 2011 17:54:18 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DFA8628F6D; Wed, 2 Nov 2011 07:54:16 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Kn2e5mZrof5U; Wed, 2 Nov 2011 07:54:15 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6D4CE28DE0; Wed, 2 Nov 2011 07:54:15 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AF62228DE0 for ; Wed, 2 Nov 2011 07:54:11 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VR3X1XRR2v9p for ; Wed, 2 Nov 2011 07:54:10 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) by theia.denx.de (Postfix) with ESMTP id E2C6F28DDF for ; Wed, 2 Nov 2011 07:54:08 +0100 (CET) Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id D425C1C02BB6; Wed, 2 Nov 2011 07:54:06 +0100 (CET) X-Auth-Info: kAarRK4UDdHb6bZ7r4BGnuOLUPHonhkqN7vRXeGM8Vw= Received: from diddl.denx.de (host-80-81-18-216.customer.m-online.net [80.81.18.216]) by smtp-auth.mnet-online.de (Postfix) with ESMTPA id 931371C0012E; Wed, 2 Nov 2011 07:54:06 +0100 (CET) Received: from gemini.denx.de (gemini.denx.de [10.0.0.2]) by diddl.denx.de (Postfix) with ESMTP id 4821DC913106; Wed, 2 Nov 2011 07:54:06 +0100 (CET) Received: by gemini.denx.de (Postfix, from userid 500) id 18E741408E9A; Wed, 2 Nov 2011 07:54:06 +0100 (CET) From: Wolfgang Denk To: u-boot@lists.denx.de Date: Wed, 2 Nov 2011 07:54:02 +0100 Message-Id: <1320216842-29785-1-git-send-email-wd@denx.de> X-Mailer: git-send-email 1.7.6.4 Cc: Graeme Russ , Kumar Gala , Albert Aribaud , Andy Fleming Subject: [U-Boot] [PATCH] Reduce build times X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de U-Boot Makefiles contain a number of tests for compiler features etc. which so far are executed again and again. On some architectures (especially ARM) this results in a large number of calls to gcc. This patch makes sure to run such tests only once, thus largely reducing the number of "execve" system calls. Example: number of "execve" system calls for building the "P2020DS" (Power Architecture) and "qong" (ARM) boards, measured as: -> strace -f -e trace=execve -o /tmp/foo ./MAKEALL -> grep execve /tmp/foo | wc -l Before: After: Reduction: Tested-by: Graeme Russ Tested-by: Matthias Weisser Tested-by: Sanjeev Premi Tested-by: Simon Glass Tested-by: Macpaul Lin Acked-by: Mike Frysinger ================================== P2020DS 20555 15205 -26% qong 31692 14490 -54% As a result, built times are significantly reduced, typically by 30...50%. Signed-off-by: Wolfgang Denk Cc: Andy Fleming Cc: Kumar Gala Cc: Albert Aribaud cc: Graeme Russ cc: Mike Frysinger --- More detailled build results: 1) Number of "execve" system calls for two exemplary boards: "P2020DS" for Power Architecture, and "qong" for ARM. Measured as: -> strace -f -e trace=execve -o /tmp/foo ./MAKEALL -> grep execve /tmp/foo | wc -l Before: After: Reduction: ======================================= P2020DS 20555 15205 -26% qong 31692 14490 -54% 2) Build time for single boards: Measured as "time ./MAKEALL " (average over 3 runs after a dummy run to populate the file system; using ELDK 4.2 tool chain; measured for "P2020DS" and "qong" on a Core2 Quad CPU at 2.83GHz, for "m28evk" on a i.MX28 at 454MHz over NFS) Before: After: Reduction: ======================================= P2020DS real 29.429s 19.494s -34% user 64.035s 48.621s -24% sys 16.188s 9.203s -43% qong: real 34.274s 16.263s -53% user 65.014s 39.516s -39% sys 27.606s 9.551s -65% m28evk: real 45.752m 27.606m -40% user 24.868m 17.511m -30% sys 17.017m 6.642m -61% 3) Build time for MAKEALL: Measured as "time MAKEALL_LOGDIR=/work/wd/tmp-LOG BUILD_DIR=/work/wd/tmp ./MAKEALL " (using ELDK 4.2 tool chain; measured for "ppc" and "arm" on a Core i7 at 3.07GHz) Before: After: Reduction: ======================================= ppc real 82.063m 66.595m -19% user 261.710m 231.429m -12% sys 61.739m 49.193m -20% arm real 55.269m 20.763m -62% user 84.302m 49.154m -42% sys 38.933m 15.028m -61% Note: There is further potential for build time reductions by performing similar optimizations for a number of $(shell ...) constructs in the Makefiles, but I have no good ways to test these at the moment so this is left as exercise for the respective architecture maintainers (mostly blackfin and coldfire, AFAICT) -- wd Makefile | 2 +- arch/arm/config.mk | 19 ++++++++++--------- arch/arm/cpu/arm1136/config.mk | 3 ++- arch/arm/cpu/arm1176/config.mk | 4 +++- arch/arm/cpu/arm1176/s3c64xx/config.mk | 4 +++- arch/arm/cpu/arm720t/config.mk | 4 +++- arch/arm/cpu/arm920t/config.mk | 3 ++- arch/arm/cpu/arm925t/config.mk | 3 ++- arch/arm/cpu/arm926ejs/at91/config.mk | 3 ++- arch/arm/cpu/arm926ejs/config.mk | 3 ++- arch/arm/cpu/arm946es/config.mk | 3 ++- arch/arm/cpu/arm_intcm/config.mk | 3 ++- arch/arm/cpu/armv7/config.mk | 4 ++-- arch/arm/cpu/armv7/omap-common/config.mk | 5 +++-- arch/arm/cpu/ixp/config.mk | 3 ++- arch/arm/cpu/lh7a40x/config.mk | 3 ++- arch/arm/cpu/pxa/config.mk | 3 ++- arch/arm/cpu/s3c44b0/config.mk | 3 ++- arch/arm/cpu/sa1100/config.mk | 3 ++- arch/powerpc/cpu/mpc824x/Makefile | 3 +-- arch/powerpc/cpu/mpc85xx/config.mk | 5 +++-- arch/x86/config.mk | 10 ++++++---- board/siemens/SCM/Makefile | 3 +-- config.mk | 8 +++++--- examples/standalone/Makefile | 3 ++- 25 files changed, 67 insertions(+), 43 deletions(-) diff --git a/Makefile b/Makefile index 9ef33f9..82de62b 100644 --- a/Makefile +++ b/Makefile @@ -320,7 +320,7 @@ else PLATFORM_LIBGCC = -L $(USE_PRIVATE_LIBGCC) -lgcc endif else -PLATFORM_LIBGCC = -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc +PLATFORM_LIBGCC := -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc endif PLATFORM_LIBS += $(PLATFORM_LIBGCC) export PLATFORM_LIBS diff --git a/arch/arm/config.mk b/arch/arm/config.mk index 9b4e581..45f9dca 100644 --- a/arch/arm/config.mk +++ b/arch/arm/config.mk @@ -34,7 +34,7 @@ endif PLATFORM_CPPFLAGS += -DCONFIG_ARM -D__ARM__ # Explicitly specifiy 32-bit ARM ISA since toolchain default can be -mthumb: -PLATFORM_CPPFLAGS += $(call cc-option,-marm,) +PF_CPPFLAGS_ARM := $(call cc-option,-marm,) # Try if EABI is supported, else fall back to old API, # i. e. for example: @@ -44,15 +44,16 @@ PLATFORM_CPPFLAGS += $(call cc-option,-marm,) # -mabi=apcs-gnu -mno-thumb-interwork # - with ELDK 3.1 (gcc 3.x), use: # -mapcs-32 -mno-thumb-interwork -PLATFORM_CPPFLAGS += $(call cc-option,\ - -mabi=aapcs-linux -mno-thumb-interwork,\ +PF_CPPFLAGS_ABI := $(call cc-option,\ + -mabi=aapcs-linux -mno-thumb-interwork,\ + $(call cc-option,\ + -mapcs-32,\ $(call cc-option,\ - -mapcs-32,\ - $(call cc-option,\ - -mabi=apcs-gnu,\ - )\ - ) $(call cc-option,-mno-thumb-interwork,)\ - ) + -mabi=apcs-gnu,\ + )\ + ) $(call cc-option,-mno-thumb-interwork,)\ + ) +PLATFORM_CPPFLAGS += $(PF_CPPFLAGS_ARM) $(PF_CPPFLAGS_ABI) # For EABI, make sure to provide raise() ifneq (,$(findstring -mabi=aapcs-linux,$(PLATFORM_CPPFLAGS))) diff --git a/arch/arm/cpu/arm1136/config.mk b/arch/arm/cpu/arm1136/config.mk index 3e68535..efee0d1 100644 --- a/arch/arm/cpu/arm1136/config.mk +++ b/arch/arm/cpu/arm1136/config.mk @@ -29,4 +29,5 @@ PLATFORM_CPPFLAGS += -march=armv5 # Supply options according to compiler version # # ========================================================================= -PLATFORM_RELFLAGS +=$(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) +PF_RELFLAGS_SLB_AT := $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) +PLATFORM_RELFLAGS += $(PF_RELFLAGS_SLB_AT) diff --git a/arch/arm/cpu/arm1176/config.mk b/arch/arm/cpu/arm1176/config.mk index 14346cf..222d352 100644 --- a/arch/arm/cpu/arm1176/config.mk +++ b/arch/arm/cpu/arm1176/config.mk @@ -29,4 +29,6 @@ PLATFORM_CPPFLAGS += -march=armv5t # Supply options according to compiler version # # ========================================================================= -PLATFORM_RELFLAGS +=$(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) +PF_RELFLAGS_SLB_AT := $(call cc-option,-mshort-load-bytes,\ + $(call cc-option,-malignment-traps,)) +PLATFORM_RELFLAGS += $(PF_RELFLAGS_SLB_AT) diff --git a/arch/arm/cpu/arm1176/s3c64xx/config.mk b/arch/arm/cpu/arm1176/s3c64xx/config.mk index 14346cf..222d352 100644 --- a/arch/arm/cpu/arm1176/s3c64xx/config.mk +++ b/arch/arm/cpu/arm1176/s3c64xx/config.mk @@ -29,4 +29,6 @@ PLATFORM_CPPFLAGS += -march=armv5t # Supply options according to compiler version # # ========================================================================= -PLATFORM_RELFLAGS +=$(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) +PF_RELFLAGS_SLB_AT := $(call cc-option,-mshort-load-bytes,\ + $(call cc-option,-malignment-traps,)) +PLATFORM_RELFLAGS += $(PF_RELFLAGS_SLB_AT) diff --git a/arch/arm/cpu/arm720t/config.mk b/arch/arm/cpu/arm720t/config.mk index 3844c62..210c6dc 100644 --- a/arch/arm/cpu/arm720t/config.mk +++ b/arch/arm/cpu/arm720t/config.mk @@ -30,4 +30,6 @@ PLATFORM_CPPFLAGS += -march=armv4 -mtune=arm7tdmi # Supply options according to compiler version # # ========================================================================= -PLATFORM_RELFLAGS +=$(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) +PF_RELFLAGS_SLB_AT := $(call cc-option,-mshort-load-bytes,\ + $(call cc-option,-malignment-traps,)) +PLATFORM_RELFLAGS += $(PF_RELFLAGS_SLB_AT) diff --git a/arch/arm/cpu/arm920t/config.mk b/arch/arm/cpu/arm920t/config.mk index 8f6c1a3..f03030a 100644 --- a/arch/arm/cpu/arm920t/config.mk +++ b/arch/arm/cpu/arm920t/config.mk @@ -29,4 +29,5 @@ PLATFORM_CPPFLAGS += -march=armv4 # Supply options according to compiler version # # ========================================================================= -PLATFORM_RELFLAGS +=$(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) +PF_RELFLAGS_SLB_AT := $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) +PLATFORM_RELFLAGS += $(PF_RELFLAGS_SLB_AT) diff --git a/arch/arm/cpu/arm925t/config.mk b/arch/arm/cpu/arm925t/config.mk index 8f6c1a3..f03030a 100644 --- a/arch/arm/cpu/arm925t/config.mk +++ b/arch/arm/cpu/arm925t/config.mk @@ -29,4 +29,5 @@ PLATFORM_CPPFLAGS += -march=armv4 # Supply options according to compiler version # # ========================================================================= -PLATFORM_RELFLAGS +=$(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) +PF_RELFLAGS_SLB_AT := $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) +PLATFORM_RELFLAGS += $(PF_RELFLAGS_SLB_AT) diff --git a/arch/arm/cpu/arm926ejs/at91/config.mk b/arch/arm/cpu/arm926ejs/at91/config.mk index 19296fd..370630d 100644 --- a/arch/arm/cpu/arm926ejs/at91/config.mk +++ b/arch/arm/cpu/arm926ejs/at91/config.mk @@ -1 +1,2 @@ -PLATFORM_CPPFLAGS += $(call cc-option,-mtune=arm926ejs,) +PF_CPPFLAGS_TUNE := $(call cc-option,-mtune=arm926ejs,) +PLATFORM_CPPFLAGS += $(PF_CPPFLAGS_TUNE) diff --git a/arch/arm/cpu/arm926ejs/config.mk b/arch/arm/cpu/arm926ejs/config.mk index f8ef90f..ffb2e6c 100644 --- a/arch/arm/cpu/arm926ejs/config.mk +++ b/arch/arm/cpu/arm926ejs/config.mk @@ -29,4 +29,5 @@ PLATFORM_CPPFLAGS += -march=armv5te # Supply options according to compiler version # # ========================================================================= -PLATFORM_RELFLAGS +=$(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) +PF_RELFLAGS_SLB_AT := $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) +PLATFORM_RELFLAGS += $(PF_RELFLAGS_SLB_AT) diff --git a/arch/arm/cpu/arm946es/config.mk b/arch/arm/cpu/arm946es/config.mk index e783f69..c2354ba 100644 --- a/arch/arm/cpu/arm946es/config.mk +++ b/arch/arm/cpu/arm946es/config.mk @@ -29,4 +29,5 @@ PLATFORM_CPPFLAGS += -march=armv4 # Supply options according to compiler version # # ========================================================================= -PLATFORM_RELFLAGS +=$(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) +PF_RELFLAGS_SLB_AT := $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) +PLATFORM_RELFLAGS += $(PF_RELFLAGS_SLB_AT) diff --git a/arch/arm/cpu/arm_intcm/config.mk b/arch/arm/cpu/arm_intcm/config.mk index e783f69..c2354ba 100644 --- a/arch/arm/cpu/arm_intcm/config.mk +++ b/arch/arm/cpu/arm_intcm/config.mk @@ -29,4 +29,5 @@ PLATFORM_CPPFLAGS += -march=armv4 # Supply options according to compiler version # # ========================================================================= -PLATFORM_RELFLAGS +=$(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) +PF_RELFLAGS_SLB_AT := $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) +PLATFORM_RELFLAGS += $(PF_RELFLAGS_SLB_AT) diff --git a/arch/arm/cpu/armv7/config.mk b/arch/arm/cpu/armv7/config.mk index 49ac9c7..83ddf10 100644 --- a/arch/arm/cpu/armv7/config.mk +++ b/arch/arm/cpu/armv7/config.mk @@ -29,5 +29,5 @@ PLATFORM_CPPFLAGS += -march=armv5 # Supply options according to compiler version # # ========================================================================= -PLATFORM_RELFLAGS +=$(call cc-option,-mshort-load-bytes,\ - $(call cc-option,-malignment-traps,)) +PF_RELFLAGS_SLB_AT := $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) +PLATFORM_RELFLAGS += $(PF_RELFLAGS_SLB_AT) diff --git a/arch/arm/cpu/armv7/omap-common/config.mk b/arch/arm/cpu/armv7/omap-common/config.mk index 49ac9c7..c400dcc 100644 --- a/arch/arm/cpu/armv7/omap-common/config.mk +++ b/arch/arm/cpu/armv7/omap-common/config.mk @@ -29,5 +29,6 @@ PLATFORM_CPPFLAGS += -march=armv5 # Supply options according to compiler version # # ========================================================================= -PLATFORM_RELFLAGS +=$(call cc-option,-mshort-load-bytes,\ - $(call cc-option,-malignment-traps,)) +PF_RELFLAGS_SLB_AT := $(call cc-option,-mshort-load-bytes,\ + $(call cc-option,-malignment-traps,)) +PLATFORM_RELFLAGS += $(PF_RELFLAGS_SLB_AT) diff --git a/arch/arm/cpu/ixp/config.mk b/arch/arm/cpu/ixp/config.mk index 5868cba..9149665 100644 --- a/arch/arm/cpu/ixp/config.mk +++ b/arch/arm/cpu/ixp/config.mk @@ -37,4 +37,5 @@ LDFLAGS_u-boot += --gc-sections # Supply options according to compiler version # # ========================================================================= -PLATFORM_RELFLAGS +=$(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) +PF_RELFLAGS_SLB_AT := $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) +PLATFORM_RELFLAGS += $(PF_RELFLAGS_SLB_AT) diff --git a/arch/arm/cpu/lh7a40x/config.mk b/arch/arm/cpu/lh7a40x/config.mk index 47b2b7b..1c4aa97 100644 --- a/arch/arm/cpu/lh7a40x/config.mk +++ b/arch/arm/cpu/lh7a40x/config.mk @@ -29,4 +29,5 @@ PLATFORM_CPPFLAGS += -march=armv4 # Supply options according to compiler version # # ======================================================================== -PLATFORM_RELFLAGS +=$(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) +PF_RELFLAGS_SLB_AT := $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) +PLATFORM_RELFLAGS += $(PF_RELFLAGS_SLB_AT) diff --git a/arch/arm/cpu/pxa/config.mk b/arch/arm/cpu/pxa/config.mk index a05d69c..0bbe295 100644 --- a/arch/arm/cpu/pxa/config.mk +++ b/arch/arm/cpu/pxa/config.mk @@ -30,4 +30,5 @@ PLATFORM_CPPFLAGS += -march=armv5te -mtune=xscale # Supply options according to compiler version # # ======================================================================== -PLATFORM_RELFLAGS +=$(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) +PF_RELFLAGS_SLB_AT := $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) +PLATFORM_RELFLAGS += $(PF_RELFLAGS_SLB_AT) diff --git a/arch/arm/cpu/s3c44b0/config.mk b/arch/arm/cpu/s3c44b0/config.mk index 7454d72..f6f6398 100644 --- a/arch/arm/cpu/s3c44b0/config.mk +++ b/arch/arm/cpu/s3c44b0/config.mk @@ -30,4 +30,5 @@ PLATFORM_CPPFLAGS += -march=armv4 -mtune=arm7tdmi -msoft-float # Supply options according to compiler version # # ======================================================================== -PLATFORM_RELFLAGS +=$(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) +PF_RELFLAGS_SLB_AT := $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) +PLATFORM_RELFLAGS += $(PF_RELFLAGS_SLB_AT) diff --git a/arch/arm/cpu/sa1100/config.mk b/arch/arm/cpu/sa1100/config.mk index 6f21f41..06af160 100644 --- a/arch/arm/cpu/sa1100/config.mk +++ b/arch/arm/cpu/sa1100/config.mk @@ -30,4 +30,5 @@ PLATFORM_CPPFLAGS += -march=armv4 -mtune=strongarm1100 # Supply options according to compiler version # # ======================================================================== -PLATFORM_RELFLAGS +=$(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) +PF_RELFLAGS_SLB_AT := $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) +PLATFORM_RELFLAGS += $(PF_RELFLAGS_SLB_AT) diff --git a/arch/powerpc/cpu/mpc824x/Makefile b/arch/powerpc/cpu/mpc824x/Makefile index 2bfcd85..ebf4cb2 100644 --- a/arch/powerpc/cpu/mpc824x/Makefile +++ b/arch/powerpc/cpu/mpc824x/Makefile @@ -23,8 +23,7 @@ include $(TOPDIR)/config.mk ifneq ($(OBJTREE),$(SRCTREE)) -$(shell mkdir -p $(obj)drivers/epic) -$(shell mkdir -p $(obj)drivers/i2c) +$(shell mkdir -p $(obj)drivers/epic $(obj)drivers/i2c) endif LIB = $(obj)lib$(CPU).o diff --git a/arch/powerpc/cpu/mpc85xx/config.mk b/arch/powerpc/cpu/mpc85xx/config.mk index 68ac57d..f36d823 100644 --- a/arch/powerpc/cpu/mpc85xx/config.mk +++ b/arch/powerpc/cpu/mpc85xx/config.mk @@ -28,5 +28,6 @@ PLATFORM_CPPFLAGS += -ffixed-r2 -Wa,-me500 -msoft-float -mno-string # -mspe=yes is needed to have -mno-spe accepted by a buggy GCC; # see "[PATCH,rs6000] make -mno-spe work as expected" on # http://gcc.gnu.org/ml/gcc-patches/2008-04/msg00311.html -PLATFORM_CPPFLAGS +=$(call cc-option,-mspe=yes) -PLATFORM_CPPFLAGS +=$(call cc-option,-mno-spe) +PF_CPPFLAGS_SPE := $(call cc-option,-mspe=yes) \ + $(call cc-option,-mno-spe) +PLATFORM_CPPFLAGS += $(PF_CPPFLAGS_SPE) diff --git a/arch/x86/config.mk b/arch/x86/config.mk index ee23c9f..fe9083f 100644 --- a/arch/x86/config.mk +++ b/arch/x86/config.mk @@ -27,10 +27,12 @@ PLATFORM_CPPFLAGS += -fno-strict-aliasing PLATFORM_CPPFLAGS += -Wstrict-prototypes PLATFORM_CPPFLAGS += -mregparm=3 PLATFORM_CPPFLAGS += -fomit-frame-pointer -PLATFORM_CPPFLAGS += $(call cc-option, -ffreestanding) -PLATFORM_CPPFLAGS += $(call cc-option, -fno-toplevel-reorder, $(call cc-option, -fno-unit-at-a-time)) -PLATFORM_CPPFLAGS += $(call cc-option, -fno-stack-protector) -PLATFORM_CPPFLAGS += $(call cc-option, -mpreferred-stack-boundary=2) +PF_CPPFLAGS_X86 := $(call cc-option, -ffreestanding) \ + $(call cc-option, -fno-toplevel-reorder, \ + $(call cc-option, -fno-unit-at-a-time)) \ + $(call cc-option, -fno-stack-protector) \ + $(call cc-option, -mpreferred-stack-boundary=2) +PLATFORM_CPPFLAGS += $(PF_CPPFLAGS_X86) PLATFORM_CPPFLAGS += -fno-dwarf2-cfi-asm PLATFORM_CPPFLAGS += -DREALMODE_BASE=0x7c0 diff --git a/board/siemens/SCM/Makefile b/board/siemens/SCM/Makefile index 07cc5a6..07db9d4 100644 --- a/board/siemens/SCM/Makefile +++ b/board/siemens/SCM/Makefile @@ -24,8 +24,7 @@ include $(TOPDIR)/config.mk ifneq ($(OBJTREE),$(SRCTREE)) -$(shell mkdir -p $(obj)../common) -$(shell mkdir -p $(obj)../../tqc/tqm8xx) +$(shell mkdir -p $(obj)../common $(obj)../../tqc/tqm8xx) endif LIB = $(obj)lib$(BOARD).o diff --git a/config.mk b/config.mk index 11b67e5..918cffe 100644 --- a/config.mk +++ b/config.mk @@ -209,11 +209,13 @@ else CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes endif -CFLAGS += $(call cc-option,-fno-stack-protector) +CFLAGS_SSP := $(call cc-option,-fno-stack-protector) +CFLAGS += $(CFLAGS_SSP) # Some toolchains enable security related warning flags by default, # but they don't make much sense in the u-boot world, so disable them. -CFLAGS += $(call cc-option,-Wno-format-nonliteral) -CFLAGS += $(call cc-option,-Wno-format-security) +CFLAGS_WARN := $(call cc-option,-Wno-format-nonliteral) \ + $(call cc-option,-Wno-format-security) +CFLAGS += $(CFLAGS_WARN) # $(CPPFLAGS) sets -g, which causes gcc to pass a suitable -g # option to the assembler. diff --git a/examples/standalone/Makefile b/examples/standalone/Makefile index b1e33fb..e23865b 100644 --- a/examples/standalone/Makefile +++ b/examples/standalone/Makefile @@ -85,7 +85,8 @@ endif # We don't want gcc reordering functions if possible. This ensures that an # application's entry point will be the first function in the application's # source file. -CFLAGS += $(call cc-option,-fno-toplevel-reorder) +CFLAGS_NTR := $(call cc-option,-fno-toplevel-reorder) +CFLAGS += $(CFLAGS_NTR) all: $(obj).depend $(OBJS) $(LIB) $(SREC) $(BIN) $(ELF)