Skip to content

Commit

Permalink
Unrolled build for rust-lang#132421
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#132421 - beetrees:riscv-abi-no-empty-string, r=workingjubilee

Remove `""` case from RISC-V `llvm_abiname` match statement

For RISC-V, `""` isn't the always the same ABI as `"ilp32"`/`"lp64"` (`""` means LLVM will infer the ABI based on the enabled target features), but `create_object_file` currently assumes that it is. Since all RISC-V targets explicitly specify their ABI since rust-lang#131807, this PR removes `""` from the match arm's pattern (meaning an empty string will now fall through to the `_ => bug!` arm).

r? `@workingjubilee`
  • Loading branch information
rust-timer authored Nov 1, 2024
2 parents 24254ef + abb05c0 commit 4e4e901
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_ssa/src/back/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ pub(crate) fn create_object_file(sess: &Session) -> Option<write::Object<'static
// Set the appropriate flag based on ABI
// This needs to match LLVM `RISCVELFStreamer.cpp`
match &*sess.target.llvm_abiname {
"" | "ilp32" | "lp64" => (),
"ilp32" | "lp64" => (),
"ilp32f" | "lp64f" => e_flags |= elf::EF_RISCV_FLOAT_ABI_SINGLE,
"ilp32d" | "lp64d" => e_flags |= elf::EF_RISCV_FLOAT_ABI_DOUBLE,
// Note that the `lp64e` is still unstable as it's not (yet) part of the ELF psABI.
Expand Down

0 comments on commit 4e4e901

Please sign in to comment.