public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* -use-linker-plugin passed to ld
@ 2009-10-23 15:02 Ian Lance Taylor
  2009-10-23 15:45 ` Rafael Espindola
  0 siblings, 1 reply; 17+ messages in thread
From: Ian Lance Taylor @ 2009-10-23 15:02 UTC (permalink / raw)
  To: gcc; +Cc: espindola

I noticed that the -use-linker-plugin option seems to be passed to the
linker.  This is because LINK_COMMAND_SPEC includes %{u*}.  And that
is because -uSYMBOL is a documented linker option.

The effect is that the linker creates an undefined reference to the
symbol "se-linker-plugin".  Any user unfortunate enough to link
against a library which contains a definition of that symbol may see
an unexpected result.  Admittedly unlikely, but still.

I think we need to fix this option before the release to not overlap
with any existing linker options.

Ian

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: -use-linker-plugin passed to ld
  2009-10-23 15:02 -use-linker-plugin passed to ld Ian Lance Taylor
@ 2009-10-23 15:45 ` Rafael Espindola
  2009-10-23 16:49   ` Rafael Espindola
  0 siblings, 1 reply; 17+ messages in thread
From: Rafael Espindola @ 2009-10-23 15:45 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc

2009/10/23 Ian Lance Taylor <iant@google.com>:
> I noticed that the -use-linker-plugin option seems to be passed to the
> linker.  This is because LINK_COMMAND_SPEC includes %{u*}.  And that
> is because -uSYMBOL is a documented linker option.
>
> The effect is that the linker creates an undefined reference to the
> symbol "se-linker-plugin".  Any user unfortunate enough to link
> against a library which contains a definition of that symbol may see
> an unexpected result.  Admittedly unlikely, but still.
>
> I think we need to fix this option before the release to not overlap
> with any existing linker options.

Working on it.

> Ian
>

Cheers,
-- 
Rafael Ávila de Espíndola

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: -use-linker-plugin passed to ld
  2009-10-23 15:45 ` Rafael Espindola
@ 2009-10-23 16:49   ` Rafael Espindola
  2009-10-23 18:45     ` Ian Lance Taylor
  0 siblings, 1 reply; 17+ messages in thread
From: Rafael Espindola @ 2009-10-23 16:49 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc

[-- Attachment #1: Type: text/plain, Size: 366 bytes --]

> Working on it.

The attached patch solves the problem. It is not very elegant to
remove -use-linker-plugin from the command line, but it is not used after
linking.
	
2009-10-23  Rafael Avila de Espindola  <espindola@google.com>

	* gcc.c (LINK_COMMAND_SPEC): Remove -use-linker-plugin from the command
	line.

Cheers,
-- 
Rafael Ávila de Espíndola

[-- Attachment #2: use-linker-plugin.patch --]
[-- Type: text/x-diff, Size: 652 bytes --]

diff --git a/gcc/gcc.c b/gcc/gcc.c
index 78e0ce8..78ffb0d 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -782,7 +782,8 @@ proper position among the other output files.  */
     } \
     %{flto} %{fwhopr} %l " LINK_PIE_SPEC \
    "%X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r}\
-    %{s} %{t} %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}\
+    %{s} %{t} %<use-linker-plugin \
+    %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}     \
     %{static:} %{L*} %(mfwrap) %(link_libgcc) %o\
     %{fopenmp|ftree-parallelize-loops=*:%:include(libgomp.spec)%(link_gomp)} %(mflib)\
     %{fprofile-arcs|fprofile-generate*|coverage:-lgcov}\

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: -use-linker-plugin passed to ld
  2009-10-23 16:49   ` Rafael Espindola
@ 2009-10-23 18:45     ` Ian Lance Taylor
  2009-10-23 19:00       ` Steven Bosscher
  0 siblings, 1 reply; 17+ messages in thread
From: Ian Lance Taylor @ 2009-10-23 18:45 UTC (permalink / raw)
  To: Rafael Espindola; +Cc: gcc

Rafael Espindola <espindola@google.com> writes:

> 2009-10-23  Rafael Avila de Espindola  <espindola@google.com>
>
> 	* gcc.c (LINK_COMMAND_SPEC): Remove -use-linker-plugin from the command
> 	line.

This is OK if it passes bootstrap and if nobody objects in 24 hours.

Thanks.

Ian

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: -use-linker-plugin passed to ld
  2009-10-23 18:45     ` Ian Lance Taylor
