public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/53604] New: ld reports errors using lto after upgrading from gcc-4.6.2 to gcc-4.7.0
@ 2012-06-07 15:10 paul.scruby at ghco dot co.uk
  2012-06-07 15:51 ` [Bug lto/53604] " hjl.tools at gmail dot com
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: paul.scruby at ghco dot co.uk @ 2012-06-07 15:10 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53604
           Summary: ld reports errors using lto after upgrading from
                    gcc-4.6.2 to gcc-4.7.0
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: paul.scruby@ghco.co.uk


I recently tried to upgrade from gcc-4.6.2 to gcc-4.7.0.  I have been using the
lto with gcc-4.6.2 and binutils-2.22 for a while with no problems.

However, since I upgraded to gcc-4.7.0 ld is getting "hidden symbol isn't
defined" errors, something like this when I try to link with my static
libraries and a boost shared object:

  $  /opt/gcc-4.7.0/bin/g++ -o /home/pauls/repos/build/bin/my_app
-static-libstdc++ -m64 -march=corei7 -Wl,-rpath,/opt/boost-1.44/lib
-L/opt/boost-1.44/lib -flto -O3 -fuse-linker-plugin
-L/home/pauls/repos/build/lib /home/pauls/repos/build/obj/my_app.o -lmy_lib
-lboost_regex -ldl -lrt
 
`_ZThn16_N5boost16exception_detail10clone_implINS0_19error_info_injectorISt11logic_errorEEED1Ev'
referenced in section `.data.rel.ro' of /tmp/cc0n7i0I.ltrans12.ltrans.o:
defined in discarded section
`.gnu.linkonce.t._ZN5boost16exception_detail10clone_implINS0_19error_info_injectorISt11logic_errorEEED5Ev'
of /home/pauls/repos/build/obj/my_app.o (symbol from plugin)
 
/opt/gcc-4.7.0/lib/gcc/x86_64-fedora-linux/4.7.0/../../../../x86_64-fedora-linux/bin/ld:
/home/pauls/repos/build/bin/my_app: hidden symbol `.LTHUNK11.6239' isn't
defined

binutils 2.22 was pre-installed into:
  $ /opt/gcc-4.7.0

gcc4.7.0 was build with:
  $ export PATH=/opt/gcc-4.7.0/bin/:$PATH
  $ ../configure --prefix=/opt/gcc-4.7.0 --build=x86_64-fedora-linux
--with-system-zlib --enable-plugin --enable-bootstrap --enable-shared
--enable-threads=posix --enable-languages=c,c++ --disable-checking
--disable-libunwind-exceptions

I tried upgrading to binutils-2.22.52 to see if was an issue with ld that had
recently been patched, but I got the same error.  

I also tried upgrading from boost-1.44 to boost-1.49 to see if it was an issue
with boost exception code, but I also got the same error.

Thanks,

Paul


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

* [Bug lto/53604] ld reports errors using lto after upgrading from gcc-4.6.2 to gcc-4.7.0
  2012-06-07 15:10 [Bug lto/53604] New: ld reports errors using lto after upgrading from gcc-4.6.2 to gcc-4.7.0 paul.scruby at ghco dot co.uk
@ 2012-06-07 15:51 ` hjl.tools at gmail dot com
  2012-06-07 17:14 ` paul.scruby at ghco dot co.uk
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: hjl.tools at gmail dot com @ 2012-06-07 15:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> 2012-06-07 15:50:56 UTC ---
I think it is a dup for PR 53572.  Can you try patch at

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53572#c3


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

* [Bug lto/53604] ld reports errors using lto after upgrading from gcc-4.6.2 to gcc-4.7.0
  2012-06-07 15:10 [Bug lto/53604] New: ld reports errors using lto after upgrading from gcc-4.6.2 to gcc-4.7.0 paul.scruby at ghco dot co.uk
  2012-06-07 15:51 ` [Bug lto/53604] " hjl.tools at gmail dot com
@ 2012-06-07 17:14 ` paul.scruby at ghco dot co.uk
  2012-06-11 17:04 ` tetra2005 at gmail dot com
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: paul.scruby at ghco dot co.uk @ 2012-06-07 17:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Paul Scruby <paul.scruby at ghco dot co.uk> 2012-06-07 17:14:13 UTC ---
The 4.7.0 code is different so the patch didn't work:
  'struct varpool_node' has no member named 'symbol'

I'm not familiar with the gcc internals so I'm not sure what I need to add to
4.7.0 to fix this?

If this is the function in question, what do I need to add to fix this problem?

static inline bool
varpool_can_remove_if_no_refs (struct varpool_node *node)
{
  return (!node->force_output && !node->used_from_other_partition
      && (flag_toplevel_reorder || DECL_COMDAT (node->decl)
          || DECL_ARTIFICIAL (node->decl))
        && (DECL_COMDAT (node->decl) || !node->externally_visible));
}

Thanks,

Paul


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

* [Bug lto/53604] ld reports errors using lto after upgrading from gcc-4.6.2 to gcc-4.7.0
  2012-06-07 15:10 [Bug lto/53604] New: ld reports errors using lto after upgrading from gcc-4.6.2 to gcc-4.7.0 paul.scruby at ghco dot co.uk
  2012-06-07 15:51 ` [Bug lto/53604] " hjl.tools at gmail dot com
  2012-06-07 17:14 ` paul.scruby at ghco dot co.uk
@ 2012-06-11 17:04 ` tetra2005 at gmail dot com
  2012-06-12 10:42 ` rguenth at gcc dot gnu.org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: tetra2005 at gmail dot com @ 2012-06-11 17:04 UTC (permalink / raw)
  To: gcc-bugs

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

Yuri Gribov <tetra2005 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tetra2005 at gmail dot com

--- Comment #3 from Yuri Gribov <tetra2005 at gmail dot com> 2012-06-11 17:04:42 UTC ---
Paul,

I changed to 

  static inline bool
  varpool_can_remove_if_no_refs (struct varpool_node *node)
  {
    return (!node->force_output && !node->used_from_other_partition
            && (flag_toplevel_reorder || DECL_COMDAT (node->decl)
                || DECL_ARTIFICIAL (node->decl))
            && ((DECL_COMDAT (node->decl) && !varpool_used_from_object_file_p
(node)) || !node->externally_visible));
  }

and it helped.


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

* [Bug lto/53604] ld reports errors using lto after upgrading from gcc-4.6.2 to gcc-4.7.0
  2012-06-07 15:10 [Bug lto/53604] New: ld reports errors using lto after upgrading from gcc-4.6.2 to gcc-4.7.0 paul.scruby at ghco dot co.uk
                   ` (2 preceding siblings ...)
  2012-06-11 17:04 ` tetra2005 at gmail dot com
@ 2012-06-12 10:42 ` rguenth at gcc dot gnu.org
  2012-06-13 11:57 ` paul.scruby at ghco dot co.uk
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-06-12 10:42 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE

--- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-06-12 10:42:15 UTC ---
dup

*** This bug has been marked as a duplicate of bug 53572 ***


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

* [Bug lto/53604] ld reports errors using lto after upgrading from gcc-4.6.2 to gcc-4.7.0
  2012-06-07 15:10 [Bug lto/53604] New: ld reports errors using lto after upgrading from gcc-4.6.2 to gcc-4.7.0 paul.scruby at ghco dot co.uk
                   ` (3 preceding siblings ...)
  2012-06-12 10:42 ` rguenth at gcc dot gnu.org
@ 2012-06-13 11:57 ` paul.scruby at ghco dot co.uk
  2012-06-13 12:30 ` tetra2005 at gmail dot com
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: paul.scruby at ghco dot co.uk @ 2012-06-13 11:57 UTC (permalink / raw)
  To: gcc-bugs

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

Paul Scruby <paul.scruby at ghco dot co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|DUPLICATE                   |

--- Comment #5 from Paul Scruby <paul.scruby at ghco dot co.uk> 2012-06-13 11:56:53 UTC ---
Thanks Yuri.  I swapped out this function with yours but ld was still unable to
link.  I'm trying linking to my own libraries statically using the lto and the
boost shared libraries.  Linking to one of the other seems to be fine.

I'm not sure if this is the same bug as bug 53572 (gcc4.7.1) or a different
one.  If you can point me in the direction of a gcc4.7.1 release, I'm happy to
test my build to see if this problem has now been resolved.

Thanks again,

Paul


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

