From: "Mathieu Dubois-Briand" <mathieu.dubois-briand@bootlin.com>
To: <deepesh.varatharajan@windriver.com>,
<openembedded-core@lists.openembedded.org>
Cc: <Sundeep.Kokkonda@windriver.com>, <Deepesh.Varatharajan@windriver.com>
Subject: Re: [OE-core] [PATCH V3 1/2] rust: Use clang instead of rust-llvm
Date: Mon, 29 Sep 2025 10:11:07 +0200 [thread overview]
Message-ID: <DD54RQRP8CER.SGWLWEFDZ65S@bootlin.com> (raw)
In-Reply-To: <20250926102411.3742996-1-Deepesh.Varatharajan@windriver.com>
On Fri Sep 26, 2025 at 12:24 PM CEST, Deepesh via lists.openembedded.org Varatharajan wrote:
> From: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
>
> Updated the Rust build to depend on Clang instead.
>
> *Summary of discussion with the rust upstream about using latest LLVM instead of Rust maintained LLVM fork.
> https://internals.rust-lang.org/t/can-we-use-proper-clang-instead-of-llvm-fork-what-rust-uses/23489
>
> *Upstream LLVM is generally compatible:
> - Rust does support building with upstream (vanilla) LLVM, especially the latest
> major release and the one or two preceding ones.
> https://rustc-dev-guide.rust-lang.org/backend/updating-llvm.html#updating-llvm
>
> *Impact on Yocto Rust upgrades:
> - Rust upgrades shall always check for updates on rust forked llvm and backport
> the relevant patches to clang's llvm.
>
> *Regarding the rust forked llvm local patches:
> - There are no local patches on rust forked llvm other than the backported fixes
> from llvm master.
>
> *We now add these flags "-Clink-arg=-lz -Clink-arg=-lzstd" because of this following
> diff otherwise we will get errors during link time.
>
> Setup in rust-llvm
> -DLLVM_ENABLE_ZLIB=OFF \
> -DLLVM_ENABLE_ZSTD=OFF \
> -DLLVM_ENABLE_FFI=OFF \
>
> Setup in clang
> -DLLVM_ENABLE_FFI=ON \
> -DLLVM_ENABLE_ZSTD=ON \
>
> *When multilibs enabled:
>
> llvm-config expects static libraries to be located in the lib directory rather than
> lib64. However, since LLVM is built as a non-multilib component, the lib directory
> doesn't contain any library files. To accommodate this without breaking multilib
> behavior, we copy the required library files appropriately.
>
> Previously, when we depended on rust-llvm, this worked because we specified:
> -DCMAKE_INSTALL_PREFIX:PATH=${libdir}/llvm-rust
>
> With this setup, llvm-config was installed inside ${libdir}/llvm-rust, which included
> its own bin and lib directories. Thus, llvm-config located in bin would correctly find
> the libraries in the adjacent lib directory.
>
> Even when multilib was enabled or not, llvm-config would still look for libraries under
> lib in this structure, so everything functioned as expected.
>
> *Changes needs to be done when llvm splits from clang:
> In rust recipe:
> Update the dependency from:
> DEPENDS += "ninja-native clang" to DEPENDS += "ninja-native llvm"
>
> In llvm recipe:
> Apply the same changes that were made in the Clang recipe, as those
> configurations have now been moved to the LLVM recipe after the split.
>
> Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
> ---
Hi Deepesh,
Thanks for your patch.
It looks like this is breaking some build, strangely only the arm64 one
with musl.
ERROR: rust-1.90.0-r0 do_install: Execution of '/srv/pokybuild/yocto-worker/musl-qemuarm64/build/build/tmp/work/cortexa57-poky-linux-musl/rust/1.90.0/temp/run.do_install.3194366' failed with exit code 1
...
| Building libunwind.a for aarch64-poky-linux-musl
| cargo:warning=/srv/pokybuild/yocto-worker/musl-qemuarm64/build/build/tmp/work/cortexa57-poky-linux-musl/rust/1.90.0/sources/rustc-1.90.0-src/src/llvm-project/libunwind/src/UnwindLevel1.c:191:1: error: arch extension 'gcs' should be prefixed by '+'
| cargo:warning= 191 | unwind_phase2(unw_context_t *uc, unw_cursor_t *cursor, _Unwind_Exception *exception_object) {
| cargo:warning= | ^~~~~~~~~~~~~
| cargo:warning=/srv/pokybuild/yocto-worker/musl-qemuarm64/build/build/tmp/work/cortexa57-poky-linux-musl/rust/1.90.0/sources/rustc-1.90.0-src/src/llvm-project/libunwind/src/UnwindLevel1.c:337:22: error: arch extension 'gcs' should be prefixed by '+'
| cargo:warning= 337 | _Unwind_Stop_Fn stop, void *stop_parameter) {
| cargo:warning= | ^~~~~~~~~~~~~~~
|
Can you have a look at this failure please?
Thanks,
Mathieu
--
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
prev parent reply other threads:[~2025-09-29 8:11 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-26 10:24 [PATCH V3 1/2] rust: Use clang instead of rust-llvm Deepesh.Varatharajan
2025-09-26 10:24 ` [PATCH V3 2/2] rust: Drop rust-llvm Deepesh.Varatharajan
2025-09-26 16:50 ` [OE-core] [PATCH V3 1/2] rust: Use clang instead of rust-llvm Khem Raj
2025-09-29 10:17 ` Deepesh Varatharajan
2025-09-26 17:30 ` Khem Raj
2025-09-29 8:29 ` Deepesh Varatharajan
2025-10-01 19:29 ` Khem Raj
2025-10-07 11:10 ` Deepesh Varatharajan
2025-10-07 20:17 ` Khem Raj
2025-10-08 12:49 ` Deepesh Varatharajan
2025-10-08 12:54 ` Richard Purdie
2025-10-10 9:27 ` Deepesh Varatharajan
2025-10-10 9:36 ` Richard Purdie
2025-09-29 8:11 ` Mathieu Dubois-Briand [this message]
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=DD54RQRP8CER.SGWLWEFDZ65S@bootlin.com \
--to=mathieu.dubois-briand@bootlin.com \
--cc=Sundeep.Kokkonda@windriver.com \
--cc=deepesh.varatharajan@windriver.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.