GH-146475: Strip CFI directives from JIT stencils to allow using Apple LLVM 21#148364
Open
savannahostrowski wants to merge 10 commits intopython:mainfrom
Open
GH-146475: Strip CFI directives from JIT stencils to allow using Apple LLVM 21#148364savannahostrowski wants to merge 10 commits intopython:mainfrom
savannahostrowski wants to merge 10 commits intopython:mainfrom
Conversation
Member
Author
|
Gonna try out some other flags in a bit. Gotta assemble a new couch first. |
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.
After poking around at this a bit, it seems like Apple LLVM 21 is stricter about validating CFI frame nesting. In debug builds,
.cfi_endprocdirectives can end up in blocks that the optimizer removes as unreachable, leaving unbalanced.cfi_startprocdirectives that the assembler rejects (and so you'll get something like this #146478 (comment) while building).Since JIT stencils are already compiled with
-fno-asynchronous-unwind-tables, I believe the CFI directives are unused and so they can be stripped out. I also tried changing the flag to-fno-unwind-tablesinstead to just prevent us from emitting the directives in the first place but it seems like that's a bigger change as we'd have to handleSHT_X86_64_UNWINDsections on x86_64 Linux (https://github.com/python/cpython/actions/runs/24265500635/job/70859484777?pr=148364)? I'm not totally sure why that is. We could go that route but wanted to solicit opinions first before going down that road.This is an alternative to #146478 that tries to fix the root cause rather than blocking Apple LLVM 21.