-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
gh-101525: Check whether to skip functions with computed gotos during BOLT runs #140250
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
base: main
Are you sure you want to change the base?
Conversation
|
With GCC when the -pack-relative-relocs linker flag is used, BOLT fails again on the same functions. |
|
cc @corona10 |
241a541 to
41d3a75
Compare
…during BOLT runs With LLVM >= 21.1.0 BOLT can handle computed gotos in PIC compiled code. However depending on the combination of --with-lto, --enable-shared, --enable-optmizations and using packed rellocations on the linker build configs might still need to skip functions containing computed gotos.
41d3a75 to
33effce
Compare
|
I've rebased to add various edge cases and combinations. Initially I just removed the --skip-funcs flag to test what works and what not. Tested combinations of --with-lto, --enable-optimizations, --enable-shared and packed-relocations which made things weirder. Overall out of 32 different build configs that I've tested, 8 didn't work, reported here: #141775. While I think I caught all the edge cases, at least for these combinations, 3 builds configs actually break with this change: GCC shared build with packed relocs: Clang shared build with packed relocs: Clang shared build with LTO and packed relocs: |
Would you mind to add a NEWS entry in the Build category? You can use blurb-it online service or blurb command line: https://devguide.python.org/. |
… gotos during BOLT runs Address review comments
… gotos during BOLT runs Regenerate configure
|
Added some fixups commits. However some builds are breaking by this change as mentioned in #140250 (comment) so I think it would be ideal to have BOLT fixed first before. |
With LLVM >= 21.1.0 BOLT can handle computed gotos in PIC compiled code.
However in some cases computed gotos still produce issues.
This PR handles it this way:
For either GCC or Clang, functions with computed gotos are skipped when LLVM < 21.1.0.
With version >= 21.1.0 where llvm/llvm-project#120267 exists we no longer skip these functions except when packed relocations are involved. The logic handles skipping of the various functions created by either GCC or Clang depending on the type of build.