Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion compiler/rustc_target/src/target_features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1524,7 +1524,15 @@ impl Target {
// There's no SPE for PowerPC64, and we currently don't support any soft-float
// targets. (If we ever add one, we need to match on `RustcAbi::Softfloat` similar
// to other targets above.)
FeatureConstraints { required: &["hard-float"], incompatible: &["spe"] }
match self.llvm_abiname {
// The ELFv2 ABI requires vector registers for passing f128 and any future
// 16-byte aligned types.
LlvmAbi::ElfV2 => FeatureConstraints {
required: &["hard-float", "altivec"],
incompatible: &["spe"],
},
_ => FeatureConstraints { required: &["hard-float"], incompatible: &["spe"] },
}
}
Arch::Sparc => {
// We currently don't have a soft-float target for SPARC.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
warning: target feature `altivec` must be enabled to ensure that the ABI of the current target can be implemented correctly
|
= note: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #162235 <https://github.com/rust-lang/rust/issues/162235>

warning: 1 warning emitted

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
warning: target feature `altivec` must be enabled to ensure that the ABI of the current target can be implemented correctly
|
= note: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #162235 <https://github.com/rust-lang/rust/issues/162235>

warning: 1 warning emitted

Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
//! Ensure ABI-required features cannot be disabled via `-Ctarget-feature`.
//! Also covers the case of a feature indirectly disabling another via feature implications.
//@ compile-flags: --crate-type=lib
//@ revisions: x86 x86-implied aarch64 riscv loongarch
//@ revisions: x86 x86-implied aarch64 powerpc64 powerpc64le riscv loongarch
//@[x86] compile-flags: --target=x86_64-unknown-linux-gnu -Ctarget-feature=-x87
//@[x86] needs-llvm-components: x86
//@[x86] build-pass
//@[x86-implied] compile-flags: --target=x86_64-unknown-linux-gnu -Ctarget-feature=-sse
//@[x86-implied] needs-llvm-components: x86
//@[x86-implied] build-pass
//@[powerpc64] compile-flags: --target=powerpc64-unknown-linux-musl -Ctarget-feature=-altivec
//@[powerpc64] needs-llvm-components: powerpc
//@[powerpc64] build-pass
//@[powerpc64le] compile-flags: --target=powerpc64le-unknown-linux-gnu -Ctarget-feature=-altivec
//@[powerpc64le] needs-llvm-components: powerpc
//@[powerpc64le] build-pass
//@[riscv] compile-flags: --target=riscv64gc-unknown-none-elf -Ctarget-feature=-d
//@[riscv] needs-llvm-components: riscv
//@[riscv] build-pass
Expand All @@ -31,5 +37,5 @@
extern crate minicore;
use minicore::*;

//[x86,x86-implied,riscv,loongarch]~? WARN must be enabled to ensure that the ABI
//[x86,x86-implied,powerpc64,powerpc64le,riscv,loongarch]~? WARN must be enabled to ensure that the ABI
//[aarch64]~? ERROR must be enabled to ensure that the ABI
Loading