Boost logo

Boost :

From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2021-02-02 09:22:16


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.

> In Boost.ProgramOptions I discovered an issue as a user, where I was
> unable to catch an exception thrown from the shared Boost library in an
> executable when both are build with hidden visibility.

As per the instructions at https://gcc.gnu.org/wiki/Visibility, all
types requiring RTTI lookup to succeed outside their TU need to be
marked default visibility in all translation units. If you fail to do
this in any single translation unit, the typeinfo become hidden, and the
RTTI lookup will silently fail.

Myself and Dave Abrahams designed the current Boost macro markup
according to https://gcc.gnu.org/wiki/Visibility (actually, the GCC
documents' end was written according to what we had done in Boost, but I
digress) and it is correct, *if Boost libraries apply the macros
correctly* as per the guide.

We did, at the time, fix up most Boost libraries, circa 2005. Some
maintainers, at the time, refused to support -fvisibility=hidden,
feeling it to be an abomination. And libraries added since have done
their own thing. So I would not be surprised if quality of support has
become varying across libraries.

Niall


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