public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [google]Pass --save-temps to the assembler (issue4436049)
@ 2011-04-19 19:32 Easwaran Raman
  2011-04-19 19:47 ` Diego Novillo
  2011-04-21 20:42 ` Michael Meissner
  0 siblings, 2 replies; 10+ messages in thread
From: Easwaran Raman @ 2011-04-19 19:32 UTC (permalink / raw)
  To: reply, dnovillo, gcc-patches

This makes the gcc driver pass the --save-temps option to the assembler or assembler wrapper so that post-assembly tools like MAO can be integrated. Bootstraps on x86_64. Ok for google/main?

2011-04-19  Easwaran Raman  <eraman@google.com>

	* gcc/gcc.c (static const char *asm_options): Pass
	--save-temps to the assembler.

Index: gcc/gcc.c
===================================================================
--- gcc/gcc.c	(revision 172727)
+++ gcc/gcc.c	(working copy)
@@ -780,7 +780,7 @@ static const char *asm_options =
 #if HAVE_GNU_AS
 /* If GNU AS is used, then convert -w (no warnings), -I, and -v
    to the assembler equivalents.  */
-"%{v} %{w:-W} %{I*} "
+"%{v} %{w:-W} %{I*} %{save-temps:--save-temps} "
 #endif
 "%a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}";
 

--
This patch is available for review at http://codereview.appspot.com/4436049

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [google]Pass --save-temps to the assembler (issue4436049)
  2011-04-19 19:32 [google]Pass --save-temps to the assembler (issue4436049) Easwaran Raman
@ 2011-04-19 19:47 ` Diego Novillo
  2011-04-19 20:11   ` Easwaran Raman
  2011-04-20  4:31   ` Easwaran Raman
  2011-04-21 20:42 ` Michael Meissner
  1 sibling, 2 replies; 10+ messages in thread
From: Diego Novillo @ 2011-04-19 19:47 UTC (permalink / raw)
  To: Easwaran Raman; +Cc: reply, gcc-patches

On Tue, Apr 19, 2011 at 15:02, Easwaran Raman <eraman@google.com> wrote:
> This makes the gcc driver pass the --save-temps option to the assembler or assembler wrapper so that post-assembly tools like MAO can be integrated. Bootstraps on x86_64. Ok for google/main?
>
> 2011-04-19  Easwaran Raman  <eraman@google.com>
>
>        * gcc/gcc.c (static const char *asm_options): Pass

No need to specify 'static const char *'.  Just 'asm_options'.

>        --save-temps to the assembler.

Could you add a comment stating what version of binutils we need to use this?

I will commit this patch for you.  Given that you will be sending
other patches, please fill in the write access form at
http://sourceware.org/cgi-bin/pdw/ps_form.cgi


Diego.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [google]Pass --save-temps to the assembler (issue4436049)
  2011-04-19 19:47 ` Diego Novillo
@ 2011-04-19 20:11   ` Easwaran Raman
  2011-04-20  4:31   ` Easwaran Raman
  1 sibling, 0 replies; 10+ messages in thread
From: Easwaran Raman @ 2011-04-19 20:11 UTC (permalink / raw)
  To: Diego Novillo; +Cc: reply, gcc-patches

On Tue, Apr 19, 2011 at 12:19 PM, Diego Novillo <dnovillo@google.com> wrote:
> On Tue, Apr 19, 2011 at 15:02, Easwaran Raman <eraman@google.com> wrote:
>> This makes the gcc driver pass the --save-temps option to the assembler or assembler wrapper so that post-assembly tools like MAO can be integrated. Bootstraps on x86_64. Ok for google/main?
>>
>> 2011-04-19  Easwaran Raman  <eraman@google.com>
>>
>>        * gcc/gcc.c (static const char *asm_options): Pass
>
> No need to specify 'static const char *'.  Just 'asm_options'.
>
>>        --save-temps to the assembler.
>
> Could you add a comment stating what version of binutils we need to use this?
This is to work with the assembler wrapper that has to know whether to
save the assembly file after running any post-assembly tools like MAO.

> I will commit this patch for you.  Given that you will be sending
> other patches, please fill in the write access form at
> http://sourceware.org/cgi-bin/pdw/ps_form.cgi
>
>
> Diego.
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [google]Pass --save-temps to the assembler (issue4436049)
  2011-04-19 19:47 ` Diego Novillo
  2011-04-19 20:11   ` Easwaran Raman
@ 2011-04-20  4:31   ` Easwaran Raman
  2011-04-20 15:13     ` Diego Novillo
  1 sibling, 1 reply; 10+ messages in thread
From: Easwaran Raman @ 2011-04-20  4:31 UTC (permalink / raw)
  To: Diego Novillo; +Cc: reply, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1000 bytes --]

On Tue, Apr 19, 2011 at 12:19 PM, Diego Novillo <dnovillo@google.com> wrote:
> On Tue, Apr 19, 2011 at 15:02, Easwaran Raman <eraman@google.com> wrote:
>> This makes the gcc driver pass the --save-temps option to the assembler or assembler wrapper so that post-assembly tools like MAO can be integrated. Bootstraps on x86_64. Ok for google/main?
>>
>> 2011-04-19  Easwaran Raman  <eraman@google.com>
>>
>>        * gcc/gcc.c (static const char *asm_options): Pass
>
> No need to specify 'static const char *'.  Just 'asm_options'.
>
>>        --save-temps to the assembler.
>
> Could you add a comment stating what version of binutils we need to use this?
>
> I will commit this patch for you.  Given that you will be sending
> other patches, please fill in the write access form at
> http://sourceware.org/cgi-bin/pdw/ps_form.cgi
>
>
> Diego.
>

The revised patch has a comment that this should be used with an
assembler wrapper that can recognize --save-temps.

-Easwaran

[-- Attachment #2: driver.patch --]
[-- Type: text/x-patch, Size: 1014 bytes --]

2011-04-19  Easwaran Raman  <eraman@google.com>

	* gcc/gcc.c (asm_options): Pass --save-temps to assembler.

Index: gcc/gcc.c
===================================================================
--- gcc/gcc.c	(revision 172727)
+++ gcc/gcc.c	(working copy)
@@ -775,12 +775,16 @@ static const char *cc1_options =
  %{fmudflap|fmudflapth:-fno-builtin -fno-merge-constants}\
  %{coverage:-fprofile-arcs -ftest-coverage}";
 
+/* If an assembler wrapper is used to invoke post-assembly tools
+   like MAO, --save-temps need to be passed to save the output of
+   such post-processing tools. This is not compatible with vanilla
+   binutils gas which does not recognize --save-temps.  */
 static const char *asm_options =
 "%{-target-help:%:print-asm-header()} "
 #if HAVE_GNU_AS
 /* If GNU AS is used, then convert -w (no warnings), -I, and -v
    to the assembler equivalents.  */
-"%{v} %{w:-W} %{I*} "
+"%{v} %{w:-W} %{I*} %{save-temps:--save-temps} "
 #endif
 "%a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}";
 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [google]Pass --save-temps to the assembler (issue4436049)
  2011-04-20  4:31   ` Easwaran Raman
@ 2011-04-20 15:13     ` Diego Novillo
  0 siblings, 0 replies; 10+ messages in thread
From: Diego Novillo @ 2011-04-20 15:13 UTC (permalink / raw)
  To: Easwaran Raman; +Cc: reply, gcc-patches

On Tue, Apr 19, 2011 at 20:32, Easwaran Raman <eraman@google.com> wrote:

> The revised patch has a comment that this should be used with an
> assembler wrapper that can recognize --save-temps.

Thanks.  Will commit after testing finishes.


Diego.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [google]Pass --save-temps to the assembler (issue4436049)
  2011-04-19 19:32 [google]Pass --save-temps to the assembler (issue4436049) Easwaran Raman
  2011-04-19 19:47 ` Diego Novillo
@ 2011-04-21 20:42 ` Michael Meissner
  2011-04-21 22:55   ` Easwaran Raman
  1 sibling, 1 reply; 10+ messages in thread
From: Michael Meissner @ 2011-04-21 20:42 UTC (permalink / raw)
  To: Easwaran Raman; +Cc: reply, dnovillo, gcc-patches

