Thanks for the review.

"Joseph S. Myers" <jos...@codesourcery.com> skribis:

> On Fri, 9 Mar 2012, Ludovic Courtès wrote:
>>      * gcc/opts-common.c (generate_option): Don't insert white space in
>>      `canonical_option' when OPT_INDEX is OPT_l.
> No, opts-common.c should not have special cases for individual options 
> like that.  The canonical form has the separate arguments.

Indeed, and the comment in opts.h makes it clear, though I think I was
confused by the phrase “original text of option”.

> gcc.c has a special case for how it passes this option to
> subprocesses; if you have problems with some output from gfortran
> involving -l options, you should change the gfortran driver as needed
> so it outputs -l options in a different way.

The patch below solves the problem in a gfortran-specific way.  WDYT?


2012-03-09  Ludovic Courtès  <ludovic.cour...@inria.fr>

        * gcc/fortran/gfotranspec.c (lang_specific_driver): When
        VERBOSE, make sure `-l' options are printed with no intertwined
        white spaces.

diff --git a/gcc/fortran/gfortranspec.c b/gcc/fortran/gfortranspec.c
index 2240bfb..55e5e42 100644
--- a/gcc/fortran/gfortranspec.c
+++ b/gcc/fortran/gfortranspec.c
@@ -461,8 +461,15 @@ For more information about these matters, see the file named COPYING\n\n"));
       fprintf (stderr, _("Driving:"));
       for (i = 0; i < g77_newargc; i++)
+	{
+	  if (g77_new_decoded_options[i].opt_index == OPT_l)
+	    /* Make sure no white space is inserted after `-l'.  */
+	    fprintf (stderr, " -l%s",
+		     g77_new_decoded_options[i].canonical_option[1]);
+	  else
 	fprintf (stderr, " %s",
+	}
       fprintf (stderr, "\n");

Reply via email to