@ 2009-10-23 19:00       ` Steven Bosscher
  2009-10-23 19:07         ` Ian Lance Taylor
  0 siblings, 1 reply; 17+ messages in thread
From: Steven Bosscher @ 2009-10-23 19:00 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: Rafael Espindola, gcc

On Fri, Oct 23, 2009 at 8:21 PM, Ian Lance Taylor <iant@google.com> wrote:
> Rafael Espindola <espindola@google.com> writes:
>
>> 2009-10-23  Rafael Avila de Espindola  <espindola@google.com>
>>
>>       * gcc.c (LINK_COMMAND_SPEC): Remove -use-linker-plugin from the command
>>       line.
>
> This is OK if it passes bootstrap and if nobody objects in 24 hours.


I was just wondering why this is not a -f* flag, e.g. -fuse-linker-plugin?

Ciao!
Steven

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: -use-linker-plugin passed to ld
  2009-10-23 19:00       ` Steven Bosscher
@ 2009-10-23 19:07         ` Ian Lance Taylor
  2009-10-24  4:26           ` Rafael Espindola
  2009-10-26 23:27           ` Hans-Peter Nilsson
  0 siblings, 2 replies; 17+ messages in thread
From: Ian Lance Taylor @ 2009-10-23 19:07 UTC (permalink / raw)
  To: Steven Bosscher; +Cc: Rafael Espindola, gcc

Steven Bosscher <stevenb.gcc@gmail.com> writes:

> On Fri, Oct 23, 2009 at 8:21 PM, Ian Lance Taylor <iant@google.com> wrote:
>> Rafael Espindola <espindola@google.com> writes:
>>
>>> 2009-10-23  Rafael Avila de Espindola  <espindola@google.com>
>>>
>>>       * gcc.c (LINK_COMMAND_SPEC): Remove -use-linker-plugin from the command
>>>       line.
>>
>> This is OK if it passes bootstrap and if nobody objects in 24 hours.
>
>
> I was just wondering why this is not a -f* flag, e.g. -fuse-linker-plugin?

I thought about that too, but a -f flag would be passed to the
middle-end, where it does not make any sense.  We could make it a -f
flag anyhow, of course, and just explicitly ignore it in the
middle-end.

Any opinions on the best user interface for this?

Ian

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: -use-linker-plugin passed to ld
  2009-10-23 19:07         ` Ian Lance Taylor
@ 2009-10-24  4:26           ` Rafael Espindola
  2009-10-26 23:27           ` Hans-Peter Nilsson
  1 sibling, 0 replies; 17+ messages in thread
From: Rafael Espindola @ 2009-10-24  4:26 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: Steven Bosscher, gcc

> I thought about that too, but a -f flag would be passed to the
> middle-end, where it does not make any sense.  We could make it a -f
> flag anyhow, of course, and just explicitly ignore it in the
> middle-end.
>
> Any opinions on the best user interface for this?

From an user interface point of view I have no preferences for
-fuse-linker-plugin or -use-linker-plugin. I don't like the idea of
ignoring -fuse-linker-plugin on the compilers (cc1/cc1plus/...).
We should probably filter it on the driver.

From an implementation point of view it is easier to avoid
-use-linker-plugin being passed to the linker than it is
to avoid -fuse-linker-plugin being passed to the compilers.
The reason is that we don't need the option after linking,
so we can just use %< to filter it out. With -f I think we
would have to record it in a variable and use that in
the spec.

BTW, a bootstrap with the original patch attached
finished successfully.

> Ian
>

Cheers,
-- 
Rafael Ávila de Espíndola

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: -use-linker-plugin passed to ld
  2009-10-23 19:07         ` Ian Lance Taylor
  2009-10-24  4:26           ` Rafael Espindola
@ 2009-10-26 23:27           ` Hans-Peter Nilsson
  2009-10-27  6:09             ` Daniel Jacobowitz
  1 sibling, 1 reply; 17+ messages in thread
From: Hans-Peter Nilsson @ 2009-10-26 23:27 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: Steven Bosscher, Rafael Espindola, gcc

On Fri, 23 Oct 2009, Ian Lance Taylor wrote:
> Steven Bosscher <stevenb.gcc@gmail.com> writes:
> > I was just wondering why this is not a -f* flag, e.g. -fuse-linker-plugin?
> Any opinions on the best user interface for this?

The color that spells -fuse-linker-plugin seems better, in line
with other options.  How it's implemented, especially regarding
having to ignore it in middle-end is unimportant wrt. spelling,
IMVHO.

brgds, H-P

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: -use-linker-plugin passed to ld
  2009-10-26 23:27           ` Hans-Peter Nilsson
