Always specify llvm_abiname for RISC-V targets

This commit is contained in:
beetrees
2024-10-17 01:13:17 +01:00
parent 7342830c05
commit 3ea91c05db
16 changed files with 71 additions and 1 deletions

View File

@@ -152,6 +152,17 @@ impl Target {
if self.crt_static_default || self.crt_static_allows_dylibs {
assert!(self.crt_static_respected);
}
// Check that RISC-V targets always specify which ABI they use.
match &*self.arch {
"riscv32" => {
assert_matches!(&*self.llvm_abiname, "ilp32" | "ilp32f" | "ilp32d" | "ilp32e")
}
"riscv64" => {
assert_matches!(&*self.llvm_abiname, "lp64" | "lp64f" | "lp64d" | "lp64q")
}
_ => {}
}
}
// Add your target to the whitelist if it has `std` library