public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug driver/47244] [4.6 Regression] plugin linker is used unconditionally
  2011-01-10 16:15 [Bug driver/47244] New: [4.6 Regression] plugin linker is used unconditionally rguenth at gcc dot gnu.org
@ 2011-01-10 16:15 ` rguenth at gcc dot gnu.org
  2011-01-11 13:30 ` hubicka at gcc dot gnu.org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-01-10 16:15 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47244

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1
   Target Milestone|---                         |4.6.0


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

* [Bug driver/47244] New: [4.6 Regression] plugin linker is used unconditionally
@ 2011-01-10 16:15 rguenth at gcc dot gnu.org
  2011-01-10 16:15 ` [Bug driver/47244] " rguenth at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-01-10 16:15 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47244

           Summary: [4.6 Regression] plugin linker is used unconditionally
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: driver
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: rguenth@gcc.gnu.org
                CC: hubicka@gcc.gnu.org


We now seem to always pass -plugin ./liblto_plugin.so ... to collect2, even
when not using LTO.  This causes us to always use the linker configured
for plugin use (--with-plugin-ld) via the collect-ld script and thus
with --with-plugin-ld=gold gold will be always used (which breaks the build
of libgo for me as gold is too old appearantly).

int main() { return 0; }

> strace -e execve -f ./xgcc -B. t.c -v -Wl,-debug 2>&1 | grep gold
Configured with: /space/rguenther/src/svn/trunk/configure --disable-bootstrap
--disable-nls --disable-libstdcxx-pch --enable-lto --enable-gold
--with-plugin-ld=/usr/bin/gold
--enable-languages=c,ada,c++,fortran,java,lto,objc,obj-c++,go
[pid  7648] execve("/usr/bin/gold", ["/usr/bin/gold", "-plugin",
"./liblto_plugin.so", "-plugin-opt=./lto-wrapper",
"-plugin-opt=-fresolution=/tmp/cc"..., "-plugin-opt=-pass-through=-lgcc",
"-plugin-opt=-pass-through=-lgcc_"..., "-plugin-opt=-pass-through=-lc",
"-plugin-opt=-pass-through=-lgcc", "-plugin-opt=-pass-through=-lgcc_"...,
"--eh-frame-hdr", "-m", "elf_x86_64", "-dynamic-linker",
"/lib64/ld-linux-x86-64.so.2", "/usr/lib/../lib64/crt1.o", ...], [/* 91 vars
*/]) = 0
rguenther@murzim:/abuild/rguenther/trunk-g/gcc> strace -e execve -f ./xgcc -B.
t.c -v -Wl,-debug 2>&1 | grep gold
Configured with: /space/rguenther/src/svn/trunk/configure --disable-bootstrap
--disable-nls --disable-libstdcxx-pch --enable-lto --enable-gold
--with-plugin-ld=/usr/bin/gold
--enable-languages=c,ada,c++,fortran,java,lto,objc,obj-c++,go
[pid  7667] execve("/usr/bin/gold", ["/usr/bin/gold", "-plugin",
"./liblto_plugin.so", "-plugin-opt=./lto-wrapper",
"-plugin-opt=-fresolution=/tmp/cc"..., "-plugin-opt=-pass-through=-lgcc",
"-plugin-opt=-pass-through=-lgcc_"..., "-plugin-opt=-pass-through=-lc",
"-plugin-opt=-pass-through=-lgcc", "-plugin-opt=-pass-through=-lgcc_"...,
"--eh-frame-hdr", "-m", "elf_x86_64", "-dynamic-linker",
"/lib64/ld-linux-x86-64.so.2", "/usr/lib/../lib64/crt1.o", ...], [/* 91 vars
*/]) = 0


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

* [Bug driver/47244] [4.6 Regression] plugin linker is used unconditionally
  2011-01-10 16:15 [Bug driver/47244] New: [4.6 Regression] plugin linker is used unconditionally rguenth at gcc dot gnu.org
  2011-01-10 16:15 ` [Bug driver/47244] " rguenth at gcc dot gnu.org
