Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Romain Naour <romain.naour@openwide.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 04/18] infra: move ccache handling to the toolchain wrapper
Date: Sat, 3 Oct 2015 23:02:29 +0200	[thread overview]
Message-ID: <56104265.9070506@openwide.fr> (raw)
In-Reply-To: <1442774504-22799-5-git-send-email-arnout@mind.be>

Hi Arnout,

Le 20/09/2015 20:41, Arnout Vandecappelle (Essensium/Mind) a ?crit :
> Since we always have a toolchain wrapper now, we can move the ccache
> call to the toolchain wrapper.
> 
> The hostcc ccache handling obviously stays.
> 
> The global addition of ccache to TARGET_CC/CXX is removed, but many
> individual packages and infras still add it. This means we have a
> chain like this: ccache -> toolchain-wrapper -> ccache -> gcc
> However, this is fairly harmless: for cache misses, the inner ccache
> just adds overhead and for cache hits, the inner ccache is never
> called. Later patches will remove these redundant ccache calls.
> 
> As a side effect, perl now supports ccache as well.
> 
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> Cc: Danomi Manchego <danomimanchego123@gmail.com>
> Cc: K?roly Kasza <kaszak@gmail.com>

Reviewed-by: Romain Naour <romain.naour@openwide.fr>

Best regards,
Romain

> ---
>  package/Makefile.in            | 5 -----
>  toolchain/toolchain-wrapper.c  | 5 ++++-
>  toolchain/toolchain-wrapper.mk | 4 ++++
>  3 files changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/package/Makefile.in b/package/Makefile.in
> index 545694f..4b1ce7f 100644
> --- a/package/Makefile.in
> +++ b/package/Makefile.in
> @@ -189,11 +189,6 @@ TARGET_OBJDUMP  = $(TARGET_CROSS)objdump
>  TARGET_CC_NOCCACHE  := $(TARGET_CC)
>  TARGET_CXX_NOCCACHE := $(TARGET_CXX)
>  
> -ifeq ($(BR2_CCACHE),y)
> -TARGET_CC  := $(CCACHE) $(TARGET_CC)
> -TARGET_CXX := $(CCACHE) $(TARGET_CXX)
> -endif
> -
>  ifeq ($(BR2_STRIP_strip),y)
>  STRIP_STRIP_DEBUG := --strip-debug
>  STRIP_STRIP_UNNEEDED := --strip-unneeded
> diff --git a/toolchain/toolchain-wrapper.c b/toolchain/toolchain-wrapper.c
> index f3ff04f..4774692 100644
> --- a/toolchain/toolchain-wrapper.c
> +++ b/toolchain/toolchain-wrapper.c
> @@ -40,6 +40,9 @@ static char sysroot[PATH_MAX];
>  #define EXCLUSIVE_ARGS	3
>  
>  static char *predef_args[] = {
> +#ifdef BR_CCACHE
> +	BR_CCACHE,
> +#endif
>  	path,
>  	"--sysroot", sysroot,
>  #ifdef BR_ABI
> @@ -251,7 +254,7 @@ int main(int argc, char **argv)
>  		}
>  	}
>  
> -	if (execv(path, args))
> +	if (execv(args[0], args))
>  		perror(path);
>  
>  	free(args);
> diff --git a/toolchain/toolchain-wrapper.mk b/toolchain/toolchain-wrapper.mk
> index 8e8a445..ab8215d 100644
> --- a/toolchain/toolchain-wrapper.mk
> +++ b/toolchain/toolchain-wrapper.mk
> @@ -17,6 +17,10 @@ TOOLCHAIN_WRAPPER_ARGS += -DBR_SYSROOT='"$(STAGING_SUBDIR)"'
>  # toolchain wrapper.
>  TOOLCHAIN_WRAPPER_ARGS += -DBR_ADDITIONAL_CFLAGS='$(foreach f,$(call qstrip,$(BR2_TARGET_OPTIMIZATION)),"$(f)",)'
>  
> +ifeq ($(BR2_CCACHE),y)
> +TOOLCHAIN_WRAPPER_ARGS += -DBR_CCACHE='"$(CCACHE)"'
> +endif
> +
>  # For simplicity, build directly into the install location
>  define TOOLCHAIN_BUILD_WRAPPER
>  	$(Q)mkdir -p $(HOST_DIR)/usr/bin
> 

  reply	other threads:[~2015-10-03 21:02 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-20 18:41 [Buildroot] Internal toolchain wrapper & ccache fixes Arnout Vandecappelle
2015-09-20 18:41 ` [Buildroot] [PATCH 01/18] toolchain-external: move wrapper to toolchain directory Arnout Vandecappelle
2015-10-03 18:45   ` Romain Naour
2015-09-20 18:41 ` [Buildroot] [PATCH 02/18] gcc: use toolchain wrapper Arnout Vandecappelle
2015-10-03 19:42   ` Romain Naour
2015-09-20 18:41 ` [Buildroot] [PATCH 03/18] gcc: remove unsafe patch check (poison system dirs) patch Arnout Vandecappelle
2015-10-03 19:47   ` Romain Naour
2015-09-20 18:41 ` [Buildroot] [PATCH 04/18] infra: move ccache handling to the toolchain wrapper Arnout Vandecappelle
2015-10-03 21:02   ` Romain Naour [this message]
2015-09-20 18:41 ` [Buildroot] [PATCH 05/18] perl: Remove ccache handling Arnout Vandecappelle
2015-10-03 21:07   ` Romain Naour
2015-09-20 18:41 ` [Buildroot] [PATCH 06/18] imx-lib: remove now-redundant " Arnout Vandecappelle
2015-10-03 21:11   ` Romain Naour
2015-10-03 21:16     ` Romain Naour
2015-09-20 18:41 ` [Buildroot] [PATCH 07/18] imx-vpu: " Arnout Vandecappelle
2015-10-03 21:22   ` Romain Naour
2015-09-20 18:41 ` [Buildroot] [PATCH 08/18] linux: " Arnout Vandecappelle
2015-10-03 21:23   ` Romain Naour
2015-09-20 19:23 ` [Buildroot] [PATCH 09/18] uboot: " Arnout Vandecappelle
2015-09-20 19:23   ` [Buildroot] [PATCH 10/18] barebox: " Arnout Vandecappelle
2015-10-03 21:25     ` Romain Naour
2015-09-20 19:23   ` [Buildroot] [PATCH 11/18] cryptodev-linux: remove now-redundant fix-ccache-compile patch Arnout Vandecappelle
2015-10-03 21:34     ` Romain Naour
2015-09-20 19:23   ` [Buildroot] [PATCH 12/18] qt5base: remove now-redundant ccache handling Arnout Vandecappelle
2015-10-03 21:43     ` Romain Naour
2015-09-20 19:23   ` [Buildroot] [PATCH 13/18] package-cmake: remove now-redundant target ccache support Arnout Vandecappelle
2015-10-04  9:32     ` Romain Naour
2015-10-03 21:24   ` [Buildroot] [PATCH 09/18] uboot: remove now-redundant ccache handling Romain Naour
2015-09-20 19:28 ` [Buildroot] [PATCH 14/19] package-cmake: remove now-redundant target ccache support Arnout Vandecappelle
2015-09-20 19:28   ` [Buildroot] [PATCH 15/19] qpid-proton: remove now-redundant ccache handling patch Arnout Vandecappelle
2015-10-04  9:44     ` Romain Naour
2015-09-20 19:28   ` [Buildroot] [PATCH 16/19] Makefile.in: remove now-unused TARGET_CC/CXX_NOCCACHE Arnout Vandecappelle
2015-10-04  9:48     ` Romain Naour
2015-09-20 19:28   ` [Buildroot] [PATCH 17/19] [RFC] toolchain-wrapper: support change of BR2_CCACHE Arnout Vandecappelle
2015-10-04 10:13     ` Romain Naour
2015-09-20 19:28   ` [Buildroot] [PATCH 18/19] ccache: use mtime for external toolchain, CONF_OPTS for internal toolchain Arnout Vandecappelle
2015-09-21 21:43     ` Samuel Martin
2015-09-21 22:32       ` Arnout Vandecappelle
2015-09-22 19:25         ` Samuel Martin
2015-09-20 19:28   ` [Buildroot] [PATCH 19/19] [RFC] ccache: support changing the output directory Arnout Vandecappelle
2015-09-20 19:32   ` [Buildroot] [PATCH 14/19] package-cmake: remove now-redundant target ccache support Arnout Vandecappelle
2015-10-03 21:49   ` Romain Naour
2015-09-21 21:43 ` [Buildroot] Internal toolchain wrapper & ccache fixes Samuel Martin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56104265.9070506@openwide.fr \
    --to=romain.naour@openwide.fr \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox