diff mbox series

[2/2] rust-target-config.bbclass: Set llvm-abiname for mips64 targets

Message ID 20261113-msieron-rust-mips-llvm-v1-2-cd3b005bd089@nokia.com
State Under Review
Headers show
Series Fix rust for mips platforms | expand

Commit Message

Michal Sieron Nov. 13, 2026, 3:13 p.m. UTC
Recent rustc requires 64-bit MIPS target specs to name the LLVM ABI and
fails the build of libstd otherwise:

  error: LLVM ABI must be specified for 64-bit MIPS targets

Set llvm-abiname to n64 for mips64 and mips64el, and to n32 for the
mips64-n32 variant, matching the ABIs the data layouts already describe.

AI-Generated: Uses Cursor

Signed-off-by: Michal Sieron <michal.sieron@nokia.com>
---
 meta/classes-recipe/rust-target-config.bbclass | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/meta/classes-recipe/rust-target-config.bbclass b/meta/classes-recipe/rust-target-config.bbclass
index 1faaaef33d..2faecd55f9 100644
--- a/meta/classes-recipe/rust-target-config.bbclass
+++ b/meta/classes-recipe/rust-target-config.bbclass
@@ -418,6 +418,10 @@  def rust_gen_target(d, thing, wd, arch):
         tspec['llvm-abiname'] = d.getVar('TUNE_RISCV_ABI')
     if "loongarch64" in tspec['llvm-target']:
         tspec['llvm-abiname'] = "lp64d"
+    if arch_abi == "mips64-n32":
+        tspec['llvm-abiname'] = "n32"
+    elif rust_arch in ("mips64", "mips64el"):
+        tspec['llvm-abiname'] = "n64"
     if "powerpc64le" in tspec['llvm-target']:
         tspec['llvm-abiname'] = "elfv2"
     elif "powerpc64" in tspec['llvm-target']: