Skip to content

Commit

Permalink
Unrolled build for rust-lang#132354
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#132354 - koute:master, r=workingjubilee

Add `lp64e` RISC-V ABI

This PR adds support for the `lp64e` RISC-V ABI, which is the 64-bit equivalent of the `ilp32e` ABI that is already supported.

For reference, this ABI was originally added to LLVM in [this PR](https://reviews.llvm.org/D70401).
  • Loading branch information
rust-timer authored Oct 31, 2024
2 parents 9ccfedf + c1db011 commit b2afecf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion compiler/rustc_codegen_ssa/src/back/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,8 @@ pub(crate) fn create_object_file(sess: &Session) -> Option<write::Object<'static
"" | "ilp32" | "lp64" => (),
"ilp32f" | "lp64f" => e_flags |= elf::EF_RISCV_FLOAT_ABI_SINGLE,
"ilp32d" | "lp64d" => e_flags |= elf::EF_RISCV_FLOAT_ABI_DOUBLE,
"ilp32e" => e_flags |= elf::EF_RISCV_RVE,
// Note that the `lp64e` is still unstable as it's not (yet) part of the ELF psABI.
"ilp32e" | "lp64e" => e_flags |= elf::EF_RISCV_RVE,
_ => bug!("unknown RISC-V ABI name"),
}

Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_target/src/spec/tests/tests_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ impl Target {
assert_matches!(&*self.llvm_abiname, "ilp32" | "ilp32f" | "ilp32d" | "ilp32e")
}
"riscv64" => {
assert_matches!(&*self.llvm_abiname, "lp64" | "lp64f" | "lp64d" | "lp64q")
// Note that the `lp64e` is still unstable as it's not (yet) part of the ELF psABI.
assert_matches!(&*self.llvm_abiname, "lp64" | "lp64f" | "lp64d" | "lp64q" | "lp64e")
}
_ => {}
}
Expand Down

0 comments on commit b2afecf

Please sign in to comment.