@ 2011-01-11 13:30 ` hubicka at gcc dot gnu.org
  2011-01-11 14:06 ` hubicka at gcc dot gnu.org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: hubicka at gcc dot gnu.org @ 2011-01-11 13:30 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47244

Jan Hubicka <hubicka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2011.01.11 13:26:42
         AssignedTo|unassigned at gcc dot       |hubicka at gcc dot gnu.org
                   |gnu.org                     |
     Ever Confirmed|0                           |1

--- Comment #1 from Jan Hubicka <hubicka at gcc dot gnu.org> 2011-01-11 13:26:42 UTC ---
This change was intentional.
We will need to use linker plugin unconditionally for slim LTO support, but per
discussion with Richard, we should switch to this only for next stage1 as slim
LTO is not getting into 4.6.0.

I guess we only need to update SPECs to test -flto, should be easy.


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

* [Bug driver/47244] [4.6 Regression] plugin linker is used unconditionally
  2011-01-10 16:15 [Bug driver/47244] New: [4.6 Regression] plugin linker is used unconditionally rguenth at gcc dot gnu.org
  2011-01-10 16:15 ` [Bug driver/47244] " rguenth at gcc dot gnu.org
  2011-01-11 13:30 ` hubicka at gcc dot gnu.org
@ 2011-01-11 14:06 ` hubicka at gcc dot gnu.org
  2011-01-11 14:07 ` dominiq at lps dot ens.fr
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: hubicka at gcc dot gnu.org @ 2011-01-11 14:06 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47244

--- Comment #2 from Jan Hubicka <hubicka at gcc dot gnu.org> 2011-01-11 14:03:29 UTC ---
testing the following patch.
Index: gcc.c
===================================================================
--- gcc.c       (revision 168655)
+++ gcc.c       (working copy)
@@ -621,11 +621,18 @@
 # endif
 #endif

-/* Conditional to test whether plugin is used or not.  */
+/* Conditional to test whether plugin is used or not.
+   FIXME: For slim LTO we will need to enable plugin unconditionally.  This
+   still cause problems with PLUGIN_LD != LD and when plugin is built but
+   not useable.  For GCC 4.6 we don't support slim LTO and thus we can enable
+   plugin only when LTO is enabled.  We still honor explicit
+   -fuse-linker-plugin.  */
 #ifdef HAVE_LTO_PLUGIN
-#define PLUGIN_COND "!fno-use-linker-plugin"
+#define PLUGIN_COND "!fno-use-linker-plugin:%{flto|flto=*|fuse-linker-plugin"
+#define PLUGIN_COND_CLOSE "}"
 #else
 #define PLUGIN_COND "fuse-linker-plugin"
+#define PLUGIN_COND_CLOSE ""
 #endif


@@ -646,9 +653,9 @@
     -plugin-opt=%(lto_wrapper) \
     -plugin-opt=-fresolution=%u.res \
     %{!nostdlib:%{!nodefaultlibs:%:pass-through-libs(%(link_gcc_c_sequence))}}
\
-    } \
-    %{flto*:%<fcompare-debug*} \
-    %{flto*} %l " LINK_PIE_SPEC \
+    }"PLUGIN_COND_CLOSE" \
+    %{flto,flto=*:%<fcompare-debug*} \
+    %{flto,flto=*} %l " LINK_PIE_SPEC \
    "%X %{o*} %{e*} %{N} %{n} %{r}\
     %{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!nostartfiles:%S}}\
     %{static:} %{L*} %(mfwrap) %(link_libgcc) %o\


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

