Subject: [Boost-bugs] [Boost C++ Libraries] #13048: Static libraries and visibility hidden
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-05-26 18:21:46
#13048: Static libraries and visibility hidden
----------------------------+----------------------------------------------
Reporter: Mark M | Type: Bugs
<mememory359@â¦> |
Status: new | Milestone: To Be Determined
Component: Building Boost | Version: Boost Development Trunk
Severity: Problem | Keywords: static library visibility hidden
----------------------------+----------------------------------------------
I've been told that I can compile the Boost libraries with
"-fvisibility=hidden".
But I think it will work only for shared libraries, and I am building
static libraries.
If I'm wrong, please point out what I am missing.
I will use the Filesystem library as an example, but I think this applies
to Boost in general.
There are a number of functions that need to have default visibility to
allow the libraries to link with other code without error. These functions
have the BOOST_FILESYSTEM_DECL macro in their declaration. I am using
Xcode. The config/compiler/clang.hpp file has defined BOOST_SYMBOL_EXPORT
with the attribute-visibility-default setting. So I look for code that
sets BOOST_FILESYSTEM_DECL to be BOOST_SYMBOL_EXPORT.
When I look at the filesystem/config.hpp file, BOOST_FILESYSTEM_DECL is
blank, unless (BOOST_ALL_DYN_LINK or BOOST_FILESYSTEM_DYN_LINK) and
BOOST_FILESYSTEM_SOURCE are set. But with static libraries, I don't want
those settings, right?
There is another preprocessor macro called BOOST_SYMBOL_VISIBLE, but it is
only used one place in filesystem (for the filesystem_error class).
Any help in the right direction would be appreciated.
Or if this is an oversight, that would be helpful to know.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/13048> 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-05-26 18:24:51 UTC