fix spelling of -linker-output-auto-nolto-rel

Message ID 20211201110732.455294-1-rasmus.villemoes@prevas.dk
State Committed
Headers
Series fix spelling of -linker-output-auto-nolto-rel |

Commit Message

Rasmus Villemoes Dec. 1, 2021, 11:07 a.m. UTC
  The transposition nolto -> notlo is confusing and it makes the long
name even harder to read than it already is - I kept reading it as
"not lo" until I realized it was a simply typo.

Fixes: 5269b24605b1 (Silence warning in LTO mode on VxWorks)

lto-plugin/
	* lto-plugin.c: Fix -linker-output-auto-notlo-rel ->
	-linker-output-auto-nolto-rel typo.
	(process_option): Adjust accordingly.

gcc/
	* config/vxworks.h (LTO_PLUGIN_SPEC): Adapt to corrected
	spelling of -linker-output-auto-nolto-rel.
---
 gcc/config/vxworks.h    | 2 +-
 lto-plugin/lto-plugin.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
  

Comments

Richard Biener Dec. 1, 2021, 1:17 p.m. UTC | #1
On Wed, Dec 1, 2021 at 12:08 PM Rasmus Villemoes <rv@rasmusvillemoes.dk> wrote:
>
> The transposition nolto -> notlo is confusing and it makes the long
> name even harder to read than it already is - I kept reading it as
> "not lo" until I realized it was a simply typo.
>
> Fixes: 5269b24605b1 (Silence warning in LTO mode on VxWorks)

Hmm, if we ever released GCC with that lto-plugin behavior you should preserve
accepting -linker-output-auto-notlo-rel in lto-plugin because a newer lto-plugin
is required to work with older released GCC which continue to provide
the option with the spelling mistake.

Richard.

> lto-plugin/
>         * lto-plugin.c: Fix -linker-output-auto-notlo-rel ->
>         -linker-output-auto-nolto-rel typo.
>         (process_option): Adjust accordingly.
>
> gcc/
>         * config/vxworks.h (LTO_PLUGIN_SPEC): Adapt to corrected
>         spelling of -linker-output-auto-nolto-rel.
> ---
>  gcc/config/vxworks.h    | 2 +-
>  lto-plugin/lto-plugin.c | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/gcc/config/vxworks.h b/gcc/config/vxworks.h
> index e41f16a51e8..bddf2c37f42 100644
> --- a/gcc/config/vxworks.h
> +++ b/gcc/config/vxworks.h
> @@ -306,4 +306,4 @@ extern void vxworks_emit_call_builtin___clear_cache (rtx begin, rtx end);
>     further incremental LTO linking.  We do not do repeated incremental linking
>     so silence the warning (instead of passing -flinker-output=nolto-rel).  */
>  #undef LTO_PLUGIN_SPEC
> -#define LTO_PLUGIN_SPEC "%{!mrtp:-plugin-opt=-linker-output-auto-notlo-rel}"
> +#define LTO_PLUGIN_SPEC "%{!mrtp:-plugin-opt=-linker-output-auto-nolto-rel}"
> diff --git a/lto-plugin/lto-plugin.c b/lto-plugin/lto-plugin.c
> index 6ab9822f369..40d7b7b8692 100644
> --- a/lto-plugin/lto-plugin.c
> +++ b/lto-plugin/lto-plugin.c
> @@ -32,7 +32,7 @@ along with this program; see the file COPYING3.  If not see
>     -nop: Instead of running lto-wrapper, pass the original to the plugin. This
>     only works if the input files are hybrid.
>     -linker-output-known: Do not determine linker output
> -   -linker-output-auto-notlo-rel: Switch from rel to nolto-rel mode without
> +   -linker-output-auto-nolto-rel: Switch from rel to nolto-rel mode without
>     warning.  This is used on systems like VxWorks (kernel) where the link is
>     always partial and repeated incremental linking is generally not used.
>     -sym-style={none,win32,underscore|uscore}
> @@ -1321,7 +1321,7 @@ process_option (const char *option)
>  {
>    if (strcmp (option, "-linker-output-known") == 0)
>      linker_output_known = true;
> -  else if (strcmp (option, "-linker-output-auto-notlo-rel") == 0)
> +  else if (strcmp (option, "-linker-output-auto-nolto-rel") == 0)
>      linker_output_auto_nolto_rel = true;
>    else if (strcmp (option, "-debug") == 0)
>      debug = true;
> --
> 2.31.1
>
  
Rasmus Villemoes Dec. 1, 2021, 2:18 p.m. UTC | #2
On 01/12/2021 14.17, Richard Biener wrote:
> On Wed, Dec 1, 2021 at 12:08 PM Rasmus Villemoes <rv@rasmusvillemoes.dk> wrote:
>>
>> The transposition nolto -> notlo is confusing and it makes the long
>> name even harder to read than it already is - I kept reading it as
>> "not lo" until I realized it was a simply typo.
>>
>> Fixes: 5269b24605b1 (Silence warning in LTO mode on VxWorks)
> 
> Hmm, if we ever released GCC with that lto-plugin behavior you should preserve
> accepting -linker-output-auto-notlo-rel in lto-plugin because a newer lto-plugin
> is required to work with older released GCC which continue to provide
> the option with the spelling mistake.

I thought a given version of gcc would only use the plugin it shipped
with(?).

And even if in theory one should keep the plugin compatible with older
gcc releases, in this case it is only relevant to vxworks ports, so if
Eric and Olivier are ok with this as-is, perhaps we can avoid having to
accept both spellings forever.

Rasmus
  
Richard Biener Dec. 1, 2021, 2:23 p.m. UTC | #3
On Wed, Dec 1, 2021 at 3:18 PM Rasmus Villemoes
<rasmus.villemoes@prevas.dk> wrote:
>
> On 01/12/2021 14.17, Richard Biener wrote:
> > On Wed, Dec 1, 2021 at 12:08 PM Rasmus Villemoes <rv@rasmusvillemoes.dk> wrote:
> >>
> >> The transposition nolto -> notlo is confusing and it makes the long
> >> name even harder to read than it already is - I kept reading it as
> >> "not lo" until I realized it was a simply typo.
> >>
> >> Fixes: 5269b24605b1 (Silence warning in LTO mode on VxWorks)
> >
> > Hmm, if we ever released GCC with that lto-plugin behavior you should preserve
> > accepting -linker-output-auto-notlo-rel in lto-plugin because a newer lto-plugin
> > is required to work with older released GCC which continue to provide
> > the option with the spelling mistake.
>
> I thought a given version of gcc would only use the plugin it shipped
> with(?).

No.  It's even older lto-plugins being used by newer compiler versions
(just with a possibly reduced feature set) - typing that on a system with
a lto-plugin from GCC 7 ;)

> And even if in theory one should keep the plugin compatible with older
> gcc releases, in this case it is only relevant to vxworks ports, so if
> Eric and Olivier are ok with this as-is, perhaps we can avoid having to
> accept both spellings forever.

I think the cost is negligible - looks like only GCC 11 knows the flag
so I would suggest to backport the patch to the GCC 11 branch as well
(but there as well keep the compatibility).

Richard.

>
> Rasmus
  
Eric Botcazou Dec. 3, 2021, 8:23 a.m. UTC | #4
> The transposition nolto -> notlo is confusing and it makes the long
> name even harder to read than it already is - I kept reading it as
> "not lo" until I realized it was a simply typo.

Thanks for catching this!
  

Patch

diff --git a/gcc/config/vxworks.h b/gcc/config/vxworks.h
index e41f16a51e8..bddf2c37f42 100644
--- a/gcc/config/vxworks.h
+++ b/gcc/config/vxworks.h
@@ -306,4 +306,4 @@  extern void vxworks_emit_call_builtin___clear_cache (rtx begin, rtx end);
    further incremental LTO linking.  We do not do repeated incremental linking
    so silence the warning (instead of passing -flinker-output=nolto-rel).  */
 #undef LTO_PLUGIN_SPEC
-#define LTO_PLUGIN_SPEC "%{!mrtp:-plugin-opt=-linker-output-auto-notlo-rel}"
+#define LTO_PLUGIN_SPEC "%{!mrtp:-plugin-opt=-linker-output-auto-nolto-rel}"
diff --git a/lto-plugin/lto-plugin.c b/lto-plugin/lto-plugin.c
index 6ab9822f369..40d7b7b8692 100644
--- a/lto-plugin/lto-plugin.c
+++ b/lto-plugin/lto-plugin.c
@@ -32,7 +32,7 @@  along with this program; see the file COPYING3.  If not see
    -nop: Instead of running lto-wrapper, pass the original to the plugin. This
    only works if the input files are hybrid. 
    -linker-output-known: Do not determine linker output
-   -linker-output-auto-notlo-rel: Switch from rel to nolto-rel mode without
+   -linker-output-auto-nolto-rel: Switch from rel to nolto-rel mode without
    warning.  This is used on systems like VxWorks (kernel) where the link is
    always partial and repeated incremental linking is generally not used.
    -sym-style={none,win32,underscore|uscore}
@@ -1321,7 +1321,7 @@  process_option (const char *option)
 {
   if (strcmp (option, "-linker-output-known") == 0)
     linker_output_known = true;
-  else if (strcmp (option, "-linker-output-auto-notlo-rel") == 0)
+  else if (strcmp (option, "-linker-output-auto-nolto-rel") == 0)
     linker_output_auto_nolto_rel = true;
   else if (strcmp (option, "-debug") == 0)
     debug = true;