public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* RFA: Pass --help= switch on to sub-processes
@ 2007-03-28 11:12 Nick Clifton
  2007-03-28 15:23 ` Ian Lance Taylor
  2007-03-28 18:25 ` Brooks Moses
  0 siblings, 2 replies; 5+ messages in thread
From: Nick Clifton @ 2007-03-28 11:12 UTC (permalink / raw)
  To: gcc-patches

Hi Guys,

  Please may I apply the following patch to fix PR driver/31353 ?  It
  fixes the gcc driver so that --help=target is passed on to the
  pre-processor, assembler and linker as --target-help, and any other
  --help=... option is just passed on as --help.  (Which was the
  nearest equivalent in those subprocesses).

Cheers
  Nick

gcc/ChangeLog
2007-03-28  Nick Clifton  <nickc@redhat.com>

	PR driver/31353
	* gcc.c (process_command): Pass --help= switch on to
	pre-processor, assembler and linker sub-processes.

Index: gcc/gcc.c
===================================================================
--- gcc/gcc.c	(revision 123290)
+++ gcc/gcc.c	(working copy)
@@ -3607,11 +3607,26 @@ warranty; not even for MERCHANTABILITY o
       else if (strncmp (argv[i], "-fhelp=", 7) == 0)
 	{
 	  /* translate_options () has turned --help into -fhelp.  */
-	  print_subprocess_help = 2;
+	  print_subprocess_help = 1;
 
 	  /* We will be passing a dummy file on to the sub-processes.  */
 	  n_infiles++;
 	  n_switches++;
+
+	  if (strcmp (argv[i] + 7, "target") == 0)
+	    {
+	      if (is_cpp_driver)
+		add_preprocessor_option ("--target-help", 13);
+	      add_assembler_option ("--target-help", 13);
+	      add_linker_option ("--target-help", 13);
+	    }
+	  else
+	    {
+	      if (is_cpp_driver)
+		add_preprocessor_option ("--help", 6);
+	      add_assembler_option ("--help", 6);
+	      add_linker_option ("--help", 6);
+	    }
 	}
       else if (strcmp (argv[i], "-ftarget-help") == 0)
 	{

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

* Re: RFA: Pass --help= switch on to sub-processes
  2007-03-28 11:12 RFA: Pass --help= switch on to sub-processes Nick Clifton
@ 2007-03-28 15:23 ` Ian Lance Taylor
  2007-03-28 17:13   ` Nick Clifton
  2007-03-28 18:25 ` Brooks Moses
  1 sibling, 1 reply; 5+ messages in thread
From: Ian Lance Taylor @ 2007-03-28 15:23 UTC (permalink / raw)
  To: Nick Clifton; +Cc: gcc-patches

Nick Clifton <nickc@redhat.com> writes:

>   Please may I apply the following patch to fix PR driver/31353 ?  It
>   fixes the gcc driver so that --help=target is passed on to the
>   pre-processor, assembler and linker as --target-help, and any other
>   --help=... option is just passed on as --help.  (Which was the
>   nearest equivalent in those subprocesses).

What happens today when not using GNU as and/or not using GNU ld?
What would happen with your patch?

In any case this patch (which seems reasonable to me but which I can't
approve) would require a change to the documentation.

Ian

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

* Re: RFA: Pass --help= switch on to sub-processes
  2007-03-28 15:23 ` Ian Lance Taylor
@ 2007-03-28 17:13   ` Nick Clifton
  0 siblings, 0 replies; 5+ messages in thread
From: Nick Clifton @ 2007-03-28 17:13 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc-patches

Hi Ian,

>>   Please may I apply the following patch to fix PR driver/31353 ?  It
>>   fixes the gcc driver so that --help=target is passed on to the
>>   pre-processor, assembler and linker as --target-help, and any other
>>   --help=... option is just passed on as --help.  (Which was the
>>   nearest equivalent in those subprocesses).
> 
> What happens today when not using GNU as and/or not using GNU ld?
> What would happen with your patch?

Well with --help=target they would receive "--target-help" as a command 
line option.  This is the same behaviour as the current --target-help 
switch as accepted by gcc, so I assumed that it was OK for 
--help=target.  With --help=foo, where foo is anything other than 
"target" the assembler and linker will receive --help, which I have also 
assumed would be OK.

> In any case this patch (which seems reasonable to me but which I can't
> approve) would require a change to the documentation.

Yes, I only noticed this afterwards.  If approved I would also include 
this small documentation patch:

Index: gcc/doc/invoke.texi
===================================================================
--- gcc/doc/invoke.texi	(revision 123290)
+++ gcc/doc/invoke.texi	(working copy)
@@ -1113,14 +1114,21 @@ This will display all of the options con
  produced by the compiler.

  @item @var{target}
-This will display target-specific options.  Unlike the
-@option{--target-help} option however, target-specific options of the
-linker and assembler will not be displayed.  This is because those
-tools do not currently support the extended @option{--help=} syntax.
+This will display target-specific options.  This option is basically
+the same as @option{--target-help}.

Cheers
   Nick

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

* Re: RFA: Pass --help= switch on to sub-processes
  2007-03-28 11:12 RFA: Pass --help= switch on to sub-processes Nick Clifton
  2007-03-28 15:23 ` Ian Lance Taylor
@ 2007-03-28 18:25 ` Brooks Moses
  2007-03-29 10:25   ` Nick Clifton
  1 sibling, 1 reply; 5+ messages in thread
From: Brooks Moses @ 2007-03-28 18:25 UTC (permalink / raw)
  To: gcc-patches

Nick Clifton wrote:
>   Please may I apply the following patch to fix PR driver/31353 ?  It
>   fixes the gcc driver so that --help=target is passed on to the
>   pre-processor, assembler and linker as --target-help, and any other
>   --help=... option is just passed on as --help.  (Which was the
>   nearest equivalent in those subprocesses).

Note that I had already posted a patch to fix this:
http://gcc.gnu.org/ml/gcc-patches/2007-03/msg01658.html

(Unfortunately, the patch tracker didn't notice, so it didn't get copied 
to the PR.  Sorry about that!)

I don't think that passing the --help= option along to the assembler and 
linker is correct; if I call "gcc --help=fortran", I don't want a big 
long list of assembler and linker options.

Also, I'm not sure about passing --target-help along for --help=target, 
either, since the assembler and linker won't respect the filtering if 
someone requests it.  I could be much more easily persuaded on that, 
however.

- Brooks

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

* Re: RFA: Pass --help= switch on to sub-processes
  2007-03-28 18:25 ` Brooks Moses
@ 2007-03-29 10:25   ` Nick Clifton
  0 siblings, 0 replies; 5+ messages in thread
From: Nick Clifton @ 2007-03-29 10:25 UTC (permalink / raw)
  To: Brooks Moses; +Cc: gcc-patches

Hi Brooks,

> Note that I had already posted a patch to fix this:
> http://gcc.gnu.org/ml/gcc-patches/2007-03/msg01658.html

Ah - well your patch is certainly better than mine, so I would 
definitely recommend that it be adopted.

Cheers
   Nick


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

end of thread, other threads:[~2007-03-29 10:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-28 11:12 RFA: Pass --help= switch on to sub-processes Nick Clifton
2007-03-28 15:23 ` Ian Lance Taylor
2007-03-28 17:13   ` Nick Clifton
2007-03-28 18:25 ` Brooks Moses
2007-03-29 10:25   ` Nick Clifton

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