Boost logo

Boost :

From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2021-02-02 12:11:34


On 2/2/21 1:14 PM, Alexander Grund via Boost wrote:
> Am 02.02.21 um 10:22 schrieb Niall Douglas via Boost:
>> On 02/02/2021 08:35, Alexander Grund via Boost wrote:
>>> Hi Boost maintainers,
>>>
>>> TLDR: Check your classes if they use BOOST_*_DECL and change that to
>>> BOOST_SYMBOL_VISIBLE
>> That's identical to making -fvisibility=hidden no longer have effect. So
>> please Boost maintainers DO NOT DO THE ABOVE.
> I was partially wrong. IMO this is a bug in Boost.Config which should
> not define BOOST_SYMBOL_IMPORT to nothing. I opened an issue to discuss
> this there: https://github.com/boostorg/config/issues/362
> Reason is that Win32 needs the declspec on classes:
> https://docs.microsoft.com/de-de/cpp/cpp/using-dllimport-and-dllexport-in-cpp-classes?view=msvc-160
>
>
> Could you elaborate why marking classes currently marked as BOOST_*_DECL
> with BOOST_SYMBOL_VISIBLE would make visibility not have an effect?
> Because this is essentially what I'm suggesting for Boost.Config:
> BOOST_*_DECL is either BOOST_SYMBOL_IMPORT or BOOST_SYMBOL_EXPORT, the
> former is (currently) empty, the latter is BOOST_SYMBOL_VISIBLE
> (disregarding Win32, see above)
>
> Note that this es exactly what e.g. CMake does:
> https://github.com/Kitware/CMake/blob/36bb0e32d7e3976eed424078cf5cac459651f0f1/Modules/GenerateExportHeader.cmake#L309-L311

IMHO, Boost.Config provides basic building blocks and nothing more, and
that is a good thing. Each library must define its own export/import
macro using these building blocks, and that macro should take into
account its library-specific macros, such as BOOST_*_DYN_LINK.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk