Try a theory in CI: -fvisibility=hidden doesn't do anything#735
Draft
geofft wants to merge 1 commit intoastral-sh:mainfrom
Draft
Try a theory in CI: -fvisibility=hidden doesn't do anything#735geofft wants to merge 1 commit intoastral-sh:mainfrom
geofft wants to merge 1 commit intoastral-sh:mainfrom
Conversation
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
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.