Re: [PATCH] Don't insert white space in 'orig_option_with_args_text' for OPT_l

2012-03-13 Thread Ludovic Courtès
Hi,

(Cc: Paul Brook.)

"Joseph S. Myers"  skribis:

> On Mon, 12 Mar 2012, Ludovic Courtès wrote:
>
>> The patch below solves the problem in a gfortran-specific way.  WDYT?
>
> I think that's the right approach for this issue.

The previous patch was produced with ‘diff -b’.  Here’s a fixed one.
Let me know if anything else needs to be done.

Thanks,
Ludo’.

2012-03-09  Ludovic Courtès  

* 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++)
-	fprintf (stderr, " %s",
-		 g77_new_decoded_options[i].orig_option_with_args_text);
+	{
+	  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");
 }


Re: [PATCH] Don't insert white space in 'orig_option_with_args_text' for OPT_l

2012-03-12 Thread Joseph S. Myers
On Mon, 12 Mar 2012, Ludovic Court?s wrote:

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

I think that's the right approach for this issue.

-- 
Joseph S. Myers
jos...@codesourcery.com

Re: [PATCH] Don't insert white space in 'orig_option_with_args_text' for OPT_l

2012-03-12 Thread Ludovic Courtès
Hi,

Thanks for the review.

"Joseph S. Myers"  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  

* 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");
 }


Re: [PATCH] Don't insert white space in 'orig_option_with_args_text' for OPT_l

2012-03-09 Thread Joseph S. Myers
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.  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.

Your subject refers to orig_option_with_args_text while your ChangeLog 
entry refers to canonical_option.

-- 
Joseph S. Myers
jos...@codesourcery.com