Skip to content

Conversation

@stratakis
Copy link
Contributor

@stratakis stratakis commented Oct 9, 2025

When building with --with-lto, --enable-bolt and --enable-shared, GCC creates optimized function clones with the suffix .lto_priv.0.

The sre_ucs*_match functions use computed gotos, which BOLT cannot optimize, so their .lto_priv.0 clones must be skipped as well.

Static builds and Clang's LTO implementation are not affected.

@vstinner
Copy link
Member

vstinner commented Oct 9, 2025

@corona10 corona10 self-assigned this Oct 9, 2025
@corona10
Copy link
Member

I will try to review this PR until end of this week.

…ed gotos, to BOLT skip list When building with --with-lto, --enable-bolt and --enable-shared, GCC creates optimized function clones with the suffix .lto_priv.0. The sre_ucs*_match functions use computed gotos, which BOLT cannot optimize, so their .lto_priv.0 clones must be skipped as well. Static builds and Clang's LTO implementation are not affected.
Copy link
Member

@corona10 corona10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
But since LLVM 20 has been released and llvm/llvm-project#120267
is merged, it’s probably a good time to test without using -skip-funcs :)
cc @zanieb

@corona10 corona10 merged commit bad8d6d into python:main Oct 19, 2025
43 checks passed
@stratakis
Copy link
Contributor Author

LGTM! But since LLVM 20 has been released and llvm/llvm-project#120267 is merged, it’s probably a good time to test without using -skip-funcs :) cc @zanieb

I did some testing there with GCC. #140250 works, unless the linker uses -pack-relative-relocs, then those functions fail again.

@stratakis
Copy link
Contributor Author

Would it make sense to backport this to previous versions, as it's a bugfix?

@vstinner
Copy link
Member

vstinner commented Nov 7, 2025

Would it make sense to backport this to previous versions, as it's a bugfix?

Yes, I think so. Do you agree to backport @corona10?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants