From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Thu, 22 Aug 2013 04:51:21 +0200 Subject: [U-Boot] [U-Boot, 1/2] common: Add CCACHE variable to allow use of ccache In-Reply-To: <52154FC2.7080203@freescale.com> References: <1369070715-9585-2-git-send-email-marex@denx.de> <52154FC2.7080203@freescale.com> Message-ID: <201308220451.21549.marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear York Sun, > On 05/20/2013 10:25 AM, Marek Vasut wrote: > > Prefix HOSTCC and CC with CCACHE variable to allow easy use of ccache. > > In case the user wants to use ccache, exporting CCACHE=ccache will do > > the trick. It is of course possible to either make the cross-compiler > > name into a shellscript which invokes the ccache and the compiler, but > > setting this variable makes use of ccache easier and more convenient. > > > > Using ccache becomes convenient when using MAKEALL for large build > > tests, where the speedup after building the cache for the first time > > is about 4-6 times. > > > > Signed-off-by: Marek Vasut > > Cc: Tom Rini > > > > --- > > config.mk | 8 +++++--- > > > > 1 file changed, 5 insertions(+), 3 deletions(-) > > > > diff --git a/config.mk b/config.mk > > index 1fd109f..d59ded2 100644 > > --- a/config.mk > > +++ b/config.mk > > @@ -98,6 +98,8 @@ else > > > > HOSTCC = gcc > > endif > > > > +HOSTCC := $(CCACHE) $(HOSTCC) > > + > > > > ifeq ($(HOSTOS),cygwin) > > HOSTCFLAGS += -ansi > > endif > > > > @@ -140,13 +142,13 @@ binutils-version = $(shell $(SHELL) > > $(SRCTREE)/tools/binutils-version.sh $(AS)) > > > > # > > # Include the make variables (CC, etc...) > > # > > > > -AS = $(CROSS_COMPILE)as > > +AS = $(CCACHE) $(CROSS_COMPILE)as > > > > # Always use GNU ld > > LD = $(shell if $(CROSS_COMPILE)ld.bfd -v > /dev/null 2>&1; \ > > > > then echo "$(CROSS_COMPILE)ld.bfd"; else echo "$(CROSS_COMPILE)ld"; > > fi;) > > > > -CC = $(CROSS_COMPILE)gcc > > +CC = $(CCACHE) $(CROSS_COMPILE)gcc > > > > CPP = $(CC) -E > > AR = $(CROSS_COMPILE)ar > > NM = $(CROSS_COMPILE)nm > > > > @@ -320,7 +322,7 @@ endif > > > > ######################################################################## > > # > > > > -export HOSTCC HOSTCFLAGS HOSTLDFLAGS PEDCFLAGS HOSTSTRIP CROSS_COMPILE \ > > +export HOSTCC HOSTCFLAGS HOSTLDFLAGS PEDCFLAGS HOSTSTRIP CROSS_COMPILE > > CCACHE \ > > > > AS LD CC CPP AR NM STRIP OBJCOPY OBJDUMP MAKE > > > > export CONFIG_SYS_TEXT_BASE PLATFORM_CPPFLAGS PLATFORM_RELFLAGS CPPFLAGS > > CFLAGS AFLAGS > > Where did this patch go? I found it useful. It needs additional fixes, try running with MAKEALL and you will see the problem -- the problem is you would need separate ccache for each MAKEALL thread. Best regards, Marek Vasut