diff options
author | Arnout Vandecappelle <arnout@mind.be> | 2015-10-04 13:28:56 +0100 |
---|---|---|
committer | Peter Korsgaard <peter@korsgaard.com> | 2015-10-04 18:22:20 +0200 |
commit | 792f1278e3fbc165086aebb8c07cfd18e10f374b (patch) | |
tree | be8920e77b456b647fc427e4df851ba4753a4766 /toolchain | |
parent | 2b356105f0b44bc8d7af0987d572afde539efd35 (diff) | |
download | buildroot-792f1278e3fbc165086aebb8c07cfd18e10f374b.tar.gz buildroot-792f1278e3fbc165086aebb8c07cfd18e10f374b.zip |
toolchain-wrapper: support change of BR2_CCACHE
By moving the ccache call to the toolchain wrapper, the following
scenario no longer works:
make foo-dirclean all BR2_CCACHE=
That's a sometimes useful call to check if some failure is perhaps
caused by ccache.
We can enable this scenario again by exporting BR_NO_CCACHE when
BR2_CCACHE is not set, and by handling this in the toolchain wrapper.
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Tested-by: Romain Naour <romain.naour@openwide.fr>
Reviewed-by: Romain Naour <romain.naour@openwide.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Diffstat (limited to 'toolchain')
-rw-r--r-- | toolchain/toolchain-wrapper.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/toolchain/toolchain-wrapper.c b/toolchain/toolchain-wrapper.c index aee5df7ac9..0c8f1d848d 100644 --- a/toolchain/toolchain-wrapper.c +++ b/toolchain/toolchain-wrapper.c @@ -98,7 +98,7 @@ static void check_unsafe_path(const char *path, int paranoid) int main(int argc, char **argv) { - char **args, **cur; + char **args, **cur, **exec_args; char *relbasedir, *absbasedir; char *progpath = argv[0]; char *basename; @@ -247,6 +247,13 @@ int main(int argc, char **argv) /* finish with NULL termination */ *cur = NULL; + exec_args = args; +#ifdef BR_CCACHE + if (getenv("BR_NO_CCACHE")) + /* Skip the ccache call */ + exec_args++; +#endif + /* Debug the wrapper to see actual arguments passed to * the compiler: * unset, empty, or 0: do not trace @@ -257,14 +264,14 @@ int main(int argc, char **argv) debug = atoi(env_debug); if (debug > 0) { fprintf(stderr, "Toolchain wrapper executing:"); - for (i = 0; args[i]; i++) + for (i = 0; exec_args[i]; i++) fprintf(stderr, "%s'%s'", - (debug == 2) ? "\n " : " ", args[i]); + (debug == 2) ? "\n " : " ", exec_args[i]); fprintf(stderr, "\n"); } } - if (execv(args[0], args)) + if (execv(exec_args[0], exec_args)) perror(path); free(args); |