@ 2009-10-27  6:09             ` Daniel Jacobowitz
  2009-10-27 15:55               ` Rafael Espindola
  0 siblings, 1 reply; 17+ messages in thread
From: Daniel Jacobowitz @ 2009-10-27  6:09 UTC (permalink / raw)
  To: Hans-Peter Nilsson
  Cc: Ian Lance Taylor, Steven Bosscher, Rafael Espindola, gcc

On Mon, Oct 26, 2009 at 06:10:06PM -0400, Hans-Peter Nilsson wrote:
> On Fri, 23 Oct 2009, Ian Lance Taylor wrote:
> > Steven Bosscher <stevenb.gcc@gmail.com> writes:
> > > I was just wondering why this is not a -f* flag, e.g. -fuse-linker-plugin?
> > Any opinions on the best user interface for this?
> 
> The color that spells -fuse-linker-plugin seems better, in line
> with other options.  How it's implemented, especially regarding
> having to ignore it in middle-end is unimportant wrt. spelling,
> IMVHO.

I agree with H-P.

-- 
Daniel Jacobowitz
CodeSourcery

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: -use-linker-plugin passed to ld
  2009-10-27  6:09             ` Daniel Jacobowitz
@ 2009-10-27 15:55               ` Rafael Espindola
  2009-10-27 16:45                 ` Andreas Schwab
  0 siblings, 1 reply; 17+ messages in thread
From: Rafael Espindola @ 2009-10-27 15:55 UTC (permalink / raw)
  To: Hans-Peter Nilsson, Ian Lance Taylor, Steven Bosscher,
	Rafael Espindola, gcc

[-- Attachment #1: Type: text/plain, Size: 263 bytes --]

> I agree with H-P.

The attached patch implements that. Tested that it is ignored by cc1
and not passed to the linker. OK with a CL entry if bootstrap finishes
OK?

> --
> Daniel Jacobowitz
> CodeSourcery
>

Cheers,
-- 
Rafael Ávila de Espíndola

[-- Attachment #2: fuse-linker-plugin.patch --]
[-- Type: text/x-diff, Size: 2112 bytes --]

diff --git a/gcc/common.opt b/gcc/common.opt
index b57234a..9e4cf12 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -1391,6 +1391,11 @@ funwind-tables
 Common Report Var(flag_unwind_tables) Optimization
 Just generate unwind tables for exception handling
 
+fuse-linker-plugin
+Common Var(flag_use_linker_plugin)
+Ignored. Is is used by the driver, but passed to the compiler because it starts
+with an f.
+
 fvar-tracking
 Common Report Var(flag_var_tracking) VarExists Optimization
 Perform variable tracking
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 78e0ce8..b033d62 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -770,7 +770,7 @@ proper position among the other output files.  */
 #define LINK_COMMAND_SPEC "\
 %{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
     %(linker) \
-    %{use-linker-plugin: \
+    %{fuse-linker-plugin: \
     -plugin %(linker_plugin_file) \
     -plugin-opt=%(lto_wrapper) \
     -plugin-opt=%(lto_gcc) \
@@ -7513,7 +7513,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
   if (num_linker_inputs > 0 && error_count == 0 && print_subprocess_help < 2)
     {
       int tmp = execution_count;
-      const char *use_linker_plugin = "use-linker-plugin";
+      const char *fuse_linker_plugin = "fuse-linker-plugin";
 
       /* We'll use ld if we can't find collect2.  */
       if (! strcmp (linker_name_spec, "collect2"))
@@ -7523,14 +7523,14 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
 	    linker_name_spec = "ld";
 	}
 
-      if (switch_matches (use_linker_plugin,
-			  use_linker_plugin + strlen (use_linker_plugin), 0))
+      if (switch_matches (fuse_linker_plugin,
+			  fuse_linker_plugin + strlen (fuse_linker_plugin), 0))
 	{
 	  linker_plugin_file_spec = find_a_file (&exec_prefixes,
 						 "liblto_plugin.so", X_OK,
 						 false);
 	  if (!linker_plugin_file_spec)
-	    fatal ("-use-linker-plugin, but liblto_plugin.so not found");
+	    fatal ("-fuse-linker-plugin, but liblto_plugin.so not found");
 
 	  lto_libgcc_spec = find_a_file (&startfile_prefixes, "libgcc.a",
 					 R_OK, true);

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: -use-linker-plugin passed to ld
  2009-10-27 15:55               ` Rafael Espindola
