public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/52900] New: Compile source using Boost header with -static -flto -std=c++11 breaks
@ 2012-04-07 14:26 gccBugs at haatschii dot de
  2012-04-07 18:14 ` [Bug c++/52900] " pinskia at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: gccBugs at haatschii dot de @ 2012-04-07 14:26 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 52900
           Summary: Compile source using Boost header with -static -flto
                    -std=c++11 breaks
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: gccBugs@haatschii.de


A minimal source creating the error is:

#include "boost/program_options.hpp"

int main ( int argC, char* argV[] )
{
    return 0;
}

Where "boost/program_options.hpp" is the Boost header file (Version 104700).

When compiling this source using:
g++-4.7 test.cpp -I ../includes -std=c++0x -static -flto

I get the following errors:
`_ZTIN9__gnu_cxx24__concurrence_lock_errorE' referenced in section
`.text._ZN9__gnu_cxx30__throw_concurrence_lock_errorEv[_ZN9__gnu_cxx30__throw_concurrence_lock_errorEv]'
of /usr/lib/gcc/x86_64-linux-gnu/4.7/libstdc++.a(eh_alloc.o): defined in
discarded section `.gnu.linkonce.t._ZTIN9__gnu_cxx24__concurrence_lock_errorE'
of /tmp/ccEoPVoT.o (symbol from plugin)
`_ZTIN9__gnu_cxx26__concurrence_unlock_errorE' referenced in section
`.text.__cxa_allocate_exception' of
/usr/lib/gcc/x86_64-linux-gnu/4.7/libstdc++.a(eh_alloc.o): defined in discarded
section `.gnu.linkonce.t._ZTIN9__gnu_cxx26__concurrence_unlock_errorE' of
/tmp/ccEoPVoT.o (symbol from plugin)
`_ZTIN9__gnu_cxx26__concurrence_unlock_errorE' referenced in section
`.text.__cxa_free_exception' of
/usr/lib/gcc/x86_64-linux-gnu/4.7/libstdc++.a(eh_alloc.o): defined in discarded
section `.gnu.linkonce.t._ZTIN9__gnu_cxx26__concurrence_unlock_errorE' of
/tmp/ccEoPVoT.o (symbol from plugin)
`_ZTIN9__gnu_cxx26__concurrence_unlock_errorE' referenced in section
`.text.__cxa_allocate_dependent_exception' of
/usr/lib/gcc/x86_64-linux-gnu/4.7/libstdc++.a(eh_alloc.o): defined in discarded
section `.gnu.linkonce.t._ZTIN9__gnu_cxx26__concurrence_unlock_errorE' of
/tmp/ccEoPVoT.o (symbol from plugin)
`_ZTIN9__gnu_cxx26__concurrence_unlock_errorE' referenced in section
`.text.__cxa_free_dependent_exception' of
/usr/lib/gcc/x86_64-linux-gnu/4.7/libstdc++.a(eh_alloc.o): defined in discarded
section `.gnu.linkonce.t._ZTIN9__gnu_cxx26__concurrence_unlock_errorE' of
/tmp/ccEoPVoT.o (symbol from plugin)
`_ZTIN9__gnu_cxx24__concurrence_lock_errorE' referenced in section
`.data.rel.ro._ZTVN9__gnu_cxx24__concurrence_lock_errorE[_ZTVN9__gnu_cxx24__concurrence_lock_errorE]'
of /usr/lib/gcc/x86_64-linux-gnu/4.7/libstdc++.a(eh_alloc.o): defined in
discarded section `.gnu.linkonce.t._ZTIN9__gnu_cxx24__concurrence_lock_errorE'
of /tmp/ccEoPVoT.o (symbol from plugin)
`_ZTIN9__gnu_cxx26__concurrence_unlock_errorE' referenced in section
`.data.rel.ro._ZTVN9__gnu_cxx26__concurrence_unlock_errorE[_ZTVN9__gnu_cxx26__concurrence_unlock_errorE]'
of /usr/lib/gcc/x86_64-linux-gnu/4.7/libstdc++.a(eh_alloc.o): defined in
discarded section
`.gnu.linkonce.t._ZTIN9__gnu_cxx26__concurrence_unlock_errorE' of
/tmp/ccEoPVoT.o (symbol from plugin)
`_ZTIN9__gnu_cxx26__concurrence_unlock_errorE' referenced in section
`.text._ZN9__gnu_cxx32__throw_concurrence_unlock_errorEv[_ZN9__gnu_cxx32__throw_concurrence_unlock_errorEv]'
of /usr/lib/gcc/x86_64-linux-gnu/4.7/libstdc++.a(locale.o): defined in
discarded section
`.gnu.linkonce.t._ZTIN9__gnu_cxx26__concurrence_unlock_errorE' of
/tmp/ccEoPVoT.o (symbol from plugin)
`_ZTIN9__gnu_cxx24__concurrence_lock_errorE' referenced in section
`.text._ZNSt6locale5_Impl16_M_install_cacheEPKNS_5facetEm' of
/usr/lib/gcc/x86_64-linux-gnu/4.7/libstdc++.a(locale.o): defined in discarded
section `.gnu.linkonce.t._ZTIN9__gnu_cxx24__concurrence_lock_errorE' of
/tmp/ccEoPVoT.o (symbol from plugin)
collect2: error: ld returned 1 exit status

However it compiles fine when I omit either -static, -flto or -std=c++0x. Only
if all three options are present the error occurs. I am on Debian Wheezy. I
have tested the error with two g++ versions:
g++ (Debian 4.6.3-1) 4.6.3
g++-4.7 (Debian 4.7.0-1) 4.7.0

Hope this helps and feel free to contact me.


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

* [Bug c++/52900] Compile source using Boost header with -static -flto -std=c++11 breaks
  2012-04-07 14:26 [Bug c++/52900] New: Compile source using Boost header with -static -flto -std=c++11 breaks gccBugs at haatschii dot de
@ 2012-04-07 18:14 ` pinskia at gcc dot gnu.org
  2012-04-07 19:22 ` gccBugs at haatschii dot de
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-04-07 18:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-04-07 18:14:17 UTC ---
What version of binutils are you using (supply ld --version output)?  This
might have been be a binutils which is fixed already.

Also try -fno-use-linker-plugin.


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

* [Bug c++/52900] Compile source using Boost header with -static -flto -std=c++11 breaks
  2012-04-07 14:26 [Bug c++/52900] New: Compile source using Boost header with -static -flto -std=c++11 breaks gccBugs at haatschii dot de
  2012-04-07 18:14 ` [Bug c++/52900] " pinskia at gcc dot gnu.org
@ 2012-04-07 19:22 ` gccBugs at haatschii dot de
  2012-04-10 12:11 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: gccBugs at haatschii dot de @ 2012-04-07 19:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from gccBugs at haatschii dot de 2012-04-07 19:21:46 UTC ---
ld --version gives:
GNU ld (GNU Binutils for Debian) 2.22

I tried -fno-use-linker-plugin as well as -fwhole-program. No difference.


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

* [Bug c++/52900] Compile source using Boost header with -static -flto -std=c++11 breaks
  2012-04-07 14:26 [Bug c++/52900] New: Compile source using Boost header with -static -flto -std=c++11 breaks gccBugs at haatschii dot de
  2012-04-07 18:14 ` [Bug c++/52900] " pinskia at gcc dot gnu.org
  2012-04-07 19:22 ` gccBugs at haatschii dot de
@ 2012-04-10 12:11 ` rguenth at gcc dot gnu.org
  2012-04-10 20:38 ` gccBugs at haatschii dot de
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-04-10 12:11 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |lto
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2012-04-10
                 CC|                            |hubicka at gcc dot gnu.org
     Ever Confirmed|0                           |1

--- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-04-10 12:10:24 UTC ---
Please attach preprocessed source.


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

* [Bug c++/52900] Compile source using Boost header with -static -flto -std=c++11 breaks
  2012-04-07 14:26 [Bug c++/52900] New: Compile source using Boost header with -static -flto -std=c++11 breaks gccBugs at haatschii dot de
                   ` (2 preceding siblings ...)
  2012-04-10 12:11 ` rguenth at gcc dot gnu.org
@ 2012-04-10 20:38 ` gccBugs at haatschii dot de
  2012-05-06 18:47 ` gccBugs at haatschii dot de
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: gccBugs at haatschii dot de @ 2012-04-10 20:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from gccBugs at haatschii dot de 2012-04-10 20:37:36 UTC ---
To large to attach it directly:

http://haatschii.de/preprocessed_source.cpp


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

* [Bug c++/52900] Compile source using Boost header with -static -flto -std=c++11 breaks
  2012-04-07 14:26 [Bug c++/52900] New: Compile source using Boost header with -static -flto -std=c++11 breaks gccBugs at haatschii dot de
                   ` (3 preceding siblings ...)
  2012-04-10 20:38 ` gccBugs at haatschii dot de
@ 2012-05-06 18:47 ` gccBugs at haatschii dot de
  2012-06-25 12:49 ` Christopher.Hite at partner dot commerzbank.com
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: gccBugs at haatschii dot de @ 2012-05-06 18:47 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from gccBugs at haatschii dot de 2012-05-06 18:34:41 UTC ---
Could you reproduce the bug? Or do you need any more informations?


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

* [Bug c++/52900] Compile source using Boost header with -static -flto -std=c++11 breaks
  2012-04-07 14:26 [Bug c++/52900] New: Compile source using Boost header with -static -flto -std=c++11 breaks gccBugs at haatschii dot de
                   ` (4 preceding siblings ...)
  2012-05-06 18:47 ` gccBugs at haatschii dot de
@ 2012-06-25 12:49 ` Christopher.Hite at partner dot commerzbank.com
  2012-06-25 13:34 ` hjl.tools at gmail dot com
  2013-07-01  9:25 ` paolo.carlini at oracle dot com
  7 siblings, 0 replies; 9+ messages in thread
From: Christopher.Hite at partner dot commerzbank.com @ 2012-06-25 12:49 UTC (permalink / raw)
  To: gcc-bugs

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

Christopher Hite <Christopher.Hite at partner dot commerzbank.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |Christopher.Hite at partner
                   |                            |dot commerzbank.com

--- Comment #6 from Christopher Hite <Christopher.Hite at partner dot commerzbank.com> 2012-06-25 12:48:07 UTC ---
I'm suffering from this one too doing LTO.  Strangle only 5 of my unit tests
have the problem and my big binaries link fine.  Everything mentions:

typeinfo for __gnu_cxx::__concurrence_*

GNU ld (GNU Binutils) 2.22.52.20120621
g++ (GCC) 4.7.0
boost_1_49_0

I also use boost, but most don't use program options.

This is the 3rd LTO bug I've got open.  I'm wondering if I should back off LTO.


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

* [Bug c++/52900] Compile source using Boost header with -static -flto -std=c++11 breaks
  2012-04-07 14:26 [Bug c++/52900] New: Compile source using Boost header with -static -flto -std=c++11 breaks gccBugs at haatschii dot de
                   ` (5 preceding siblings ...)
  2012-06-25 12:49 ` Christopher.Hite at partner dot commerzbank.com
@ 2012-06-25 13:34 ` hjl.tools at gmail dot com
  2013-07-01  9:25 ` paolo.carlini at oracle dot com
  7 siblings, 0 replies; 9+ messages in thread
From: hjl.tools at gmail dot com @ 2012-06-25 13:34 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from H.J. Lu <hjl.tools at gmail dot com> 2012-06-25 13:33:33 UTC ---
This may be a dup for PR 53572.  You can try its fix.


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

* [Bug c++/52900] Compile source using Boost header with -static -flto -std=c++11 breaks
  2012-04-07 14:26 [Bug c++/52900] New: Compile source using Boost header with -static -flto -std=c++11 breaks gccBugs at haatschii dot de
                   ` (6 preceding siblings ...)
  2012-06-25 13:34 ` hjl.tools at gmail dot com
@ 2013-07-01  9:25 ` paolo.carlini at oracle dot com
  7 siblings, 0 replies; 9+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-07-01  9:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Note, per the bug submitting instructions, no URLs, please. If you are still
having problems in this area please add here a minimized (there are many tools
available for that, see our wiki) self-contained testcase.


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

end of thread, other threads:[~2013-07-01  9:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-07 14:26 [Bug c++/52900] New: Compile source using Boost header with -static -flto -std=c++11 breaks gccBugs at haatschii dot de
2012-04-07 18:14 ` [Bug c++/52900] " pinskia at gcc dot gnu.org
2012-04-07 19:22 ` gccBugs at haatschii dot de
2012-04-10 12:11 ` rguenth at gcc dot gnu.org
2012-04-10 20:38 ` gccBugs at haatschii dot de
2012-05-06 18:47 ` gccBugs at haatschii dot de
2012-06-25 12:49 ` Christopher.Hite at partner dot commerzbank.com
2012-06-25 13:34 ` hjl.tools at gmail dot com
2013-07-01  9:25 ` paolo.carlini at oracle dot com

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