On Tue, Apr 19, 2011 at 12:02:08PM -0700, Easwaran Raman wrote:
> This makes the gcc driver pass the --save-temps option to the assembler or assembler wrapper so that post-assembly tools like MAO can be integrated. Bootstraps on x86_64. Ok for google/main?
> 
> 2011-04-19  Easwaran Raman  <eraman@google.com>
> 
> 	* gcc/gcc.c (static const char *asm_options): Pass
> 	--save-temps to the assembler.
> 
> Index: gcc/gcc.c
> ===================================================================
> --- gcc/gcc.c	(revision 172727)
> +++ gcc/gcc.c	(working copy)
> @@ -780,7 +780,7 @@ static const char *asm_options =
>  #if HAVE_GNU_AS
>  /* If GNU AS is used, then convert -w (no warnings), -I, and -v
>     to the assembler equivalents.  */
> -"%{v} %{w:-W} %{I*} "
> +"%{v} %{w:-W} %{I*} %{save-temps:--save-temps} "
>  #endif
>  "%a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}";

This patch should also support -save-temps=obj.

-- 
Michael Meissner, IBM
5 Technology Place Drive, M/S 2757, Westford, MA 01886-3141, USA
meissner@linux.vnet.ibm.com	fax +1 (978) 399-6899

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [google]Pass --save-temps to the assembler (issue4436049)
  2011-04-21 20:42 ` Michael Meissner
@ 2011-04-21 22:55   ` Easwaran Raman
  2011-04-21 23:00     ` Andrew Pinski
  0 siblings, 1 reply; 10+ messages in thread
From: Easwaran Raman @ 2011-04-21 22:55 UTC (permalink / raw)
  To: Michael Meissner, Easwaran Raman, reply, dnovillo, gcc-patches

On Thu, Apr 21, 2011 at 12:07 PM, Michael Meissner
<meissner@linux.vnet.ibm.com> wrote:
> On Tue, Apr 19, 2011 at 12:02:08PM -0700, Easwaran Raman wrote:
>> This makes the gcc driver pass the --save-temps option to the assembler or assembler wrapper so that post-assembly tools like MAO can be integrated. Bootstraps on x86_64. Ok for google/main?
>>
>> 2011-04-19  Easwaran Raman  <eraman@google.com>
>>
>>       * gcc/gcc.c (static const char *asm_options): Pass
>>       --save-temps to the assembler.
>>
>> Index: gcc/gcc.c
>> ===================================================================
>> --- gcc/gcc.c (revision 172727)
>> +++ gcc/gcc.c (working copy)
>> @@ -780,7 +780,7 @@ static const char *asm_options =
>>  #if HAVE_GNU_AS
>>  /* If GNU AS is used, then convert -w (no warnings), -I, and -v
>>     to the assembler equivalents.  */
>> -"%{v} %{w:-W} %{I*} "
>> +"%{v} %{w:-W} %{I*} %{save-temps:--save-temps} "
>>  #endif
>>  "%a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}";
>
> This patch should also support -save-temps=obj.
>
When using gcc with a post-assembly tool, we use a wrapper that
invokes the tool and needs to know if the tool's output (another
assembly file) needs to be saved. The wrapper doesn't generate any
additional .o files and hence doesn't need to know whether the obj
file is to be saved (which is done by the driver). Why do we need to
pass -save-temps=obj in that case?

-Easwaran


> --
> Michael Meissner, IBM
> 5 Technology Place Drive, M/S 2757, Westford, MA 01886-3141, USA
> meissner@linux.vnet.ibm.com     fax +1 (978) 399-6899
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [google]Pass --save-temps to the assembler (issue4436049)
  2011-04-21 22:55   ` Easwaran Raman
@ 2011-04-21 23:00     ` Andrew Pinski
  2011-04-25 19:54       ` Easwaran Raman
  0 siblings, 1 reply; 10+ messages in thread
From: Andrew Pinski @ 2011-04-21 23:00 UTC (permalink / raw)
  To: Easwaran Raman; +Cc: Michael Meissner, reply, dnovillo, gcc-patches

On Thu, Apr 21, 2011 at 3:18 PM, Easwaran Raman <eraman@google.com> wrote:
> When using gcc with a post-assembly tool, we use a wrapper that
> invokes the tool and needs to know if the tool's output (another
> assembly file) needs to be saved. The wrapper doesn't generate any
> additional .o files and hence doesn't need to know whether the obj
> file is to be saved (which is done by the driver). Why do we need to
> pass -save-temps=obj in that case?

-save-temps=obj means place the save temps in the same directory as
the object file would be put rather than the current directory.

Thanks,
Andrew Pinski

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [google]Pass --save-temps to the assembler (issue4436049)
  2011-04-21 23:00     ` Andrew Pinski
@ 2011-04-25 19:54       ` Easwaran Raman
  2011-04-26 13:07         ` Diego Novillo
  0 siblings, 1 reply; 10+ messages in thread
From: Easwaran Raman @ 2011-04-25 19:54 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: Michael Meissner, reply, dnovillo, gcc-patches

On Thu, Apr 21, 2011 at 3:20 PM, Andrew Pinski <pinskia@gmail.com> wrote:
> On Thu, Apr 21, 2011 at 3:18 PM, Easwaran Raman <eraman@google.com> wrote:
>> When using gcc with a post-assembly tool, we use a wrapper that
>> invokes the tool and needs to know if the tool's output (another
>> assembly file) needs to be saved. The wrapper doesn't generate any
>> additional .o files and hence doesn't need to know whether the obj
>> file is to be saved (which is done by the driver). Why do we need to
>> pass -save-temps=obj in that case?
>
> -save-temps=obj means place the save temps in the same directory as
> the object file would be put rather than the current directory.
>
> Thanks,
> Andrew Pinski
>
Sorry, I misunderstood that option. Is the following patch ok?
Configured with --with-gnu-as option, verified that it bootstraps and
gcc passes --save-temps to 'as' when run with -save-temps=obj.
Diego, OK for google/main?

-Easwaran

2011-04-25  Easwaran Raman  <eraman@google.com>

	* gcc/gcc.c (asm_options): Pass --save-temps to assembler
	when invoked with -save-temps= option.

Index: gcc/gcc.c
===================================================================
--- gcc/gcc.c	(revision 172932)
+++ gcc/gcc.c	(working copy)
@@ -784,7 +784,7 @@ static const char *asm_options =
 #if HAVE_GNU_AS
 /* If GNU AS is used, then convert -w (no warnings), -I, and -v
    to the assembler equivalents.  */
-"%{v} %{w:-W} %{I*} %{save-temps:--save-temps} "
+"%{v} %{w:-W} %{I*} %{save-temps*:--save-temps} "
 #endif
 "%a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}";

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [google]Pass --save-temps to the assembler (issue4436049)
  2011-04-25 19:54       ` Easwaran Raman
@ 2011-04-26 13:07         ` Diego Novillo
  0 siblings, 0 replies; 10+ messages in thread
From: Diego Novillo @ 2011-04-26 13:07 UTC (permalink / raw)
  To: Easwaran Raman; +Cc: Andrew Pinski, Michael Meissner, reply, gcc-patches

On Mon, Apr 25, 2011 at 15:00, Easwaran Raman <eraman@google.com> wrote:

> 2011-04-25  Easwaran Raman  <eraman@google.com>
>
>        * gcc/gcc.c (asm_options): Pass --save-temps to assembler
>        when invoked with -save-temps= option.

OK.


Diego.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2011-04-26 12:59 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-19 19:32 [google]Pass --save-temps to the assembler (issue4436049) Easwaran Raman
2011-04-19 19:47 ` Diego Novillo
2011-04-19 20:11   ` Easwaran Raman
2011-04-20  4:31   ` Easwaran Raman
2011-04-20 15:13     ` Diego Novillo
2011-04-21 20:42 ` Michael Meissner
2011-04-21 22:55   ` Easwaran Raman
2011-04-21 23:00     ` Andrew Pinski
2011-04-25 19:54       ` Easwaran Raman
2011-04-26 13:07         ` Diego Novillo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).