* [Bug driver/47244] [4.6 Regression] plugin linker is used unconditionally
  2011-01-10 16:15 [Bug driver/47244] New: [4.6 Regression] plugin linker is used unconditionally rguenth at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2011-01-11 14:06 ` hubicka at gcc dot gnu.org
@ 2011-01-11 14:07 ` dominiq at lps dot ens.fr
  2011-01-11 14:09   ` Jan Hubicka
  2011-01-11 14:11 ` hubicka at ucw dot cz
                   ` (5 subsequent siblings)
  9 siblings, 1 reply; 12+ messages in thread
From: dominiq at lps dot ens.fr @ 2011-01-11 14:07 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47244

--- Comment #3 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2011-01-11 14:06:26 UTC ---
Is pr39968 related (a duplicate) of this pr?


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

* Re: [Bug driver/47244] [4.6 Regression] plugin linker is used unconditionally
  2011-01-11 14:07 ` dominiq at lps dot ens.fr
@ 2011-01-11 14:09   ` Jan Hubicka
  0 siblings, 0 replies; 12+ messages in thread
From: Jan Hubicka @ 2011-01-11 14:09 UTC (permalink / raw)
  To: dominiq at lps dot ens.fr; +Cc: gcc-bugs

> Is pr39968 related (a duplicate) of this pr?
No, it is older than the problem and it is about plugins, not lto-plugin.
Perhaps plugins Make also needs to play the games with --enable-shared I added into lto-plugin configury.

Honza


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

* [Bug driver/47244] [4.6 Regression] plugin linker is used unconditionally
  2011-01-10 16:15 [Bug driver/47244] New: [4.6 Regression] plugin linker is used unconditionally rguenth at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2011-01-11 14:07 ` dominiq at lps dot ens.fr
@ 2011-01-11 14:11 ` hubicka at ucw dot cz
  2011-01-11 16:48 ` hubicka at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: hubicka at ucw dot cz @ 2011-01-11 14:11 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47244

--- Comment #4 from Jan Hubicka <hubicka at ucw dot cz> 2011-01-11 14:08:41 UTC ---
> Is pr39968 related (a duplicate) of this pr?
No, it is older than the problem and it is about plugins, not lto-plugin.
Perhaps plugins Make also needs to play the games with --enable-shared I added
into lto-plugin configury.

Honza


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

* [Bug driver/47244] [4.6 Regression] plugin linker is used unconditionally
  2011-01-10 16:15 [Bug driver/47244] New: [4.6 Regression] plugin linker is used unconditionally rguenth at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2011-01-11 14:11 ` hubicka at ucw dot cz
@ 2011-01-11 16:48 ` hubicka at gcc dot gnu.org
  2011-01-12 16:57 ` hubicka at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: hubicka at gcc dot gnu.org @ 2011-01-11 16:48 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47244

--- Comment #5 from Jan Hubicka <hubicka at gcc dot gnu.org> 2011-01-11 16:46:40 UTC ---
path posted. http://gcc.gnu.org/ml/gcc-patches/2011-01/msg00654.html


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

* [Bug driver/47244] [4.6 Regression] plugin linker is used unconditionally
  2011-01-10 16:15 [Bug driver/47244] New: [4.6 Regression] plugin linker is used unconditionally rguenth at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2011-01-11 16:48 ` hubicka at gcc dot gnu.org
@ 2011-01-12 16:57 ` hubicka at gcc dot gnu.org
  2011-01-12 17:03 ` hubicka at gcc dot gnu.org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: hubicka at gcc dot gnu.org @ 2011-01-12 16:57 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47244

--- Comment #6 from Jan Hubicka <hubicka at gcc dot gnu.org> 2011-01-12 15:47:36 UTC ---
Author: hubicka
Date: Wed Jan 12 15:47:29 2011
New Revision: 168717

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=168717
Log:
    PR driver/47244
    * gcc.c (PLUGIN_COND): Update to disable plugin unless -flto is used.
    (PLUGIN_COND_CLOSE): New macro.
    (LINK_COMMAND_SPEC): Update to use PLUGIN_COND_CLOSE.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/gcc.c


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

* [Bug driver/47244] [4.6 Regression] plugin linker is used unconditionally
  2011-01-10 16:15 [Bug driver/47244] New: [4.6 Regression] plugin linker is used unconditionally rguenth at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2011-01-12 16:57 ` hubicka at gcc dot gnu.org
@ 2011-01-12 17:03 ` hubicka at gcc dot gnu.org
  2011-01-14 12:40 ` rguenth at gcc dot gnu.org
  2011-01-14 14:49 ` rguenth at gcc dot gnu.org
  9 siblings, 0 replies; 12+ messages in thread
