Repository navigation
Avoid newer libgcc_s helper symbols in CPython 3.16 builds - #1391
Merged
Merged
Conversation
Statically link the helper functions used for half-precision conversions used in Python 3.16 from libgcc.a. This is not needed when cross-compiling as only an older libgcc is available in the sysroot. Native builds have the newer libgcc that is included in the LLVM bundle.
(cherry picked from commit f96a915)
jjhelmus
requested review from
EliteTK and
zanieb
and removed request for
zanieb
October 23, 2026 14:18
This was referenced Oct 23, 2026
Contributor
Author
zanieb
reviewed
Oct 23, 2026
| LDFLAGS="${EXTRA_TARGET_LDFLAGS} -L${TOOLS_PATH}/deps/lib" | ||
|
|
||
| # LTO can introduce these helpers after the static libgcc archive is scanned. | ||
| # Force them from libgcc.a to avoid newer libgcc_s symbol versions on old systems. |
Member
There was a problem hiding this comment.
A bit confused about "Force them from" meaning
zanieb
reviewed
Oct 23, 2026
Comment on lines
+1122
to
+1124
| # These flags are only needed when linking CPython itself. | ||
| for flag in os.environ.get("CPYTHON_RUNTIME_LDFLAGS", "").split(): | ||
| replace_in_all(flag, "") |
Member
There was a problem hiding this comment.
This is pretty goofy. Do they not have a first-class variable for doing this?
Contributor
Author
There was a problem hiding this comment.
LDFLAGS_NODIST is a better location for these, then they do not need cleanup
zanieb
approved these changes
Oct 23, 2026
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.
Statically link the helper functions used for half-precision conversions used in Python 3.16 from libgcc.a.
This is not needed when cross-compiling as only an older libgcc is available in the sysroot. Native builds have the newer libgcc that is included in the LLVM bundle.
Include checks for GCC symbol versions during validation.
Cherry-picked from #1376