* [Bug lto/53604] ld reports errors using lto after upgrading from gcc-4.6.2 to gcc-4.7.0
  2012-06-07 15:10 [Bug lto/53604] New: ld reports errors using lto after upgrading from gcc-4.6.2 to gcc-4.7.0 paul.scruby at ghco dot co.uk
                   ` (4 preceding siblings ...)
  2012-06-13 11:57 ` paul.scruby at ghco dot co.uk
@ 2012-06-13 12:30 ` tetra2005 at gmail dot com
  2012-06-13 14:29 ` redi at gcc dot gnu.org
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: tetra2005 at gmail dot com @ 2012-06-13 12:30 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Yuri Gribov <tetra2005 at gmail dot com> 2012-06-13 12:30:27 UTC ---
Paul,

I used April version of Linaro gcc toolchain so you may want to give it a try.
If it still doesn't work you'll probably need to attach a repro code here.


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

* [Bug lto/53604] ld reports errors using lto after upgrading from gcc-4.6.2 to gcc-4.7.0
  2012-06-07 15:10 [Bug lto/53604] New: ld reports errors using lto after upgrading from gcc-4.6.2 to gcc-4.7.0 paul.scruby at ghco dot co.uk
                   ` (5 preceding siblings ...)
  2012-06-13 12:30 ` tetra2005 at gmail dot com
@ 2012-06-13 14:29 ` redi at gcc dot gnu.org
  2012-06-13 14:34 ` paul.scruby at ghco dot co.uk
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: redi at gcc dot gnu.org @ 2012-06-13 14:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-06-13 14:28:54 UTC ---
4.7.1 is due out Real Soon Now, the release candidate can be found on any GNU
mirror:
ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/snapshots/4.7.1-RC-20120606/


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

* [Bug lto/53604] ld reports errors using lto after upgrading from gcc-4.6.2 to gcc-4.7.0
  2012-06-07 15:10 [Bug lto/53604] New: ld reports errors using lto after upgrading from gcc-4.6.2 to gcc-4.7.0 paul.scruby at ghco dot co.uk
                   ` (6 preceding siblings ...)
  2012-06-13 14:29 ` redi at gcc dot gnu.org
@ 2012-06-13 14:34 ` paul.scruby at ghco dot co.uk
  2012-06-13 16:44 ` paul.scruby at ghco dot co.uk
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: paul.scruby at ghco dot co.uk @ 2012-06-13 14:34 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Paul Scruby <paul.scruby at ghco dot co.uk> 2012-06-13 14:34:38 UTC ---
Cheers Jon, I'll try this afternoon...


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

* [Bug lto/53604] ld reports errors using lto after upgrading from gcc-4.6.2 to gcc-4.7.0
  2012-06-07 15:10 [Bug lto/53604] New: ld reports errors using lto after upgrading from gcc-4.6.2 to gcc-4.7.0 paul.scruby at ghco dot co.uk
                   ` (7 preceding siblings ...)
  2012-06-13 14:34 ` paul.scruby at ghco dot co.uk
@ 2012-06-13 16:44 ` paul.scruby at ghco dot co.uk
  2012-06-14  8:16 ` paul.scruby at ghco dot co.uk
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: paul.scruby at ghco dot co.uk @ 2012-06-13 16:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Paul Scruby <paul.scruby at ghco dot co.uk> 2012-06-13 16:44:12 UTC ---
Unfortunately I still have this linking issue with gcc-4.7.1-RC-20120606 and
binutils-2.22 so I don't think it's a dup for PR 53572.

I'll try to make a standalone project tomorrow which demonstrates this problem
and attachment it to this report to see if someone else can reproduce it.  It
might not be a bug, I might just need to change the arguments that I'm passing
to link my app.

Thanks again,

Paul


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

* [Bug lto/53604] ld reports errors using lto after upgrading from gcc-4.6.2 to gcc-4.7.0
  2012-06-07 15:10 [Bug lto/53604] New: ld reports errors using lto after upgrading from gcc-4.6.2 to gcc-4.7.0 paul.scruby at ghco dot co.uk
                   ` (8 preceding siblings ...)
  2012-06-13 16:44 ` paul.scruby at ghco dot co.uk
