From 167350d3e99f8f430949116b1e7bcdb38f9ba26c Mon Sep 17 00:00:00 2001 From: Jan Bujak Date: Wed, 30 Oct 2024 11:28:37 +0000 Subject: [PATCH 1/3] Add `lp64e` RISC-V ABI --- compiler/rustc_codegen_ssa/src/back/metadata.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_codegen_ssa/src/back/metadata.rs b/compiler/rustc_codegen_ssa/src/back/metadata.rs index 8857fda1e97..49365ace0e2 100644 --- a/compiler/rustc_codegen_ssa/src/back/metadata.rs +++ b/compiler/rustc_codegen_ssa/src/back/metadata.rs @@ -325,7 +325,7 @@ pub(crate) fn create_object_file(sess: &Session) -> Option (), "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, + "ilp32e" | "lp64e" => e_flags |= elf::EF_RISCV_RVE, _ => bug!("unknown RISC-V ABI name"), } From 44b720a2d4d62c3d577b032f8a1d9241f1b94695 Mon Sep 17 00:00:00 2001 From: Jan Bujak Date: Thu, 31 Oct 2024 07:36:42 +0000 Subject: [PATCH 2/3] Add a comment about `lp64e` still being unstable --- compiler/rustc_codegen_ssa/src/back/metadata.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/rustc_codegen_ssa/src/back/metadata.rs b/compiler/rustc_codegen_ssa/src/back/metadata.rs index 49365ace0e2..4c25c85569b 100644 --- a/compiler/rustc_codegen_ssa/src/back/metadata.rs +++ b/compiler/rustc_codegen_ssa/src/back/metadata.rs @@ -325,6 +325,7 @@ pub(crate) fn create_object_file(sess: &Session) -> Option (), "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. "ilp32e" | "lp64e" => e_flags |= elf::EF_RISCV_RVE, _ => bug!("unknown RISC-V ABI name"), } From c1db011ccbf23de68505655b2eb0a05c37aad90d Mon Sep 17 00:00:00 2001 From: Jan Bujak Date: Thu, 31 Oct 2024 07:37:25 +0000 Subject: [PATCH 3/3] Add `lp64e` ABI to the spec tests match --- compiler/rustc_target/src/spec/tests/tests_impl.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_target/src/spec/tests/tests_impl.rs b/compiler/rustc_target/src/spec/tests/tests_impl.rs index cc5931be860..bd47d12ef9f 100644 --- a/compiler/rustc_target/src/spec/tests/tests_impl.rs +++ b/compiler/rustc_target/src/spec/tests/tests_impl.rs @@ -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") } _ => {} }