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

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