Ensure that the bitcode was compiled with the supported LLVM version#321
Draft
vadorovsky wants to merge 3 commits into
Draft
Ensure that the bitcode was compiled with the supported LLVM version#321vadorovsky wants to merge 3 commits into
vadorovsky wants to merge 3 commits into
Conversation
1fcce64 to
ff51b6e
Compare
Rust 1.91.0 is the newest stable version that uses LLVM 21. Rust 1.86.0 makes it impossible to honor the recent clippy lints.
c9c623d to
fe849dc
Compare
LLVM bitcode is not backwards compatible and linking bitode objects produced by different LLVM versions, even when it does not always trigger any error in the backend, can lead to miscompilation (e.g. aya-rs#318). Using clang 15 for a compile test was "working" out of luck, because the program was simple enough to not cause a miscompilation. But given that it's wrong, ensure that clang version matches LLVM version
Linking bitcode produced by different LLVM versions can lead either to: - The backend failing to lower the IR to bytecode (an easier-to-debug scenario that throws a descriptive error). - "Successful" compilation but with broken BTF (DI sanitization modifies DI operands, which have incompatibilities across versions). To prevent both cases, always throw an error when the bitcode is incompatible. Fixes: aya-rs#319
dda1a14 to
ad3cbcf
Compare
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.
Linking bitcode produced by different LLVM versions can lead either to:
To prevent both cases, always throw an error when the bitcode is incompatible.
Fixes: #319
This change is