Subject: [Boost-bugs] [Boost C++ Libraries] #9041: [thread] Boost.Thread DSO's may need to link with Boost.Atomic
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-08-23 22:44:22
#9041: [thread] Boost.Thread DSO's may need to link with Boost.Atomic
---------------------------------------+----------------------
Reporter: Petr Machata <pmachata@â¦> | Owner: anthonyw
Type: Bugs | Status: new
Milestone: To Be Determined | Component: thread
Version: Boost 1.54.0 | Severity: Problem
Keywords: |
---------------------------------------+----------------------
libs/thread/src/pthread/once.cpp includes
libs/thread/src/pthread/once_atomic.cpp, which includes boost/atomic.hpp,
which (transitively) includes boost/atomic/detail/lockpool.hpp, which,
depending on whether BOOST_ATOMIC_FLAG_LOCK_FREE is set, may need external
reference to boost::atomics::detail::lockpool::get_lock_for(void const
volatile *), defined in libbost_atomic.so.1.54.0.
On most targets, BOOST_ATOMIC_FLAG_LOCK_FREE is set and the external
reference is not necessary. On some, such as s390, it's not, and when
linking to libboost_thread.so.1.54.0, the linker complains about
unsatisfied references to above-mentioned symbol, such as:
{{{
/lib64/libboost_thread.so.1.54.0: undefined reference to
`boost::atomics::detail::lockpool::get_lock_for(void const volatile*)'
}}}
In attached patch, I resolve this by testing whether
BOOST_ATOMIC_FLAG_LOCK_FREE is defined. If not, I set up linking of
libboost_atomic.so.1.54.0.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/9041> 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:13 UTC