LLVM 24: configure float-abi via module flag - #161317
Open
TimNN wants to merge 1 commit into
Open
Conversation
TimNN
marked this pull request as ready for review
August 19, 2026 05:11
Collaborator
|
r? @khyperia rustbot has assigned @khyperia. Use Why was this reviewer chosen?The reviewer was selected based on:
|
Contributor
Author
|
@rustbot author I noticed that I was a bit inconsistent with the LLVM version conditions - I think there's no real issue with applying the flag on LLVM versions that don't explicitly check it, but want to verify on Zulip. |
Collaborator
|
Reminder, once the PR becomes ready for a review, use |
Contributor
Author
|
@rustbot ready Based on the Zulip thread, I've updated the PR to only apply the float-abi module flag on LLVM 24+. |
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.
TargetOptions::FloatABITypewas removed in llvm/llvm-project#215796See llvm/llvm-project#212985 for the corresponding clang change.
The
ModuleFlagMergeBehavior::Errorwas copied from the clang implementation.This currently relies on the string representation of Rust's
FloatAbi"target_spec_enum" matching LLVM. This seemed reasonable to me since the representation is quite straightforward ("soft" and "hard"), but let me know if you'd like an explicitto_llvm_float_abi_str, either defined in Rust or forwarding tollvm::FloatABI::getABITypeName.Contrary to the clang implementation which only sets the module flag if it differs from the target default, we set it whenever the Rust target has an explicit float ABI set. See also discussion in #t-compiler/llvm > float-abi module flag behavior.
The added test won't actually run on Rust's own CI until that updates to LLVM 24.
@rustbot label llvm-main