[meta-lts-mixins][scarthgap/rust][PATCH 30/35] rust: backport explicit-tail-calls test skips for unsupported LLVM targets
Scott Murray <[email protected]> Fri, 31 Jul 2026 07:33:00 -0400
| Newsgroups | org.yoctoproject.lists.yocto-patches |
|---|---|
| Message-ID | <972e7f962d7776661005c53a94d8147af268f167.1785496469.git.scott.murray@konsulko.com> |
From: Peter Tatrai <[email protected]> oe-selftest for rust fails on powerpc and other architectures where LLVM does not fully support musttail lowering, causing: LLVM ERROR: failed to perform tail call elimination on musttail marked calls Add an upstream backport patch that marks the affected explicit-tail-calls tests as ignored on unsupported LLVM targets. Signed-off-by: Peter Tatrai <[email protected]> Signed-off-by: Mathieu Dubois-Briand <[email protected]> Signed-off-by: Richard Purdie <[email protected]> (adapted from oe-core commit 333595718daad21e0366cbdd3550c9a984436bb3) Signed-off-by: Scott Murray <[email protected]> --- ...lls-ignore-tests-on-unsupported-llvm.patch | 96 +++++++++++++++++++ recipes-devtools/rust/rust-source.inc | 1 + 2 files changed, 97 insertions(+) create mode 100644 recipes-devtools/rust/files/0004-explicit-tail-calls-ignore-tests-on-unsupported-llvm.patch diff --git a/recipes-devtools/rust/files/0004-explicit-tail-calls-ignore-tests-on-unsupported-llvm.patch b/recipes-devtools/rust/files/0004-explicit-tail-calls-ignore-tests-on-unsupported-llvm.patch new file mode 100644 index 0000000..a6b73cf --- /dev/null +++ b/recipes-devtools/rust/files/0004-explicit-tail-calls-ignore-tests-on-unsupported-llvm.patch @@ -0,0 +1,96 @@ +Backport commits that disable failing tests on unsupported LLVM targets. + +Fixes LLVM ERROR: failed to perform tail call elimination on musttail marked calls. + +Upstream-Status: Backport [https://github.com/rust-lang/rust/commit/ded0aaba6ce257adf0b7e1fb6b702cad12328faf] + +Signed-off-by: Peter Tatrai <[email protected]> + +--- + src/tools/compiletest/src/directives/directive_names.rs | 3 ++ + tests/ui/explicit-tail-calls/become-indirect-return.rs | 21 +++++++++++++++++ + tests/ui/explicit-tail-calls/indirect.rs | 19 ++++++++++++++++ + 3 files changed, 43 insertions(+) +diff --git a/src/tools/compiletest/src/directives/directive_names.rs b/src/tools/compiletest/src/directives/directive_names.rs +index 1234567..abcdefg 100644 +--- a/src/tools/compiletest/src/directives/directive_names.rs ++++ b/src/tools/compiletest/src/directives/directive_names.rs +@@ -67,6 +67,7 @@ pub(crate) const KNOWN_DIRECTIVE_NAMES: &[&str] = &[ + "ignore-coverage-map", + "ignore-coverage-run", + "ignore-cross-compile", ++ "ignore-csky", + "ignore-eabi", + "ignore-elf", + "ignore-emscripten", +@@ -91,6 +92,8 @@ pub(crate) const KNOWN_DIRECTIVE_NAMES: &[&str] = &[ + "ignore-loongarch64", + "ignore-macabi", + "ignore-macos", ++ "ignore-mips", ++ "ignore-mips64", + "ignore-msp430", + "ignore-msvc", + "ignore-musl", +diff --git a/tests/ui/explicit-tail-calls/become-indirect-return.rs b/tests/ui/explicit-tail-calls/become-indirect-return.rs +index 1234567..abcdefg 100644 +--- a/tests/ui/explicit-tail-calls/become-indirect-return.rs ++++ b/tests/ui/explicit-tail-calls/become-indirect-return.rs +@@ -2,6 +2,27 @@ + //@ ignore-backends: gcc + //@ ignore-wasm 'tail-call' feature not enabled in target wasm32-wasip1 + //@ ignore-cross-compile ++// ++// LLVM musttail support is incomplete for these targets. ++// See https://github.com/rust-lang/rust/issues/148748 for the target test matrix. ++// See https://github.com/llvm/llvm-project/issues/63214 for AIX and PowerPC. ++// See https://github.com/llvm/llvm-project/issues/57795 for MIPS and MIPS64. ++//@ ignore-aix ++//@ ignore-csky ++//@ ignore-mips ++//@ ignore-mips64 ++//@ ignore-powerpc ++//@ ignore-powerpc64 ++// ++// LLVM musttail support is lacking for sret lowering on these targets. ++// Returning `[u8; 24]` uses sret lowering here. ++// See https://github.com/llvm/llvm-project/issues/157814 for RISC-V. ++// See https://github.com/llvm/llvm-project/issues/168152 for LoongArch. ++// RISC-V fix: https://github.com/llvm/llvm-project/pull/185094, should be in LLVM 23. ++// LoongArch will likely be fixed with similar changes. ++//@ ignore-riscv64 ++//@ ignore-loongarch32 ++//@ ignore-loongarch64 + #![expect(incomplete_features)] + #![feature(explicit_tail_calls)] + +diff --git a/tests/ui/explicit-tail-calls/indirect.rs b/tests/ui/explicit-tail-calls/indirect.rs +index 1234567..abcdefg 100644 +--- a/tests/ui/explicit-tail-calls/indirect.rs ++++ b/tests/ui/explicit-tail-calls/indirect.rs +@@ -2,7 +2,26 @@ + //@ ignore-backends: gcc + // + //@ ignore-wasm ++// ++// LLVM musttail support is incomplete for these targets. ++// See https://github.com/rust-lang/rust/issues/148748 for the target test matrix. ++// See https://github.com/llvm/llvm-project/issues/63214 for AIX and PowerPC. ++// See https://github.com/llvm/llvm-project/issues/57795 for MIPS and MIPS64. ++//@ ignore-aix ++//@ ignore-csky ++//@ ignore-mips ++//@ ignore-mips64 ++//@ ignore-powerpc ++//@ ignore-powerpc64 ++// ++// LLVM musttail support is lacking for indirect arguments that do not fit in registers. ++// See https://github.com/llvm/llvm-project/issues/157814 for RISC-V. ++// See https://github.com/llvm/llvm-project/issues/168152 for LoongArch. ++// RISC-V fix: https://github.com/llvm/llvm-project/pull/185094, should be in LLVM 23. ++// LoongArch will likely be fixed with similar changes. + //@ ignore-riscv64 ++//@ ignore-loongarch32 ++//@ ignore-loongarch64 + #![feature(explicit_tail_calls)] + #![expect(incomplete_features)] diff --git a/recipes-devtools/rust/rust-source.inc b/recipes-devtools/rust/rust-source.inc index bb41dda..3aa3fe6 100644 --- a/recipes-devtools/rust/rust-source.inc +++ b/recipes-devtools/rust/rust-source.inc @@ -8,6 +8,7 @@ SRC_URI += "https://static.rust-lang.org/dist/rustc-${RUST_VERSION}-src.tar.xz;n file://0001-riscv32-Define-plain-syscalls-as-their-time64-varian.patch;patchdir=${RUSTSRC} \ file://0002-Fix-rust-build-failure-with-unstable-options.patch;patchdir=${RUSTSRC} \ file://0003-explicit-tail-calls-disable-two-tests.patch;patchdir=${RUSTSRC} \ + file://0004-explicit-tail-calls-ignore-tests-on-unsupported-llvm.patch;patchdir=${RUSTSRC} \ " SRC_URI[rust.sha256sum] = "b99ce16cdf0ecfc761b585ac84d131b46733465a02f8ecd0ff2de9713c62ee09" -- 2.55.0