public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: -Wp,<options>
       [not found] <20021101022336.GB8186@redhat.com>
@ 2002-11-01 14:20 ` Devang Patel
  2002-11-01 15:20   ` -Wp,<options> Fergus Henderson
  2002-11-03 15:31   ` -Wp,<options> Richard Henderson
  0 siblings, 2 replies; 5+ messages in thread
From: Devang Patel @ 2002-11-01 14:20 UTC (permalink / raw)
  To: Richard Henderson; +Cc: gcc

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


On Thursday, October 31, 2002, at 06:23  PM, Richard Henderson wrote:

> On Thu, Oct 31, 2002 at 03:43:02PM -0800, Devang Patel wrote:
>> Is it good idea to have corresponding options for -Wp and -Wa ?
>
> *shrug*  I suppose that wouldn't be unreasonable.

Bootstrapped on powerpc-apple-darwin6.0. Running tests right now.
OK to commit if everything goes fine?

Thanks,
-Devang

2002-11-1  Devang Patel <dpatel@apple.com>
	* gcc.c (display_help): Two new options -Xpreprocessor and
	-Xassembler
	(process_command): Same.
	* doc/invoke.texi: Info about these two new options.


[-- Attachment #2: 2858091.diff --]
[-- Type: application/octet-stream, Size: 5291 bytes --]

Index: gcc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gcc.c,v
retrieving revision 1.344
diff -Idpatel.pbxuser -c -3 -p -r1.344 gcc.c
*** gcc.c	14 Oct 2002 07:15:38 -0000	1.344
--- gcc.c	1 Nov 2002 22:05:23 -0000
*************** translate_options (argcp, argvp)
*** 1206,1211 ****
--- 1207,1216 ----
  	    nskip += 1;
  	  else if (! strcmp (p, "Xlinker"))
  	    nskip += 1;
+ 	  else if (! strcmp (p, "Xpreprocessor"))
+ 	    nskip += 1;
+ 	  else if (! strcmp (p, "Xassembler"))
+ 	    nskip += 1;
  
  	  /* Watch out for an option at the end of the command line that
  	     is missing arguments, and avoid skipping past the end of the
*************** display_help ()
*** 3100,3105 ****
--- 3105,3112 ----
    fputs (_("  -print-multi-os-directory Display the relative path to OS libraries\n"), stdout);
    fputs (_("  -Wa,<options>            Pass comma-separated <options> on to the assembler\n"), stdout);
    fputs (_("  -Wp,<options>            Pass comma-separated <options> on to the preprocessor\n"), stdout);
+   fputs (_("  -Xassembler <arg>        Pass <arg> on to the assembler\n"), stdout);
+   fputs (_("  -Xpreprocessor <arg>     Pass <arg> on to the preprocessor\n"), stdout);
    fputs (_("  -Wl,<options>            Pass comma-separated <options> on to the linker\n"), stdout);
    fputs (_("  -Xlinker <arg>           Pass <arg> on to the linker\n"), stdout);
    fputs (_("  -save-temps              Do not delete intermediate files\n"), stdout);
*************** warranty; not even for MERCHANTABILITY o
*** 3566,3571 ****
--- 3572,3591 ----
  	  n_infiles++;
  	  i++;
  	}
+       else if (strcmp (argv[i], "-Xpreprocessor") == 0)
+ 	{
+ 	  if (i + 1 == argc)
+ 	    fatal ("argument to `-Xpreprocessor' is missing");
+ 
+ 	  add_preprocessor_option (argv[i+1], strlen (argv[i+1]));
+ 	}
+       else if (strcmp (argv[i], "-Xassembler") == 0)
+ 	{
+ 	  if (i + 1 == argc)
+ 	    fatal ("argument to `-Xassembler' is missing");
+ 
+ 	  add_assembler_option (argv[i+1], strlen (argv[i+1]));
+ 	}
        else if (strcmp (argv[i], "-l") == 0)
  	{
  	  if (i + 1 == argc)
*************** warranty; not even for MERCHANTABILITY o
*** 3960,3965 ****
--- 3980,3995 ----
  	  infiles[n_infiles++].name = argv[i] + prev;
  	}
        else if (strcmp (argv[i], "-Xlinker") == 0)
+ 	{
+ 	  infiles[n_infiles].language = "*";
+ 	  infiles[n_infiles++].name = argv[++i];
+ 	}
+       else if (strcmp (argv[i], "-Xassembler") == 0)
+ 	{
+ 	  infiles[n_infiles].language = "*";
+ 	  infiles[n_infiles++].name = argv[++i];
+ 	}
+       else if (strcmp (argv[i], "-Xpreprocessor") == 0)
  	{
  	  infiles[n_infiles].language = "*";
  	  infiles[n_infiles++].name = argv[++i];
Index: doc/invoke.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/invoke.texi,v
retrieving revision 1.196
diff -Idpatel.pbxuser -c -3 -p -r1.196 invoke.texi
*** doc/invoke.texi	20 Oct 2002 19:18:30 -0000	1.196
--- doc/invoke.texi	1 Nov 2002 22:05:24 -0000
*************** in the following sections.
*** 305,316 ****
  -iprefix @var{file}  -iwithprefix @var{dir} @gol
  -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
  -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  -P  -remap @gol
! -trigraphs  -undef  -U@var{macro}  -Wp,@var{option}}
  
  @item Assembler Option
  @xref{Assembler Options,,Passing Options to the Assembler}.
  @gccoptlist{
! -Wa,@var{option}}
  
  @item Linker Options
  @xref{Link Options,,Options for Linking}.
--- 305,316 ----
  -iprefix @var{file}  -iwithprefix @var{dir} @gol
  -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
  -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  -P  -remap @gol
! -trigraphs  -undef  -U@var{macro}  -Wp,@var{option} -Xpreprocessor @var{option}}
  
  @item Assembler Option
  @xref{Assembler Options,,Passing Options to the Assembler}.
  @gccoptlist{
! -Wa,@var{option} -Xassembler @var{option}}
  
  @item Linker Options
  @xref{Link Options,,Options for Linking}.
*************** interface is undocumented and subject to
*** 4259,4264 ****
--- 4260,4274 ----
  you should avoid using @option{-Wp} and let the driver handle the
  options instead.
  
+ @item -Xpreprocessor @var{option}
+ @opindex preprocessor
+ Pass @var{option} as an option to the preprocessor.  You can use this to
+ supply system-specific preprocessor options which GCC does not know how to
+ recognize.
+ 
+ If you want to pass an option that takes an argument, you must use
+ @option{-Xpreprocessor} twice, once for the option and once for the argument.
+ 
  @include cppopts.texi
  
  @node Assembler Options
*************** You can pass options to the assembler.
*** 4272,4277 ****
--- 4282,4297 ----
  @opindex Wa
  Pass @var{option} as an option to the assembler.  If @var{option}
  contains commas, it is split into multiple options at the commas.
+ 
+ @item -Xassembler @var{option}
+ @opindex Xassembler
+ Pass @var{option} as an option to the assembler.  You can use this to
+ supply system-specific assembler options which GCC does not know how to
+ recognize.
+ 
+ If you want to pass an option that takes an argument, you must use
+ @option{-Xassembler} twice, once for the option and once for the argument.
+ 
  @end table
  
  @node Link Options

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

* Re: -Wp,<options>
  2002-11-01 14:20 ` -Wp,<options> Devang Patel
@ 2002-11-01 15:20   ` Fergus Henderson
  2002-11-01 15:46     ` -Wp,<options> Devang Patel
  2002-11-03 15:31   ` -Wp,<options> Richard Henderson
  1 sibling, 1 reply; 5+ messages in thread
From: Fergus Henderson @ 2002-11-01 15:20 UTC (permalink / raw)
  To: Devang Patel; +Cc: gcc

> Index: gcc.c
> ...
> --- 3105,3112 ----
>     fputs (_("  -print-multi-os-directory Display the relative path to OS libraries\n"), stdout);
>     fputs (_("  -Wa,<options>            Pass comma-separated <options> on to the assembler\n"), stdout);
>     fputs (_("  -Wp,<options>            Pass comma-separated <options> on to the preprocessor\n"), stdout);
> +   fputs (_("  -Xassembler <arg>        Pass <arg> on to the assembler\n"), stdout);
> +   fputs (_("  -Xpreprocessor <arg>     Pass <arg> on to the preprocessor\n"), stdout);
>     fputs (_("  -Wl,<options>            Pass comma-separated <options> on to the linker\n"), stdout);
>     fputs (_("  -Xlinker <arg>           Pass <arg> on to the linker\n"), stdout);
>     fputs (_("  -save-temps              Do not delete intermediate files\n"), stdout);

The ordering here is inconsistent.
Probably it's best if all the -X options are adjacent,
and in the same order as the corresponding -W[apl] options.

-- 
Fergus Henderson <fjh@cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.

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

* Re: -Wp,<options>
  2002-11-01 15:20   ` -Wp,<options> Fergus Henderson
@ 2002-11-01 15:46     ` Devang Patel
  0 siblings, 0 replies; 5+ messages in thread
From: Devang Patel @ 2002-11-01 15:46 UTC (permalink / raw)
  To: Fergus Henderson; +Cc: gcc


On Friday, November 1, 2002, at 03:20  PM, Fergus Henderson wrote:

>> Index: gcc.c
>> ...
>> --- 3105,3112 ----
>>     fputs (_("  -print-multi-os-directory Display the relative path 
>> to OS libraries\n"), stdout);
>>     fputs (_("  -Wa,<options>            Pass comma-separated 
>> <options> on to the assembler\n"), stdout);
>>     fputs (_("  -Wp,<options>            Pass comma-separated 
>> <options> on to the preprocessor\n"), stdout);
>> +   fputs (_("  -Xassembler <arg>        Pass <arg> on to the 
>> assembler\n"), stdout);
>> +   fputs (_("  -Xpreprocessor <arg>     Pass <arg> on to the 
>> preprocessor\n"), stdout);
>>     fputs (_("  -Wl,<options>            Pass comma-separated 
>> <options> on to the linker\n"), stdout);
>>     fputs (_("  -Xlinker <arg>           Pass <arg> on to the 
>> linker\n"), stdout);
>>     fputs (_("  -save-temps              Do not delete intermediate 
>> files\n"), stdout);
>
> The ordering here is inconsistent.
> Probably it's best if all the -X options are adjacent,
> and in the same order as the corresponding -W[apl] options.

I will make the change.
OK otherwise ?

-Devang

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

* Re: -Wp,<options>
  2002-11-01 14:20 ` -Wp,<options> Devang Patel
  2002-11-01 15:20   ` -Wp,<options> Fergus Henderson
@ 2002-11-03 15:31   ` Richard Henderson
  1 sibling, 0 replies; 5+ messages in thread
From: Richard Henderson @ 2002-11-03 15:31 UTC (permalink / raw)
  To: Devang Patel; +Cc: gcc

On Fri, Nov 01, 2002 at 02:18:18PM -0800, Devang Patel wrote:
> 	* gcc.c (display_help): Two new options -Xpreprocessor and
> 	-Xassembler
> 	(process_command): Same.
> 	* doc/invoke.texi: Info about these two new options.

Ok.


r~

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

* -Wp,<options>
@ 2002-10-31 17:06 Devang Patel
  0 siblings, 0 replies; 5+ messages in thread
From: Devang Patel @ 2002-10-31 17:06 UTC (permalink / raw)
  To: gcc

-Wp,<options> allows to pass comma-separated <options> on to the 
preprocessor.
One of the preprocessor option can be filename. And filename can contain
','. Right now, driver breaks filename with comma in two separate 
options.

What is the best way to escape comma in this situation?

Same is true for -Wl,<options> and -Wa,<options>

Thanks,
-Devang

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

end of thread, other threads:[~2002-11-03 23:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20021101022336.GB8186@redhat.com>
2002-11-01 14:20 ` -Wp,<options> Devang Patel
2002-11-01 15:20   ` -Wp,<options> Fergus Henderson
2002-11-01 15:46     ` -Wp,<options> Devang Patel
2002-11-03 15:31   ` -Wp,<options> Richard Henderson
2002-10-31 17:06 -Wp,<options> Devang Patel

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).