[Boost-bugs] [Boost C++ Libraries] #7241: Boost.Thread brings in (too much of?) Boost.System

Subject: [Boost-bugs] [Boost C++ Libraries] #7241: Boost.Thread brings in (too much of?) Boost.System
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-08-16 13:55:06


#7241: Boost.Thread brings in (too much of?) Boost.System
---------------------------------+------------------------------------------
 Reporter: pmachata@… | Type: Bugs
   Status: new | Milestone: To Be Determined
Component: None | Version: Boost 1.50.0
 Severity: Problem | Keywords:
---------------------------------+------------------------------------------
 This came up in 1.50 that was recently introduced to Fedora Linux. The
 following example program shows the issue:

 {{{
 #include <boost/thread.hpp>
 int main () {
   boost::thread t;
 }
 }}}

 When an attempt to compile and link this with -lboost_thread-mt is done,
 something like the following happens:

 {{{
 /usr/bin/ld: /tmp/ccAv0B8G.o: undefined reference to symbol
 '_ZN5boost6system15system_categoryEv'
 /usr/bin/ld: note: '_ZN5boost6system15system_categoryEv' is defined in DSO
 /lib64/libboost_system-mt.so.1.50.0 so try adding it to the linker command
 line
 }}}

 Dependency between libboost_thread and libboost_system is set up
 correctly. The problem is that due to includes in Boost.Thread header
 files, this undefined symbol appears in the application object, and the
 program linker then requires that it be satisfied by a direct dependency,
 not a transitive one.

 The solution that we implemented in Fedora (as opposed to forcing everyone
 put both -l's on command line) was to replace libboost_thread-mt.so with a
 linker script like this:

 {{{
 INPUT(libboost_thread-mt.so.1.50.0)
 INPUT(libboost_system-mt.so.1.50.0)
 }}}

 I'm not sure if it is feasible to put this into official Boost
 distribution (what with all the platforms that it needs to support, and
 this being chiefly Linux problem with a very Linux-centric solution). But
 I'm interested whether it is really necessary to have the symbol appear in
 client binaries. Having to link in Boost.System DSO's when all you use is
 Boost.Thread is awkward.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/7241>
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:10 UTC