Subject: Re: [boost] [config] really, really sticky issue with BOOST_SYMBOL_IMPORT
From: Gavin Lambert (boost_at_[hidden])
Date: 2018-10-10 05:33:28


On 10/10/2018 17:37, Robert Ramey wrote:
> At some point things changed for gcc compilers.  Now it seems that
> BOOST_SYMBOL_IMPORT resolves to nothing and BOOST_SYMBOL_EXPORT resolves
> to : __attribute__ ((visibility("default"))) and BOOST_SYMBOL_IMPORT
> still resolves to nothing.  OK - this has never been a problem.
>
> Now we have an extremely subtle issue which appears on linux systems
> with gcc. It's related to sequence of shared library loading and
> unloading.  It shows up as a bunch of test failures for the test named
> test_exported_dll.  A very astute user has determined that this can be
> "fixed" by defining BOOST_SYMBOL_IMPORT as __attribute__
> ((visibility("default"))) as well.  Question. should config/gcc be
> updated in this way?  Also is it possible that this "fix" is just a
> fluke unrelated to the real source of the problem?

While I know next to nothing about how Linux DSOs work, my reading of
https://gcc.gnu.org/wiki/Visibility suggests that you're supposed to
specify the same visibility level for both definition and usage of any
given symbol.

(See in particular the example code in the step-by-step guide, and some
of the admonishments against using different visibility in the section
on exceptions.)