From: hubicka at gcc dot gnu.org @ 2011-01-12 17:03 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47244

Jan Hubicka <hubicka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #7 from Jan Hubicka <hubicka at gcc dot gnu.org> 2011-01-12 15:48:22 UTC ---
fixed.


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

* [Bug driver/47244] [4.6 Regression] plugin linker is used unconditionally
  2011-01-10 16:15 [Bug driver/47244] New: [4.6 Regression] plugin linker is used unconditionally rguenth at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2011-01-12 17:03 ` hubicka at gcc dot gnu.org
@ 2011-01-14 12:40 ` rguenth at gcc dot gnu.org
  2011-01-14 14:49 ` rguenth at gcc dot gnu.org
  9 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-01-14 12:40 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47244

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |

--- Comment #8 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-01-14 12:32:22 UTC ---
Your fix does not work.

> /abuild/rguenther/trunk-g/gcc/xgcc -B/abuild/rguenther/trunk-g/gcc/ /space/rguenther/src/svn/trunk/gcc/testsuite/gcc.dg/tree-ssa/pr46076.c -O2 -lm -o pr46076.exe -v
...
/abuild/rguenther/trunk-g/gcc/collect2 -plugin
/abuild/rguenther/trunk-g/gcc/liblto_plugin.so
-plugin-opt=/abuild/rguenther/trunk-g/gcc/lto-wrapper
-plugin-opt=-fresolution=/tmp/cc3HveYS.res -plugin-opt=-pass-through=-lgcc
-plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc
-plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s
--eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o
pr46076.exe /usr/lib/../lib64/crt1.o /usr/lib/../lib64/crti.o
/abuild/rguenther/trunk-g/gcc/crtbegin.o -L/abuild/rguenther/trunk-g/gcc
-L/lib/../lib64 -L/usr/lib/../lib64 /tmp/cc8pWTze.o -lm -lgcc --as-needed
-lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed
/abuild/rguenther/trunk-g/gcc/crtend.o /usr/lib/../lib64/crtn.o
/usr/bin/gold: /tmp/cc8pWTze.o: in function main:pr46076.c(.text.startup+0x20):
error: undefined reference to 'link_error'


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

* [Bug driver/47244] [4.6 Regression] plugin linker is used unconditionally
  2011-01-10 16:15 [Bug driver/47244] New: [4.6 Regression] plugin linker is used unconditionally rguenth at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2011-01-14 12:40 ` rguenth at gcc dot gnu.org
@ 2011-01-14 14:49 ` rguenth at gcc dot gnu.org
  9 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-01-14 14:49 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47244

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #9 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-01-14 14:28:33 UTC ---
It works.  Got bitten by

> ./xgcc -B. t.c -v
Reading specs from ./specs


... (again)


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

end of thread, other threads:[~2011-01-14 14:28 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-10 16:15 [Bug driver/47244] New: [4.6 Regression] plugin linker is used unconditionally rguenth at gcc dot gnu.org
2011-01-10 16:15 ` [Bug driver/47244] " rguenth at gcc dot gnu.org
2011-01-11 13:30 ` hubicka at gcc dot gnu.org
2011-01-11 14:06 ` hubicka at gcc dot gnu.org
2011-01-11 14:07 ` dominiq at lps dot ens.fr
2011-01-11 14:09   ` Jan Hubicka
2011-01-11 14:11 ` hubicka at ucw dot cz
2011-01-11 16:48 ` hubicka at gcc dot gnu.org
2011-01-12 16:57 ` hubicka at gcc dot gnu.org
2011-01-12 17:03 ` hubicka at gcc dot gnu.org
2011-01-14 12:40 ` rguenth at gcc dot gnu.org
2011-01-14 14:49 ` rguenth at gcc dot gnu.org

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).