diff mbox series

[meta-lts-mixins,wrynose/rust,02/10] rust-target-config.bbclass: Set llvm-abiname for mips64 targets

Message ID c9f446574aeeeaa741cd74ce1c8b890e3936a89e.1795997683.git.scott.murray@konsulko.com
State New
Headers show
Series Update to 1.100.0 | expand

Commit Message

Scott Murray Nov. 30, 2026, 12:52 a.m. UTC
From: Michal Sieron <michalwsieron@gmail.com>

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>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(adapted from oe-core commit 9518ce9aa2a6cbce678895ef9a95cd27939dae2a)
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
---
 classes-recipe/rust-target-config.bbclass | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/classes-recipe/rust-target-config.bbclass b/classes-recipe/rust-target-config.bbclass
index 1faaaef..2faecd5 100644
--- a/classes-recipe/rust-target-config.bbclass
+++ b/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']: