Skip to content

Try a theory in CI: -fvisibility=hidden doesn't do anything #735

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

geofft
Copy link
Collaborator

@geofft geofft commented Aug 8, 2025

What matters is -Wl,--exclude-libs=ALL for all of our shared objects, of which in the current commit there is only python and libpython, which already uses it.

What matters is -Wl,--exclude-libs=ALL for all of our shared objects, of
which in the current commit there is only python and libpython, which
already uses it.
@geofft geofft added platform:darwin Specific to the macOS platform platform:linux Specific to the Linux platform python:3.9 python:3.13 labels Aug 8, 2025
geofft added a commit that referenced this pull request Aug 8, 2025
In general, if libX.so depends on libY.a, we don't want libY's symbols
dynamically exported by libX. We want libX's use of libY to be private.

We use two mechanisms for making this happen. -fvisibility=hidden, which
works on the build of libY to mark the symbols themselves as hidden in
the object file, and -Wl,--exclude-libs=ALL, which works on the build of
libX to instruct the linker not to re-export symbols from static
libraries.

We set -fvisibility=hidden on some platforms but not all. We use
-Wl,--exclude-libs=ALL on the build of Python itself on all platforms,
which up to this point built our only dynamic objects (bin/python and
libpython). Now that libtcl and libtk are dynamic, we need to do the
same thing.

I'm not sure if -fvisibility=hidden actually does anything useful for
us, given the use of -Wl,--exclude-libs=ALL, and I think the fact that
it's only set on some platforms is an oversight and demonstrates that
it's not needed. See #735, which removes it; the builds pass vaildation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform:darwin Specific to the macOS platform platform:linux Specific to the Linux platform python:3.9 python:3.13
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant