This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: -fvisibility=hidden vs. extern "C"
Jason Merrill wrote:
Jakub Jelinek wrote:
In the eh_personality.ii you posted with -fvisibility the prototype
of __gxx_personality_v0 is marked with default visibility (as it is
surrounded by #pragma GCC visibility {push(default), pop} pair),
but the actual definition is not marked in any way. As it is a
definition,
-fvisibility=hidden causes its visibility to be specified to hidden,
and as hidden is stronger visibility than default, hidden wins.
Hmm, this shouldn't happen; if the prototype has explicit visibility it
should override -fvisibility.
Ah, I see what the problem is. The prototype is in __cxxabiv1 and the
definition is in the global namespace, so they don't get combined. One
or the other should move; I'd probably move the definition into the
namespace.
Jason