Subject: [boost] [visibility][test][osx] visibility warnings with 1.70beta
From: Raffi Enficiaud (raffi.enficiaud_at_[hidden])
Date: 2019-03-27 19:16:00
I have a side project that requires boost.test and I thought it is the
right time to use the beta build of 1.70. At link time for my project
(in this case a simple boost.test module), I have tons of warnings like
ld: warning: direct access in function
to global weak symbol 'boost::unit_test::basic_cstring<char
const>::null_str()::null' from file
means the weak symbol cannot be overridden at runtime. This was likely
caused by different translation units being compiled with different
running Xcode 10.1 on 10.14/mojave.
I am building boost like this:
cxxflags="-std=c++11 -stdlib=libc++ -mmacosx-version-min=10.10" \
linkflags="-stdlib=libc++ -mmacosx-version-min=10.10" \
Each of the files that are being built in my project and that are
raising the warning have a compilation command like this:
-O3 -DNDEBUG -std=gnu++11 -o
which is pretty much what I had so far and before 1.70.
Boost.test is using BOOST_SYMBOL_VISIBLE to make a symbol public,
including the static build variant. Why does the linker say
This was likely caused by different translation units being compiled
with different visibility settings.
is completely unclear to me. How can I inspect what b2 emits as
compilation command line for further debugging?
All those visibility issues are causing me a lot of headache :)
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk