boost::asio uses static member variables in a header-only library to
provide thread local storage. When boost::asio is used in multiple
independent shared libraries (e.g. librados and librbd), each module
will have its own version of the static variables and therefore will
cause inconsistencies when attempting to access the data.
Under GNU ELF extensions, static member variables are given global
unique symbol visibility. This was broken in librados due to the
symbol map, so manually export the static member variables so that
the dynamic linker can properly consolidate the variables.
See github.com boostorg/asio issue 150
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
-D_REENTRANT
-D_THREAD_SAFE
-D__STDC_FORMAT_MACROS
- -D_FILE_OFFSET_BITS=64)
+ -D_FILE_OFFSET_BITS=64
+ -DBOOST_ASIO_DISABLE_THREAD_KEYWORD_EXTENSION)
if(LINUX)
add_definitions("-D_GNU_SOURCE")
endif()
LIBRADOS_PRIVATE {
+ global:
+ extern "C++" {
+ "guard variable for boost::asio::detail::call_stack<boost::asio::detail::strand_executor_service::strand_impl, unsigned char>::top_";
+ "guard variable for boost::asio::detail::call_stack<boost::asio::detail::strand_service::strand_impl, unsigned char>::top_";
+ "guard variable for boost::asio::detail::call_stack<boost::asio::detail::thread_context, boost::asio::detail::thread_info_base>::top_";
+ "boost::asio::detail::call_stack<boost::asio::detail::strand_executor_service::strand_impl, unsigned char>::top_";
+ "boost::asio::detail::call_stack<boost::asio::detail::strand_service::strand_impl, unsigned char>::top_";
+ "boost::asio::detail::call_stack<boost::asio::detail::thread_context, boost::asio::detail::thread_info_base>::top_";
+
+ };
local: *;
};