This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Don't insert white space in 'orig_option_with_args_text' for OPT_l
Hi,
Thanks for the review.
"Joseph S. Myers" <joseph@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?
Thanks,
Ludoâ.
2012-03-09 Ludovic CourtÃs <ludovic.courtes@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",
g77_new_decoded_options[i].orig_option_with_args_text);
+ }
fprintf (stderr, "\n");
}