@ 2012-06-14  8:16 ` paul.scruby at ghco dot co.uk
  2012-06-14 11:46 ` paul.scruby at ghco dot co.uk
  2012-09-06 13:03 ` paul.scruby at ghco dot co.uk
  11 siblings, 0 replies; 13+ messages in thread
From: paul.scruby at ghco dot co.uk @ 2012-06-14  8:16 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Paul Scruby <paul.scruby at ghco dot co.uk> 2012-06-14 08:16:28 UTC ---
I released that I needed to add Yuri's patch to gcc-4.7.1.RC-20120606 as it had
not made it into the trunk.  However, this still made no difference and I still
had the same linking problem.  I'll try to hack together a standalone example
today that I can attach to the report to see if someone can reproduce it.


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

* [Bug lto/53604] ld reports errors using lto after upgrading from gcc-4.6.2 to gcc-4.7.0
  2012-06-07 15:10 [Bug lto/53604] New: ld reports errors using lto after upgrading from gcc-4.6.2 to gcc-4.7.0 paul.scruby at ghco dot co.uk
                   ` (9 preceding siblings ...)
  2012-06-14  8:16 ` paul.scruby at ghco dot co.uk
@ 2012-06-14 11:46 ` paul.scruby at ghco dot co.uk
  2012-09-06 13:03 ` paul.scruby at ghco dot co.uk
  11 siblings, 0 replies; 13+ messages in thread
From: paul.scruby at ghco dot co.uk @ 2012-06-14 11:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from Paul Scruby <paul.scruby at ghco dot co.uk> 2012-06-14 11:46:32 UTC ---
I've written half a dozen test harnesses this morning to tried to recreate this
bug unsuccessfully.  My team writes very low-latency code so they do quite a
lot of 'abusive' (but legal) partial specialization tricks force some
optimizations and branch predications on certain paths.  I suspect that some of
this nastiness is creating bloat which is not playing ball in LTO land.

Unfortunately, these lto bugs are really hard to recreate and I have to finish
some work on other projects, but I will try to pick this up and get implement
this test harness when I get a chance.  For the time being we'll stick with
gcc-4.6.2 which is working really nicely for us...

Thanks for all your help,

Paul


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

* [Bug lto/53604] ld reports errors using lto after upgrading from gcc-4.6.2 to gcc-4.7.0
  2012-06-07 15:10 [Bug lto/53604] New: ld reports errors using lto after upgrading from gcc-4.6.2 to gcc-4.7.0 paul.scruby at ghco dot co.uk
                   ` (10 preceding siblings ...)
  2012-06-14 11:46 ` paul.scruby at ghco dot co.uk
@ 2012-09-06 13:03 ` paul.scruby at ghco dot co.uk
  11 siblings, 0 replies; 13+ messages in thread
From: paul.scruby at ghco dot co.uk @ 2012-09-06 13:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from Paul Scruby <paul.scruby at ghco dot co.uk> 2012-09-06 13:03:17 UTC ---
I just tried Matt Hargett's patch from Bug53572 with gcc4.7.1 and it still has
not fixed the problem we're having.  I'll continue test these issues in our
codebase with new versions of gcc as they're released.  If I get some more time
which I don't have at the moment, I'll try to replicate it with a standalone
example.

Thanks,

Paul


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

end of thread, other threads:[~2012-09-06 13:03 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-07 15:10 [Bug lto/53604] New: ld reports errors using lto after upgrading from gcc-4.6.2 to gcc-4.7.0 paul.scruby at ghco dot co.uk
2012-06-07 15:51 ` [Bug lto/53604] " hjl.tools at gmail dot com
2012-06-07 17:14 ` paul.scruby at ghco dot co.uk
2012-06-11 17:04 ` tetra2005 at gmail dot com
2012-06-12 10:42 ` rguenth at gcc dot gnu.org
2012-06-13 11:57 ` paul.scruby at ghco dot co.uk
2012-06-13 12:30 ` tetra2005 at gmail dot com
2012-06-13 14:29 ` redi at gcc dot gnu.org
2012-06-13 14:34 ` paul.scruby at ghco dot co.uk
2012-06-13 16:44 ` paul.scruby at ghco dot co.uk
2012-06-14  8:16 ` paul.scruby at ghco dot co.uk
2012-06-14 11:46 ` paul.scruby at ghco dot co.uk
2012-09-06 13:03 ` paul.scruby at ghco dot co.uk

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