@ 2009-10-27 16:45                 ` Andreas Schwab
  2009-10-27 17:01                   ` Ian Lance Taylor
  2009-10-27 17:22                   ` Rafael Espindola
  0 siblings, 2 replies; 17+ messages in thread
From: Andreas Schwab @ 2009-10-27 16:45 UTC (permalink / raw)
  To: Rafael Espindola
  Cc: Hans-Peter Nilsson, Ian Lance Taylor, Steven Bosscher, gcc

Rafael Espindola <espindola@google.com> writes:

> diff --git a/gcc/common.opt b/gcc/common.opt
> index b57234a..9e4cf12 100644
> --- a/gcc/common.opt
> +++ b/gcc/common.opt
> @@ -1391,6 +1391,11 @@ funwind-tables
>  Common Report Var(flag_unwind_tables) Optimization
>  Just generate unwind tables for exception handling
>  
> +fuse-linker-plugin
> +Common Var(flag_use_linker_plugin)
> +Ignored. Is is used by the driver, but passed to the compiler because it starts
> +with an f.

Perhaps this should be an Undocumented option.  I don't think you need a
Var anyway.

Andreas.

-- 
Andreas Schwab, schwab@redhat.com
GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84  5EC7 45C6 250E 6F00 984E
"And now for something completely different."

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: -use-linker-plugin passed to ld
  2009-10-27 16:45                 ` Andreas Schwab
@ 2009-10-27 17:01                   ` Ian Lance Taylor
  2009-10-27 17:22                   ` Rafael Espindola
  1 sibling, 0 replies; 17+ messages in thread
From: Ian Lance Taylor @ 2009-10-27 17:01 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Rafael Espindola, Hans-Peter Nilsson, Steven Bosscher, gcc

Andreas Schwab <schwab@redhat.com> writes:

> Rafael Espindola <espindola@google.com> writes:
>
>> diff --git a/gcc/common.opt b/gcc/common.opt
>> index b57234a..9e4cf12 100644
>> --- a/gcc/common.opt
>> +++ b/gcc/common.opt
>> @@ -1391,6 +1391,11 @@ funwind-tables
>>  Common Report Var(flag_unwind_tables) Optimization
>>  Just generate unwind tables for exception handling
>>  
>> +fuse-linker-plugin
>> +Common Var(flag_use_linker_plugin)
>> +Ignored. Is is used by the driver, but passed to the compiler because it starts
>> +with an f.
>
> Perhaps this should be an Undocumented option.  I don't think you need a
> Var anyway.

Agreed on both counts.

Ian

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: -use-linker-plugin passed to ld
  2009-10-27 16:45                 ` Andreas Schwab
  2009-10-27 17:01                   ` Ian Lance Taylor
