* [Buildroot] [PATCH 1/2] toolchain/wrapper: add option to print one argument per line
@ 2013-09-05 18:24 Yann E. MORIN
2013-09-05 18:24 ` [Buildroot] [PATCH 2/2] docs/manual: crosstool-NG backend is deprecated Yann E. MORIN
2013-09-05 18:51 ` [Buildroot] [PATCH 1/2] toolchain/wrapper: add option to print one argument per line Thomas De Schampheleire
0 siblings, 2 replies; 7+ messages in thread
From: Yann E. MORIN @ 2013-09-05 18:24 UTC (permalink / raw)
To: buildroot
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
In case there are many arguments passed to the tools, the command line
can get very long, and difficult to parse visually.
For example, the Linux kernel passes a lot of arguments to gcc (at least
45, which gives 53 with our hard-coded args). Looking at such a command
line is daunting.
So, add the possibility to print each argument on its own line.
Also, enclose all args between single quotes, so the command line
can be safely copy-pasted without special chars (spaces, $) being
inrerpreted by the shell.
Add blurb about toolchain-wrapper to documentation at the same
time.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Acked-by: Luca Ceresoli <luca@lucaceresoli.net>
Tested-by: Luca Ceresoli <luca@lucaceresoli.net>
---
docs/manual/customize-toolchain.txt | 11 ++++++++++
.../toolchain-external/ext-toolchain-wrapper.c | 25 +++++++++++++++-------
2 files changed, 28 insertions(+), 8 deletions(-)
diff --git a/docs/manual/customize-toolchain.txt b/docs/manual/customize-toolchain.txt
index 811a6dc..587fccc 100644
--- a/docs/manual/customize-toolchain.txt
+++ b/docs/manual/customize-toolchain.txt
@@ -17,6 +17,17 @@ generate it.
It also requires to set the Buildroot settings according to the toolchain ones
(see xref:external-toolchain-backend[]).
+When using an external toolchain, Buildroot generates a wrapper program, that
+passes the appropriate options (accordingly to the configuration) to the
+external toolchain programs. In case you need to debug this wrapper, you can
+set the environment variable BR_DEBUG_WRAPPER to either one of:
+
+* +0+, empty or not set: no debug
+
+* +1+: trace all arguments on a single line
+
+* +2+: trace one argument per line
+
Using the internal Buildroot toolchain backend
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/toolchain/toolchain-external/ext-toolchain-wrapper.c b/toolchain/toolchain-external/ext-toolchain-wrapper.c
index 565e36b..dfdfcff 100644
--- a/toolchain/toolchain-external/ext-toolchain-wrapper.c
+++ b/toolchain/toolchain-external/ext-toolchain-wrapper.c
@@ -74,7 +74,8 @@ int main(int argc, char **argv)
char *relbasedir, *absbasedir;
char *progpath = argv[0];
char *basename;
- int ret, i, count = 0;
+ char *env_debug;
+ int ret, i, count = 0, debug;
/* Calculate the relative paths */
basename = strrchr(progpath, '/');
@@ -157,13 +158,21 @@ int main(int argc, char **argv)
/* finish with NULL termination */
*cur = NULL;
- if (getenv("BR_DEBUG_WRAPPER")) {
- fprintf(stderr, "Executing");
-
- for (i = 0; args[i]; i++)
- fprintf(stderr, " %s", args[i]);
-
- fprintf(stderr, "\n");
+ /* 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("BR_DEBUG_WRAPPER"))) {
+ debug = atoi(env_debug);
+ if (debug > 0) {
+ fprintf(stderr, "Toolchain wrapper executing:");
+ for (i = 0; args[i]; i++)
+ fprintf(stderr, "%s'%s'",
+ (debug == 2)?"\n ":" ", args[i]);
+ fprintf(stderr, "\n");
+ }
}
if (execv(path, args))
--
1.8.1.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [Buildroot] [PATCH 2/2] docs/manual: crosstool-NG backend is deprecated
2013-09-05 18:24 [Buildroot] [PATCH 1/2] toolchain/wrapper: add option to print one argument per line Yann E. MORIN
@ 2013-09-05 18:24 ` Yann E. MORIN
2013-09-05 18:51 ` [Buildroot] [PATCH 1/2] toolchain/wrapper: add option to print one argument per line Thomas De Schampheleire
1 sibling, 0 replies; 7+ messages in thread
From: Yann E. MORIN @ 2013-09-05 18:24 UTC (permalink / raw)
To: buildroot
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
Te crosstool-NG backend is deprecated.
Let it live one more cycle before we kill it for good, since the internal
backend has now gained the ability to build toolchains based on the three
C libraries that matter: uClibc, glibc and eglibc.
People that still want to use a crosstool-NG-built toolchain can do so
outside of Buildroot, and use the resulting toolchain with the external
toolchain backend.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
docs/manual/customize-toolchain.txt | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/docs/manual/customize-toolchain.txt b/docs/manual/customize-toolchain.txt
index 587fccc..3ffecfa 100644
--- a/docs/manual/customize-toolchain.txt
+++ b/docs/manual/customize-toolchain.txt
@@ -56,3 +56,8 @@ limited set of settings under the Buildroot +Toolchain+ menu:
* Gdb and some toolchain options
Then, the toolchain can be fine-tuned by invoking +make ctng-menuconfig+.
+
+*Note*: the crosstool-NG wrapper is deprecated. If you want to use
+http://crosstool-ng.org[crosstool-NG] to build your toolchain, please do
+so outside of Buildroot, and use the resulting toolchain as an external
+toolchain (see above).
--
1.8.1.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [Buildroot] [PATCH 1/2] toolchain/wrapper: add option to print one argument per line
2013-09-05 18:24 [Buildroot] [PATCH 1/2] toolchain/wrapper: add option to print one argument per line Yann E. MORIN
2013-09-05 18:24 ` [Buildroot] [PATCH 2/2] docs/manual: crosstool-NG backend is deprecated Yann E. MORIN
@ 2013-09-05 18:51 ` Thomas De Schampheleire
2013-09-06 9:39 ` Yann E. MORIN
1 sibling, 1 reply; 7+ messages in thread
From: Thomas De Schampheleire @ 2013-09-05 18:51 UTC (permalink / raw)
To: buildroot
On Thu, Sep 5, 2013 at 8:24 PM, Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> From: "Yann E. MORIN" <yann.morin.1998@free.fr>
>
> In case there are many arguments passed to the tools, the command line
> can get very long, and difficult to parse visually.
>
> For example, the Linux kernel passes a lot of arguments to gcc (at least
> 45, which gives 53 with our hard-coded args). Looking at such a command
> line is daunting.
>
> So, add the possibility to print each argument on its own line.
>
> Also, enclose all args between single quotes, so the command line
> can be safely copy-pasted without special chars (spaces, $) being
> inrerpreted by the shell.
>
> Add blurb about toolchain-wrapper to documentation at the same
> time.
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Acked-by: Luca Ceresoli <luca@lucaceresoli.net>
> Tested-by: Luca Ceresoli <luca@lucaceresoli.net>
> ---
> docs/manual/customize-toolchain.txt | 11 ++++++++++
> .../toolchain-external/ext-toolchain-wrapper.c | 25 +++++++++++++++-------
> 2 files changed, 28 insertions(+), 8 deletions(-)
>
> diff --git a/docs/manual/customize-toolchain.txt b/docs/manual/customize-toolchain.txt
> index 811a6dc..587fccc 100644
> --- a/docs/manual/customize-toolchain.txt
> +++ b/docs/manual/customize-toolchain.txt
> @@ -17,6 +17,17 @@ generate it.
> It also requires to set the Buildroot settings according to the toolchain ones
> (see xref:external-toolchain-backend[]).
>
> +When using an external toolchain, Buildroot generates a wrapper program, that
> +passes the appropriate options (accordingly to the configuration) to the
This should be 'according to ...'
The word accordingly is used in a sentence like: 'Buildroot reads the
configuration options and calls the external toolchain programs
accordingly'.
> +external toolchain programs. In case you need to debug this wrapper, you can
> +set the environment variable BR_DEBUG_WRAPPER to either one of:
> +
> +* +0+, empty or not set: no debug
> +
> +* +1+: trace all arguments on a single line
> +
> +* +2+: trace one argument per line
> +
> Using the internal Buildroot toolchain backend
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> diff --git a/toolchain/toolchain-external/ext-toolchain-wrapper.c b/toolchain/toolchain-external/ext-toolchain-wrapper.c
> index 565e36b..dfdfcff 100644
> --- a/toolchain/toolchain-external/ext-toolchain-wrapper.c
> +++ b/toolchain/toolchain-external/ext-toolchain-wrapper.c
> @@ -74,7 +74,8 @@ int main(int argc, char **argv)
> char *relbasedir, *absbasedir;
> char *progpath = argv[0];
> char *basename;
> - int ret, i, count = 0;
> + char *env_debug;
> + int ret, i, count = 0, debug;
>
> /* Calculate the relative paths */
> basename = strrchr(progpath, '/');
> @@ -157,13 +158,21 @@ int main(int argc, char **argv)
> /* finish with NULL termination */
> *cur = NULL;
>
> - if (getenv("BR_DEBUG_WRAPPER")) {
> - fprintf(stderr, "Executing");
> -
> - for (i = 0; args[i]; i++)
> - fprintf(stderr, " %s", args[i]);
> -
> - fprintf(stderr, "\n");
> + /* 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("BR_DEBUG_WRAPPER"))) {
> + debug = atoi(env_debug);
> + if (debug > 0) {
> + fprintf(stderr, "Toolchain wrapper executing:");
> + for (i = 0; args[i]; i++)
> + fprintf(stderr, "%s'%s'",
> + (debug == 2)?"\n ":" ", args[i]);
> + fprintf(stderr, "\n");
> + }
> }
>
> if (execv(path, args))
> --
> 1.8.1.2
>
Best regards,
Thomas
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Buildroot] [PATCH 1/2] toolchain/wrapper: add option to print one argument per line
2013-09-05 18:51 ` [Buildroot] [PATCH 1/2] toolchain/wrapper: add option to print one argument per line Thomas De Schampheleire
@ 2013-09-06 9:39 ` Yann E. MORIN
0 siblings, 0 replies; 7+ messages in thread
From: Yann E. MORIN @ 2013-09-06 9:39 UTC (permalink / raw)
To: buildroot
Thomas, All,
On 2013-09-05 20:51 +0200, Thomas De Schampheleire spake thusly:
> On Thu, Sep 5, 2013 at 8:24 PM, Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> > From: "Yann E. MORIN" <yann.morin.1998@free.fr>
> > +When using an external toolchain, Buildroot generates a wrapper program, that
> > +passes the appropriate options (accordingly to the configuration) to the
>
> This should be 'according to ...'
> The word accordingly is used in a sentence like: 'Buildroot reads the
> configuration options and calls the external toolchain programs
> accordingly'.
Yeah, yeah, right. :-) Will fix.
Thank you!
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Buildroot] [PATCH 1/2] toolchain/wrapper: add option to print one argument per line
2013-09-20 22:00 [Buildroot] [pull request] Pull request for branch yem/misc-updates Yann E. MORIN
@ 2013-09-20 22:00 ` Yann E. MORIN
2013-09-22 8:40 ` Samuel Martin
2013-09-23 7:34 ` Peter Korsgaard
0 siblings, 2 replies; 7+ messages in thread
From: Yann E. MORIN @ 2013-09-20 22:00 UTC (permalink / raw)
To: buildroot
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
In case there are many arguments passed to the tools, the command line
can get very long, and difficult to parse visually.
For example, the Linux kernel passes a lot of arguments to gcc (at least
45, which gives 53 with our hard-coded args). Looking at such a command
line is daunting.
So, add the possibility to print each argument on its own line.
Also, enclose all args between single quotes, so the command line
can be safely copy-pasted without special chars (spaces, $) being
inrerpreted by the shell.
Add blurb about toolchain-wrapper to documentation at the same
time.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com>
Acked-by: Luca Ceresoli <luca@lucaceresoli.net>
Tested-by: Luca Ceresoli <luca@lucaceresoli.net>
---
docs/manual/customize-toolchain.txt | 11 ++++++++++
.../toolchain-external/ext-toolchain-wrapper.c | 25 +++++++++++++++-------
2 files changed, 28 insertions(+), 8 deletions(-)
diff --git a/docs/manual/customize-toolchain.txt b/docs/manual/customize-toolchain.txt
index 811a6dc..82ecc28 100644
--- a/docs/manual/customize-toolchain.txt
+++ b/docs/manual/customize-toolchain.txt
@@ -17,6 +17,17 @@ generate it.
It also requires to set the Buildroot settings according to the toolchain ones
(see xref:external-toolchain-backend[]).
+When using an external toolchain, Buildroot generates a wrapper program, that
+passes the appropriate options (according to the configuration) to the
+external toolchain programs. In case you need to debug this wrapper, you can
+set the environment variable BR_DEBUG_WRAPPER to either one of:
+
+* +0+, empty or not set: no debug
+
+* +1+: trace all arguments on a single line
+
+* +2+: trace one argument per line
+
Using the internal Buildroot toolchain backend
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/toolchain/toolchain-external/ext-toolchain-wrapper.c b/toolchain/toolchain-external/ext-toolchain-wrapper.c
index 565e36b..dfdfcff 100644
--- a/toolchain/toolchain-external/ext-toolchain-wrapper.c
+++ b/toolchain/toolchain-external/ext-toolchain-wrapper.c
@@ -74,7 +74,8 @@ int main(int argc, char **argv)
char *relbasedir, *absbasedir;
char *progpath = argv[0];
char *basename;
- int ret, i, count = 0;
+ char *env_debug;
+ int ret, i, count = 0, debug;
/* Calculate the relative paths */
basename = strrchr(progpath, '/');
@@ -157,13 +158,21 @@ int main(int argc, char **argv)
/* finish with NULL termination */
*cur = NULL;
- if (getenv("BR_DEBUG_WRAPPER")) {
- fprintf(stderr, "Executing");
-
- for (i = 0; args[i]; i++)
- fprintf(stderr, " %s", args[i]);
-
- fprintf(stderr, "\n");
+ /* 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("BR_DEBUG_WRAPPER"))) {
+ debug = atoi(env_debug);
+ if (debug > 0) {
+ fprintf(stderr, "Toolchain wrapper executing:");
+ for (i = 0; args[i]; i++)
+ fprintf(stderr, "%s'%s'",
+ (debug == 2)?"\n ":" ", args[i]);
+ fprintf(stderr, "\n");
+ }
}
if (execv(path, args))
--
1.8.1.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [Buildroot] [PATCH 1/2] toolchain/wrapper: add option to print one argument per line
2013-09-20 22:00 ` [Buildroot] [PATCH 1/2] toolchain/wrapper: add option to print one argument per line Yann E. MORIN
@ 2013-09-22 8:40 ` Samuel Martin
2013-09-23 7:34 ` Peter Korsgaard
1 sibling, 0 replies; 7+ messages in thread
From: Samuel Martin @ 2013-09-22 8:40 UTC (permalink / raw)
To: buildroot
2013/9/21 Yann E. MORIN <yann.morin.1998@free.fr>
> From: "Yann E. MORIN" <yann.morin.1998@free.fr>
>
> In case there are many arguments passed to the tools, the command line
> can get very long, and difficult to parse visually.
>
> For example, the Linux kernel passes a lot of arguments to gcc (at least
> 45, which gives 53 with our hard-coded args). Looking at such a command
> line is daunting.
>
> So, add the possibility to print each argument on its own line.
>
> Also, enclose all args between single quotes, so the command line
> can be safely copy-pasted without special chars (spaces, $) being
> inrerpreted by the shell.
>
> Add blurb about toolchain-wrapper to documentation at the same
> time.
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com>
> Acked-by: Luca Ceresoli <luca@lucaceresoli.net>
> Tested-by: Luca Ceresoli <luca@lucaceresoli.net>
>
Acked-by: Samuel Martin <s.martin49@gmail.com>
> ---
> docs/manual/customize-toolchain.txt | 11 ++++++++++
> .../toolchain-external/ext-toolchain-wrapper.c | 25
> +++++++++++++++-------
> 2 files changed, 28 insertions(+), 8 deletions(-)
>
> diff --git a/docs/manual/customize-toolchain.txt
> b/docs/manual/customize-toolchain.txt
> index 811a6dc..82ecc28 100644
> --- a/docs/manual/customize-toolchain.txt
> +++ b/docs/manual/customize-toolchain.txt
> @@ -17,6 +17,17 @@ generate it.
> It also requires to set the Buildroot settings according to the toolchain
> ones
> (see xref:external-toolchain-backend[]).
>
> +When using an external toolchain, Buildroot generates a wrapper program,
> that
> +passes the appropriate options (according to the configuration) to the
> +external toolchain programs. In case you need to debug this wrapper, you
> can
> +set the environment variable BR_DEBUG_WRAPPER to either one of:
> +
> +* +0+, empty or not set: no debug
> +
> +* +1+: trace all arguments on a single line
> +
> +* +2+: trace one argument per line
> +
> Using the internal Buildroot toolchain backend
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> diff --git a/toolchain/toolchain-external/ext-toolchain-wrapper.c
> b/toolchain/toolchain-external/ext-toolchain-wrapper.c
> index 565e36b..dfdfcff 100644
> --- a/toolchain/toolchain-external/ext-toolchain-wrapper.c
> +++ b/toolchain/toolchain-external/ext-toolchain-wrapper.c
> @@ -74,7 +74,8 @@ int main(int argc, char **argv)
> char *relbasedir, *absbasedir;
> char *progpath = argv[0];
> char *basename;
> - int ret, i, count = 0;
> + char *env_debug;
> + int ret, i, count = 0, debug;
>
> /* Calculate the relative paths */
> basename = strrchr(progpath, '/');
> @@ -157,13 +158,21 @@ int main(int argc, char **argv)
> /* finish with NULL termination */
> *cur = NULL;
>
> - if (getenv("BR_DEBUG_WRAPPER")) {
> - fprintf(stderr, "Executing");
> -
> - for (i = 0; args[i]; i++)
> - fprintf(stderr, " %s", args[i]);
> -
> - fprintf(stderr, "\n");
> + /* 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("BR_DEBUG_WRAPPER"))) {
> + debug = atoi(env_debug);
> + if (debug > 0) {
> + fprintf(stderr, "Toolchain wrapper executing:");
> + for (i = 0; args[i]; i++)
> + fprintf(stderr, "%s'%s'",
> + (debug == 2)?"\n ":" ",
> args[i]);
> + fprintf(stderr, "\n");
> + }
> }
>
> if (execv(path, args))
> --
> 1.8.1.2
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
>
Regards,
--
Samuel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20130922/d5df1064/attachment.html>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Buildroot] [PATCH 1/2] toolchain/wrapper: add option to print one argument per line
2013-09-20 22:00 ` [Buildroot] [PATCH 1/2] toolchain/wrapper: add option to print one argument per line Yann E. MORIN
2013-09-22 8:40 ` Samuel Martin
@ 2013-09-23 7:34 ` Peter Korsgaard
1 sibling, 0 replies; 7+ messages in thread
From: Peter Korsgaard @ 2013-09-23 7:34 UTC (permalink / raw)
To: buildroot
>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:
Yann> From: "Yann E. MORIN" <yann.morin.1998@free.fr>
Yann> In case there are many arguments passed to the tools, the command line
Yann> can get very long, and difficult to parse visually.
Yann> For example, the Linux kernel passes a lot of arguments to gcc (at least
Yann> 45, which gives 53 with our hard-coded args). Looking at such a command
Yann> line is daunting.
Yann> So, add the possibility to print each argument on its own line.
Yann> Also, enclose all args between single quotes, so the command line
Yann> can be safely copy-pasted without special chars (spaces, $) being
Yann> inrerpreted by the shell.
Yann> Add blurb about toolchain-wrapper to documentation at the same
Yann> time.
Committed with minor code style changes, thanks.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-09-23 7:34 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-05 18:24 [Buildroot] [PATCH 1/2] toolchain/wrapper: add option to print one argument per line Yann E. MORIN
2013-09-05 18:24 ` [Buildroot] [PATCH 2/2] docs/manual: crosstool-NG backend is deprecated Yann E. MORIN
2013-09-05 18:51 ` [Buildroot] [PATCH 1/2] toolchain/wrapper: add option to print one argument per line Thomas De Schampheleire
2013-09-06 9:39 ` Yann E. MORIN
-- strict thread matches above, loose matches on Subject: below --
2013-09-20 22:00 [Buildroot] [pull request] Pull request for branch yem/misc-updates Yann E. MORIN
2013-09-20 22:00 ` [Buildroot] [PATCH 1/2] toolchain/wrapper: add option to print one argument per line Yann E. MORIN
2013-09-22 8:40 ` Samuel Martin
2013-09-23 7:34 ` Peter Korsgaard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox