[Boost-bugs] [Boost C++ Libraries] #6903: Including program options header breaks using g++ -static -flto -std=c++11

Subject: [Boost-bugs] [Boost C++ Libraries] #6903: Including program options header breaks using g++ -static -flto -std=c++11
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-05-15 13:30:11


#6903: Including program options header breaks using g++ -static -flto -std=c++11
------------------------------------+---------------------------------------
 Reporter: boostBugs@… | Owner: vladimir_prus
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: program_options
  Version: Boost 1.49.0 | Severity: Problem
 Keywords: g++ lto |
------------------------------------+---------------------------------------
 A minimal example is simply

 {{{
 #include "boost/program_options.hpp"

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

 Compiling this using either[[BR]]
 g++ main.cpp -static -flto -std=c++11 -fwhole-program[[BR]]
 or[[BR]]
 g++ main.cpp -static -flto -std=c++11 -fno-use-linker-plugin[[BR]]
 gives a lot of 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)[[BR]]
 ...[[BR]]
 collect2: error: ld returned 1 exit status


 I tried g++4.6 and 4.7. I am not sure if it is a bug within the g++ or
 within boost. If either -static, -flto or -std=c++11 is omited the program
 compiles fine. Only if all three are present the error occours. I am using
 Debian Wheezy.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/6903>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:09 UTC