@ 2009-10-27 17:22                   ` Rafael Espindola
  2009-10-27 17:24                     ` Rafael Espindola
  2009-10-27 18:23                     ` Andrew Pinski
  1 sibling, 2 replies; 17+ messages in thread
From: Rafael Espindola @ 2009-10-27 17:22 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Hans-Peter Nilsson, Ian Lance Taylor, Steven Bosscher, gcc

[-- Attachment #1: Type: text/plain, Size: 318 bytes --]

> Perhaps this should be an Undocumented option.  I don't think you need a
> Var anyway.

Without the Var it fails with

cc1: internal compiler error: in common_handle_option, at opts.c:2108

The attached patch changes the option to Undocumented.

> Andreas.
>

Cheers,
-- 
Rafael Ávila de Espíndola

[-- Attachment #2: fuse-linker-plugin.patch --]
[-- Type: text/x-diff, Size: 2031 bytes --]

diff --git a/gcc/common.opt b/gcc/common.opt
index b57234a..c2452b8 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -1391,6 +1391,9 @@ funwind-tables
 Common Report Var(flag_unwind_tables) Optimization
 Just generate unwind tables for exception handling
 
+fuse-linker-plugin
+Common Undocumented Var(flag_use_linker_plugin)
+
 fvar-tracking
 Common Report Var(flag_var_tracking) VarExists Optimization
 Perform variable tracking
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 78e0ce8..b033d62 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -770,7 +770,7 @@ proper position among the other output files.  */
 #define LINK_COMMAND_SPEC "\
 %{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
     %(linker) \
-    %{use-linker-plugin: \
+    %{fuse-linker-plugin: \
     -plugin %(linker_plugin_file) \
     -plugin-opt=%(lto_wrapper) \
     -plugin-opt=%(lto_gcc) \
@@ -7513,7 +7513,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
   if (num_linker_inputs > 0 && error_count == 0 && print_subprocess_help < 2)
     {
       int tmp = execution_count;
-      const char *use_linker_plugin = "use-linker-plugin";
+      const char *fuse_linker_plugin = "fuse-linker-plugin";
 
       /* We'll use ld if we can't find collect2.  */
       if (! strcmp (linker_name_spec, "collect2"))
@@ -7523,14 +7523,14 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
 	    linker_name_spec = "ld";
 	}
 
-      if (switch_matches (use_linker_plugin,
-			  use_linker_plugin + strlen (use_linker_plugin), 0))
+      if (switch_matches (fuse_linker_plugin,
+			  fuse_linker_plugin + strlen (fuse_linker_plugin), 0))
 	{
 	  linker_plugin_file_spec = find_a_file (&exec_prefixes,
 						 "liblto_plugin.so", X_OK,
 						 false);
 	  if (!linker_plugin_file_spec)
-	    fatal ("-use-linker-plugin, but liblto_plugin.so not found");
+	    fatal ("-fuse-linker-plugin, but liblto_plugin.so not found");
 
 	  lto_libgcc_spec = find_a_file (&startfile_prefixes, "libgcc.a",
 					 R_OK, true);

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: -use-linker-plugin passed to ld
  2009-10-27 17:22                   ` Rafael Espindola
