------- Comment #2 from nickc at redhat dot com  2007-03-28 11:38 -------
Subject: Re:  gcc --help=target gives a linker error.

Hi Brooks,

   I have a patch to fix this problem (attached).  Unfortunately due to 
an internal bugzilla error I cannot (currently) upload the patch to this PR.

Cheers
   Nick

gcc/ChangeLog
2007-03-28  Nick Clifton  <[EMAIL PROTECTED]>

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


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31353

Reply via email to