prefer actual ABI-controling fields over target.abi when making ABI decisions#152941
prefer actual ABI-controling fields over target.abi when making ABI decisions#152941RalfJung wants to merge 1 commit intorust-lang:mainfrom
Conversation
|
r? @mati865 rustbot has assigned @mati865. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
2ed4ab0 to
b1fcdae
Compare
This comment has been minimized.
This comment has been minimized.
f2e7433 to
d7ea008
Compare
| // Everything else is assumed to use a hardfloat ABI. neon and fp-armv8 must be enabled. | ||
| // `FeatureConstraints` uses Rust feature names, hence only "neon" shows up. | ||
| FeatureConstraints { required: &["neon"], incompatible: &[] } | ||
| match self.rustc_abi { |
There was a problem hiding this comment.
This actually seems like a great improvement in consistency; every other match in this function is about rustc_abi / llvm_abiname / llvm_floatabi.
|
Linux just uses the built-in |
|
Okay, sounds good then. (That value has been renamed to "softfloat" recently but we accept the old one as well.) |
d7ea008 to
c66597e
Compare
| // Rust does not currently support any powerpc softfloat targets. | ||
| let target = &bx.cx.tcx.sess.target; | ||
| let is_soft_float_abi = target.abi == Abi::SoftFloat; | ||
| let is_soft_float_abi = target.rustc_abi == Some(RustcAbi::Softfloat); |
There was a problem hiding this comment.
We don't actually use RustcAbi::Softfloat on powerpc currently.
@Gelbpunkt Do we even have a powerpc softfloat target and how does it work? @folkertdev which target was this check supposed to deal with?
There was a problem hiding this comment.
We don't have softfloat powerpc targets at the moment, but I'm pretty sure the RfL people will want to add one? Not sure what the plans are for that...
We don't actually check that
abiis consistent with the fields that control the ABI, e.g. one could setllvm_abinameto "ilp32e" on a riscv target without setting a matchingabi. So, if we need to make actual decisions, better to use the source of truth we forward to LLVM than the informational string we forward to the user.This is a breaking change for aarch64 JSON target specs: setting
abito "softfloat" is no longer enough; one has to also setrustc_abito "softfloat". That is consistent with riscv and arm32, but it's still surprising. Cc @Darksonn in case this affects the Linux kernel.Also see #153035 which does something similar for PowerPC, and Zulip. Happy to delay this PR if someone has a better idea.
Cc @folkertdev @workingjubilee