@ 2009-10-27 17:24                     ` Rafael Espindola
  2009-10-27 19:50                       ` Ian Lance Taylor
  2009-10-27 18:23                     ` Andrew Pinski
  1 sibling, 1 reply; 17+ messages in thread
From: Rafael Espindola @ 2009-10-27 17:24 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Hans-Peter Nilsson, Ian Lance Taylor, Steven Bosscher, gcc

[-- Attachment #1: Type: text/plain, Size: 276 bytes --]

> Without the Var it fails with
>
> cc1: internal compiler error: in common_handle_option, at opts.c:2108

Which can also be fixed by explicitly ignoring
OPT_fuse_linker_plugin. The attached patch does that. Any preferences?

Cheers,
-- 
Rafael Ávila de Espíndola

[-- Attachment #2: fuse-linker-plugin.patch --]
[-- Type: text/x-diff, Size: 2533 bytes --]

diff --git a/gcc/common.opt b/gcc/common.opt
index b57234a..77967f8 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -1391,6 +1391,9 @@ funwind-tables
 Common Report Var(flag_unwind_tables) Optimization
 Just generate unwind tables for exception handling
 
+fuse-linker-plugin
+Common Undocumented
+
 fvar-tracking
 Common Report Var(flag_var_tracking) VarExists Optimization
 Perform variable tracking
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 78e0ce8..b033d62 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -770,7 +770,7 @@ proper position among the other output files.  */
 #define LINK_COMMAND_SPEC "\
 %{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
     %(linker) \
-    %{use-linker-plugin: \
+    %{fuse-linker-plugin: \
     -plugin %(linker_plugin_file) \
     -plugin-opt=%(lto_wrapper) \
     -plugin-opt=%(lto_gcc) \
@@ -7513,7 +7513,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
   if (num_linker_inputs > 0 && error_count == 0 && print_subprocess_help < 2)
     {
       int tmp = execution_count;
-      const char *use_linker_plugin = "use-linker-plugin";
+      const char *fuse_linker_plugin = "fuse-linker-plugin";
 
       /* We'll use ld if we can't find collect2.  */
       if (! strcmp (linker_name_spec, "collect2"))
@@ -7523,14 +7523,14 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
 	    linker_name_spec = "ld";
 	}
 
-      if (switch_matches (use_linker_plugin,
-			  use_linker_plugin + strlen (use_linker_plugin), 0))
+      if (switch_matches (fuse_linker_plugin,
+			  fuse_linker_plugin + strlen (fuse_linker_plugin), 0))
 	{
 	  linker_plugin_file_spec = find_a_file (&exec_prefixes,
 						 "liblto_plugin.so", X_OK,
 						 false);
 	  if (!linker_plugin_file_spec)
-	    fatal ("-use-linker-plugin, but liblto_plugin.so not found");
+	    fatal ("-fuse-linker-plugin, but liblto_plugin.so not found");
 
 	  lto_libgcc_spec = find_a_file (&startfile_prefixes, "libgcc.a",
 					 R_OK, true);
diff --git a/gcc/opts.c b/gcc/opts.c
index 51a0cb9..72411b6 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -2102,6 +2102,10 @@ common_handle_option (size_t scode, const char *arg, int value,
       /* These are no-ops, preserved for backward compatibility.  */
       break;
 
+    case OPT_fuse_linker_plugin:
+      /* No-op. Used by the driver and passed to us because it starts with f.*/
+      break;
+
     default:
       /* If the flag was handled in a standard way, assume the lack of
 	 processing here is intentional.  */

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: -use-linker-plugin passed to ld
  2009-10-27 17:22                   ` Rafael Espindola
  2009-10-27 17:24                     ` Rafael Espindola
@ 2009-10-27 18:23                     ` Andrew Pinski
  2009-10-27 18:54                       ` Rafael Espindola
  1 sibling, 1 reply; 17+ messages in thread
From: Andrew Pinski @ 2009-10-27 18:23 UTC (permalink / raw)
  To: Rafael Espindola
  Cc: Andreas Schwab, Hans-Peter Nilsson, Ian Lance Taylor,
	Steven Bosscher, gcc



Sent from my iPhone

On Oct 27, 2009, at 10:13 AM, Rafael Espindola <espindola@google.com>  
wrote:

>> Perhaps this should be an Undocumented option.  I don't think you  
>> need a
>> Var anyway.
>
> Without the Var it fails with
>
> cc1: internal compiler error: in common_handle_option, at opts.c:2108

Then what about adding to that switch statement that it is already  
handled by the specs?

>
> The attached patch changes the option to Undocumented.
>
>> Andreas.
>>
>
> Cheers,
> -- 
> Rafael Ávila de Espíndola
> <fuse-linker-plugin.patch>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: -use-linker-plugin passed to ld
  2009-10-27 18:23                     ` Andrew Pinski
@ 2009-10-27 18:54                       ` Rafael Espindola
  0 siblings, 0 replies; 17+ messages in thread
From: Rafael Espindola @ 2009-10-27 18:54 UTC (permalink / raw)
  To: Andrew Pinski
  Cc: Andreas Schwab, Hans-Peter Nilsson, Ian Lance Taylor,
	Steven Bosscher, gcc

> Then what about adding to that switch statement that it is already handled
> by the specs?

That is what the last version does.

Cheers,
-- 
Rafael Ávila de Espíndola

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: -use-linker-plugin passed to ld
  2009-10-27 17:24                     ` Rafael Espindola
