From: Khem Raj <raj.khem@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: Khem Raj <khem.raj@oss.qualcomm.com>
Subject: [PATCH v3 7/7] rust: Fix loongarch unit test with llvm-22
Date: Thu, 26 Mar 2026 08:16:41 -0700 [thread overview]
Message-ID: <20260326151641.3974221-7-khem.raj@oss.qualcomm.com> (raw)
In-Reply-To: <20260326151641.3974221-1-khem.raj@oss.qualcomm.com>
Adjust loongarch assembly test
This generates different code on loongarch32r now.
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
---
.../0001-Adjust-loongarch-assembly-test.patch | 66 +++++++++++++++++++
meta/recipes-devtools/rust/rust-source.inc | 1 +
2 files changed, 67 insertions(+)
create mode 100644 meta/recipes-devtools/rust/files/0001-Adjust-loongarch-assembly-test.patch
diff --git a/meta/recipes-devtools/rust/files/0001-Adjust-loongarch-assembly-test.patch b/meta/recipes-devtools/rust/files/0001-Adjust-loongarch-assembly-test.patch
new file mode 100644
index 0000000000..67c649ebd8
--- /dev/null
+++ b/meta/recipes-devtools/rust/files/0001-Adjust-loongarch-assembly-test.patch
@@ -0,0 +1,66 @@
+From e015fc820db5d7fe2495c09b1fdd5e2092ed3cd1 Mon Sep 17 00:00:00 2001
+From: Nikita Popov <npopov@redhat.com>
+Date: Tue, 27 Jan 2026 12:03:48 +0100
+Subject: [PATCH] Adjust loongarch assembly test
+
+This generates different code on loongarch32r now.
+
+Upstream-Status: Backport [https://github.com/rust-lang/rust/commit/e015fc820db5d7fe2495c09b1fdd5e2092ed3cd1]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ tests/assembly-llvm/asm/loongarch-type.rs | 27 +++++++++++++++++------
+ 1 file changed, 20 insertions(+), 7 deletions(-)
+
+diff --git a/tests/assembly-llvm/asm/loongarch-type.rs b/tests/assembly-llvm/asm/loongarch-type.rs
+index e0a7940f89a..5efad583a39 100644
+--- a/tests/assembly-llvm/asm/loongarch-type.rs
++++ b/tests/assembly-llvm/asm/loongarch-type.rs
+@@ -1,10 +1,14 @@
+ //@ add-minicore
+-//@ revisions: loongarch32 loongarch64
++//@ revisions: loongarch32s loongarch32r loongarch64
+
+ //@ assembly-output: emit-asm
+
+-//@[loongarch32] compile-flags: --target loongarch32-unknown-none
+-//@[loongarch32] needs-llvm-components: loongarch
++//@[loongarch32s] compile-flags: --target loongarch32-unknown-none -Ctarget-feature=+32s
++//@[loongarch32s] needs-llvm-components: loongarch
++
++//@[loongarch32r] compile-flags: --target loongarch32-unknown-none
++//@[loongarch32r] needs-llvm-components: loongarch
++//@[loongarch32r] min-llvm-version: 22
+
+ //@[loongarch64] compile-flags: --target loongarch64-unknown-none
+ //@[loongarch64] needs-llvm-components: loongarch
+@@ -28,8 +32,12 @@
+
+ // CHECK-LABEL: sym_fn:
+ // CHECK: #APP
+-// CHECK: pcalau12i $t0, %got_pc_hi20(extern_func)
+-// CHECK: ld.{{[wd]}} $t0, $t0, %got_pc_lo12(extern_func)
++// loongarch64: pcalau12i $t0, %got_pc_hi20(extern_func)
++// loongarch64: ld.d $t0, $t0, %got_pc_lo12(extern_func)
++// loongarch32s: pcalau12i $t0, %got_pc_hi20(extern_func)
++// loongarch32s: ld.w $t0, $t0, %got_pc_lo12(extern_func)
++// loongarch32r: pcaddu12i $t0, %got_pcadd_hi20(extern_func)
++// loongarch32r: ld.w $t0, $t0, %got_pcadd_lo12(.Lpcadd_hi0)
+ // CHECK: #NO_APP
+ #[no_mangle]
+ pub unsafe fn sym_fn() {
+@@ -38,8 +46,13 @@ pub unsafe fn sym_fn() {
+
+ // CHECK-LABEL: sym_static:
+ // CHECK: #APP
+-// CHECK: pcalau12i $t0, %got_pc_hi20(extern_static)
+-// CHECK: ld.{{[wd]}} $t0, $t0, %got_pc_lo12(extern_static)
++// loongarch64: pcalau12i $t0, %got_pc_hi20(extern_static)
++// loongarch64: ld.d $t0, $t0, %got_pc_lo12(extern_static)
++// loongarch32s: pcalau12i $t0, %got_pc_hi20(extern_static)
++// loongarch32s: ld.w $t0, $t0, %got_pc_lo12(extern_static)
++// loongarch32r: pcaddu12i $t0, %got_pcadd_hi20(extern_static)
++// loongarch32r: ld.w $t0, $t0, %got_pcadd_lo12(.Lpcadd_hi1)
++
+ // CHECK: #NO_APP
+ #[no_mangle]
+ pub unsafe fn sym_static() {
diff --git a/meta/recipes-devtools/rust/rust-source.inc b/meta/recipes-devtools/rust/rust-source.inc
index e1942db93d..cd6999c8f2 100644
--- a/meta/recipes-devtools/rust/rust-source.inc
+++ b/meta/recipes-devtools/rust/rust-source.inc
@@ -9,6 +9,7 @@ SRC_URI += "https://static.rust-lang.org/dist/rustc-${RUST_VERSION}-src.tar.xz;n
file://0001-Update-call-llvm-intrinsics-test.patch;patchdir=${RUSTSRC} \
file://0001-Fix-flaky-assertions-in-oneshot-tests.patch;patchdir=${RUSTSRC} \
file://0001-Update-amdgpu-data-layout.patch;patchdir=${RUSTSRC} \
+ file://0001-Adjust-loongarch-assembly-test.patch;patchdir=${RUSTSRC} \
"
SRC_URI[rust.sha256sum] = "0b53ae34f5c0c3612cfe1de139f9167a018cd5737bc2205664fd69ba9b25f600"
next prev parent reply other threads:[~2026-03-26 15:17 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-26 15:16 [PATCH v3 1/7] clang/llvm: Upgrade to 22.x major release Khem Raj
2026-03-26 15:16 ` [PATCH v3 2/7] clang: Do not package clang-offload-packager Khem Raj
2026-03-26 15:16 ` [PATCH v3 3/7] spirv-llvm-translation: Upgrade to 22.0 Khem Raj
2026-03-26 15:16 ` [PATCH v3 4/7] llvm: Upgrade to 22.1.2 release Khem Raj
2026-03-26 15:16 ` [PATCH v3 5/7] nativesdk-clang-glue: Delete do_create_recipe_spdx Khem Raj
2026-03-26 15:16 ` [PATCH v3 6/7] rust: Fix build with llvm-22 Khem Raj
2026-03-26 15:16 ` Khem Raj [this message]
2026-03-26 19:47 ` [OE-core] [PATCH v3 1/7] clang/llvm: Upgrade to 22.x major release Mathieu Dubois-Briand
2026-03-26 20:40 ` Khem Raj
2026-03-27 10:42 ` Mathieu Dubois-Briand
2026-03-27 18:00 ` Khem Raj
2026-03-28 2:39 ` Khem Raj
2026-03-29 18:00 ` Mathieu Dubois-Briand
2026-03-29 21:37 ` Khem Raj
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260326151641.3974221-7-khem.raj@oss.qualcomm.com \
--to=raj.khem@gmail.com \
--cc=khem.raj@oss.qualcomm.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox