[google]Pass --save-temps to the assembler (issue4436049)

Easwaran Raman eraman@google.com
Mon Apr 25 19:54:00 GMT 2011


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}";



More information about the Gcc-patches mailing list