@ 2009-10-27 19:50                       ` Ian Lance Taylor
  0 siblings, 0 replies; 17+ messages in thread
From: Ian Lance Taylor @ 2009-10-27 19:50 UTC (permalink / raw)
  To: Rafael Espindola; +Cc: Andreas Schwab, Hans-Peter Nilsson, Steven Bosscher, gcc

Rafael Espindola <espindola@google.com> writes:

> Which can also be fixed by explicitly ignoring
> OPT_fuse_linker_plugin. The attached patch does that. Any preferences?

This version is OK with a ChangeLog entry if it bootstraps.  Since
there have been several comments, please give people 24 hours to
suggest changes.

Thanks.

Ian


> diff --git a/gcc/common.opt b/gcc/common.opt
> index b57234a..77967f8 100644
> --- a/gcc/common.opt
> +++ b/gcc/common.opt
> @@ -1391,6 +1391,9 @@ funwind-tables
>  Common Report Var(flag_unwind_tables) Optimization
>  Just generate unwind tables for exception handling
>  
> +fuse-linker-plugin
> +Common Undocumented
> +
>  fvar-tracking
>  Common Report Var(flag_var_tracking) VarExists Optimization
>  Perform variable tracking
> diff --git a/gcc/gcc.c b/gcc/gcc.c
> index 78e0ce8..b033d62 100644
> --- a/gcc/gcc.c
> +++ b/gcc/gcc.c
> @@ -770,7 +770,7 @@ proper position among the other output files.  */
>  #define LINK_COMMAND_SPEC "\
>  %{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
>      %(linker) \
> -    %{use-linker-plugin: \
> +    %{fuse-linker-plugin: \
>      -plugin %(linker_plugin_file) \
>      -plugin-opt=%(lto_wrapper) \
>      -plugin-opt=%(lto_gcc) \
> @@ -7513,7 +7513,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
>    if (num_linker_inputs > 0 && error_count == 0 && print_subprocess_help < 2)
>      {
>        int tmp = execution_count;
> -      const char *use_linker_plugin = "use-linker-plugin";
> +      const char *fuse_linker_plugin = "fuse-linker-plugin";
>  
>        /* We'll use ld if we can't find collect2.  */
>        if (! strcmp (linker_name_spec, "collect2"))
> @@ -7523,14 +7523,14 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
>  	    linker_name_spec = "ld";
>  	}
>  
> -      if (switch_matches (use_linker_plugin,
> -			  use_linker_plugin + strlen (use_linker_plugin), 0))
> +      if (switch_matches (fuse_linker_plugin,
> +			  fuse_linker_plugin + strlen (fuse_linker_plugin), 0))
>  	{
>  	  linker_plugin_file_spec = find_a_file (&exec_prefixes,
>  						 "liblto_plugin.so", X_OK,
>  						 false);
>  	  if (!linker_plugin_file_spec)
> -	    fatal ("-use-linker-plugin, but liblto_plugin.so not found");
> +	    fatal ("-fuse-linker-plugin, but liblto_plugin.so not found");
>  
>  	  lto_libgcc_spec = find_a_file (&startfile_prefixes, "libgcc.a",
>  					 R_OK, true);
> diff --git a/gcc/opts.c b/gcc/opts.c
> index 51a0cb9..72411b6 100644
> --- a/gcc/opts.c
> +++ b/gcc/opts.c
> @@ -2102,6 +2102,10 @@ common_handle_option (size_t scode, const char *arg, int value,
>        /* These are no-ops, preserved for backward compatibility.  */
>        break;
>  
> +    case OPT_fuse_linker_plugin:
> +      /* No-op. Used by the driver and passed to us because it starts with f.*/
> +      break;
> +
>      default:
>        /* If the flag was handled in a standard way, assume the lack of
>  	 processing here is intentional.  */

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2009-10-27 18:23 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-23 15:02 -use-linker-plugin passed to ld Ian Lance Taylor
2009-10-23 15:45 ` Rafael Espindola
2009-10-23 16:49   ` Rafael Espindola
2009-10-23 18:45     ` Ian Lance Taylor
2009-10-23 19:00       ` Steven Bosscher
2009-10-23 19:07         ` Ian Lance Taylor
2009-10-24  4:26           ` Rafael Espindola
2009-10-26 23:27           ` Hans-Peter Nilsson
2009-10-27  6:09             ` Daniel Jacobowitz
2009-10-27 15:55               ` Rafael Espindola
2009-10-27 16:45                 ` Andreas Schwab
2009-10-27 17:01                   ` Ian Lance Taylor
2009-10-27 17:22                   ` Rafael Espindola
2009-10-27 17:24                     ` Rafael Espindola
2009-10-27 19:50                       ` Ian Lance Taylor
2009-10-27 18:23                     ` Andrew Pinski
2009-10-27 18:54                       ` Rafael Espindola

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).