Check to ensure we're running against the correct LLVM version - #161788
Open
jnkel wants to merge 2 commits into
Open
Check to ensure we're running against the correct LLVM version#161788jnkel wants to merge 2 commits into
jnkel wants to merge 2 commits into
Conversation
Collaborator
|
r? @nnethercote rustbot has assigned @nnethercote. Use Why was this reviewer chosen?The reviewer was selected based on:
|
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.
The recent LLVM version bump exposed several cases of mishandling LLVM versions, both in-tree and downstream (#161335, #161377, #161572, and likely https://rust-lang.zulipchat.com/#narrow/channel/122651-general/topic/opt-dist.20pipeline.20failure.20in.20MSYS2.20CI.20when.20compiling.2E.2E.2E/with/619077952).
If the compiler is run against an incompatible LLVM version, the most common failure mode is a segfault within LLVM, often when looking up target information. This is not obvious to debug, so this PR adds an LLVM version check before initializing LLVM so that we can produce a clearer error.
The second commit in this PR performs a
dladdrlookup to print the path to the LLVM we're using. We already have code to do this for finding the sysroot, which I repurposed. However, I don't mind reverting this if it's too complex/risky.I would appreciate if someone with permissions could trigger a try build on AIX, Windows, and WASI as the second commit touches platform-specific code that I can't test locally.
Before:
After: