* [Buildroot] [PATCH] toolchain/wrapper: also dump args it was called with
@ 2019-08-17 12:48 Yann E. MORIN
2019-08-17 18:25 ` Thomas De Schampheleire
2019-08-17 22:20 ` Thomas Petazzoni
0 siblings, 2 replies; 3+ messages in thread
From: Yann E. MORIN @ 2019-08-17 12:48 UTC (permalink / raw)
To: buildroot
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com>
---
toolchain/toolchain-wrapper.c | 49 +++++++++++++++++++++--------------
1 file changed, 29 insertions(+), 20 deletions(-)
diff --git a/toolchain/toolchain-wrapper.c b/toolchain/toolchain-wrapper.c
index 7a4b9c4007..b7705a4cbf 100644
--- a/toolchain/toolchain-wrapper.c
+++ b/toolchain/toolchain-wrapper.c
@@ -240,7 +240,24 @@ int main(int argc, char **argv)
char *env_debug;
char *paranoid_wrapper;
int paranoid;
- int ret, i, count = 0, debug, found_shared = 0;
+ int ret, i, count = 0, debug = 0, found_shared = 0;
+
+ /* Debug the wrapper to see arguments it was called with.
+ * If environment variable BR2_DEBUG_WRAPPER is:
+ * unset, empty, or 0: do not trace
+ * set to 1 : trace all arguments on a single line
+ * set to 2 : trace one argument per line
+ */
+ if ((env_debug = getenv("BR2_DEBUG_WRAPPER"))) {
+ debug = atoi(env_debug);
+ }
+ if (debug > 0) {
+ fprintf(stderr, "Toolchain wrapper was called with:");
+ for (i = 0; i < argc; i++)
+ fprintf(stderr, "%s'%s'",
+ (debug == 2) ? "\n " : " ", argv[i]);
+ fprintf(stderr, "\n");
+ }
/* Calculate the relative paths */
basename = strrchr(progpath, '/');
@@ -483,29 +500,21 @@ int main(int argc, char **argv)
exec_args++;
#endif
- /* Debug the wrapper to see actual arguments passed to
- * the compiler:
- * unset, empty, or 0: do not trace
- * set to 1 : trace all arguments on a single line
- * set to 2 : trace one argument per line
- */
- if ((env_debug = getenv("BR2_DEBUG_WRAPPER"))) {
- debug = atoi(env_debug);
- if (debug > 0) {
- fprintf(stderr, "Toolchain wrapper executing:");
+ /* Debug the wrapper to see final arguments passed to the real compiler. */
+ if (debug > 0) {
+ fprintf(stderr, "Toolchain wrapper executing:");
#ifdef BR_CCACHE_HASH
- fprintf(stderr, "%sCCACHE_COMPILERCHECK='string:" BR_CCACHE_HASH "'",
- (debug == 2) ? "\n " : " ");
+ fprintf(stderr, "%sCCACHE_COMPILERCHECK='string:" BR_CCACHE_HASH "'",
+ (debug == 2) ? "\n " : " ");
#endif
#ifdef BR_CCACHE_BASEDIR
- fprintf(stderr, "%sCCACHE_BASEDIR='" BR_CCACHE_BASEDIR "'",
- (debug == 2) ? "\n " : " ");
+ fprintf(stderr, "%sCCACHE_BASEDIR='" BR_CCACHE_BASEDIR "'",
+ (debug == 2) ? "\n " : " ");
#endif
- for (i = 0; exec_args[i]; i++)
- fprintf(stderr, "%s'%s'",
- (debug == 2) ? "\n " : " ", exec_args[i]);
- fprintf(stderr, "\n");
- }
+ for (i = 0; exec_args[i]; i++)
+ fprintf(stderr, "%s'%s'",
+ (debug == 2) ? "\n " : " ", exec_args[i]);
+ fprintf(stderr, "\n");
}
#ifdef BR_CCACHE_HASH
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH] toolchain/wrapper: also dump args it was called with
2019-08-17 12:48 [Buildroot] [PATCH] toolchain/wrapper: also dump args it was called with Yann E. MORIN
@ 2019-08-17 18:25 ` Thomas De Schampheleire
2019-08-17 22:20 ` Thomas Petazzoni
1 sibling, 0 replies; 3+ messages in thread
From: Thomas De Schampheleire @ 2019-08-17 18:25 UTC (permalink / raw)
To: buildroot
El s?b., 17 ago. 2019 a las 14:48, Yann E. MORIN
(<yann.morin.1998@free.fr>) escribi?:
>
> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com>
> ---
> toolchain/toolchain-wrapper.c | 49 +++++++++++++++++++++--------------
> 1 file changed, 29 insertions(+), 20 deletions(-)
>
> diff --git a/toolchain/toolchain-wrapper.c b/toolchain/toolchain-wrapper.c
> index 7a4b9c4007..b7705a4cbf 100644
> --- a/toolchain/toolchain-wrapper.c
> +++ b/toolchain/toolchain-wrapper.c
> @@ -240,7 +240,24 @@ int main(int argc, char **argv)
> char *env_debug;
> char *paranoid_wrapper;
> int paranoid;
> - int ret, i, count = 0, debug, found_shared = 0;
> + int ret, i, count = 0, debug = 0, found_shared = 0;
> +
> + /* Debug the wrapper to see arguments it was called with.
> + * If environment variable BR2_DEBUG_WRAPPER is:
> + * unset, empty, or 0: do not trace
> + * set to 1 : trace all arguments on a single line
> + * set to 2 : trace one argument per line
> + */
> + if ((env_debug = getenv("BR2_DEBUG_WRAPPER"))) {
> + debug = atoi(env_debug);
> + }
> + if (debug > 0) {
> + fprintf(stderr, "Toolchain wrapper was called with:");
> + for (i = 0; i < argc; i++)
> + fprintf(stderr, "%s'%s'",
> + (debug == 2) ? "\n " : " ", argv[i]);
> + fprintf(stderr, "\n");
> + }
>
> /* Calculate the relative paths */
> basename = strrchr(progpath, '/');
> @@ -483,29 +500,21 @@ int main(int argc, char **argv)
> exec_args++;
> #endif
>
> - /* Debug the wrapper to see actual arguments passed to
> - * the compiler:
> - * unset, empty, or 0: do not trace
> - * set to 1 : trace all arguments on a single line
> - * set to 2 : trace one argument per line
> - */
> - if ((env_debug = getenv("BR2_DEBUG_WRAPPER"))) {
> - debug = atoi(env_debug);
> - if (debug > 0) {
> - fprintf(stderr, "Toolchain wrapper executing:");
> + /* Debug the wrapper to see final arguments passed to the real compiler. */
> + if (debug > 0) {
> + fprintf(stderr, "Toolchain wrapper executing:");
> #ifdef BR_CCACHE_HASH
> - fprintf(stderr, "%sCCACHE_COMPILERCHECK='string:" BR_CCACHE_HASH "'",
> - (debug == 2) ? "\n " : " ");
> + fprintf(stderr, "%sCCACHE_COMPILERCHECK='string:" BR_CCACHE_HASH "'",
> + (debug == 2) ? "\n " : " ");
> #endif
> #ifdef BR_CCACHE_BASEDIR
> - fprintf(stderr, "%sCCACHE_BASEDIR='" BR_CCACHE_BASEDIR "'",
> - (debug == 2) ? "\n " : " ");
> + fprintf(stderr, "%sCCACHE_BASEDIR='" BR_CCACHE_BASEDIR "'",
> + (debug == 2) ? "\n " : " ");
> #endif
> - for (i = 0; exec_args[i]; i++)
> - fprintf(stderr, "%s'%s'",
> - (debug == 2) ? "\n " : " ", exec_args[i]);
> - fprintf(stderr, "\n");
> - }
> + for (i = 0; exec_args[i]; i++)
> + fprintf(stderr, "%s'%s'",
> + (debug == 2) ? "\n " : " ", exec_args[i]);
> + fprintf(stderr, "\n");
> }
>
> #ifdef BR_CCACHE_HASH
Reviewed-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Tested-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH] toolchain/wrapper: also dump args it was called with
2019-08-17 12:48 [Buildroot] [PATCH] toolchain/wrapper: also dump args it was called with Yann E. MORIN
2019-08-17 18:25 ` Thomas De Schampheleire
@ 2019-08-17 22:20 ` Thomas Petazzoni
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2019-08-17 22:20 UTC (permalink / raw)
To: buildroot
On Sat, 17 Aug 2019 14:48:17 +0200
"Yann E. MORIN" <yann.morin.1998@free.fr> wrote:
> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com>
> ---
> toolchain/toolchain-wrapper.c | 49 +++++++++++++++++++++--------------
> 1 file changed, 29 insertions(+), 20 deletions(-)
Applied to next, thanks.
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-08-17 22:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-17 12:48 [Buildroot] [PATCH] toolchain/wrapper: also dump args it was called with Yann E. MORIN
2019-08-17 18:25 ` Thomas De Schampheleire
2019-08-17 22:20 ` Thomas Petazzoni
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.