Skip to contentSkip to conversation

Drop rust-llvm and use clang instead

DISCUSSION Deepesh Varatharajan 5 participants 9 messages Aug 28, 2025 – Sep 10, 2025

lore
Share & tools
lore
#0 lore raw

Hi All,

We have removed *rust-llvm* and updated the Rust build to depend on *Clang* instead. With this change, we successfully built Rust for both native and target. Additionally, we ran a full *bitbake world* build without encountering any issues after dropping *rust-llvm*.

We now add these flags *"-C link-arg=-lz -C link-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 \

You can find the relevant changes on the *poky-contrib* branch here:
https://git.yoctoproject.org/poky-contrib/commit/?h=harish/rust-llvm

Differences seen in builds:

with rust-llvm for bitbake rust
real    54m54.184s
user   0m13.470s
sys     0m1.380s

f/s usage
41G

without rust-llvm for bitbake rust
real    57m51.015s
user   0m18.129s
sys     0m2.051s

f/s usage
45G

We are open for suggestions, improvements, or concerns regarding this change.

Regards,
Deepesh

#1 lore raw
Quoted 34 lines · Deepesh via lists.openembedded.org

We have removed rust-llvm and updated the Rust build to depend on Clang instead. With this change, we successfully built Rust for both native and target. Additionally, we ran a full bitbake world build without encountering any issues after dropping rust-llvm.

We now add these flags "-C link-arg=-lz -C link-arg=-lzstd" because of this following diff otherwise we will get errors during link time.

Setup in rust-llvm

(quoted diff) +0 -3
-DLLVM_ENABLE_ZLIB=OFF \
-DLLVM_ENABLE_ZSTD=OFF \
-DLLVM_ENABLE_FFI=OFF \

Setup in clang

(quoted diff) +0 -2
-DLLVM_ENABLE_FFI=ON \
-DLLVM_ENABLE_ZSTD=ON \

You can find the relevant changes on the poky-contrib branch here:
https://git.yoctoproject.org/poky-contrib/commit/?h=harish/rust-llvm

Differences seen in builds:

with rust-llvm for bitbake rust
real 54m54.184s
user 0m13.470s
sys 0m1.380s

f/s usage
41G

without rust-llvm for bitbake rust
real 57m51.015s
user 0m18.129s
sys 0m2.051s

Quoted 4 lines

f/s usage
45G

We are open for suggestions, improvements, or concerns regarding this change.

Thanks for checking this! Is it possible to have a conversation in the rust upstream about starting to use proper clang, or reasons to continue using rust-llvm? Maybe there's a ticket or you can open one?

While 'proper clang' appears to work now, deviating from what rust developers do is risky and can cause problems.

Alex

#2 lore raw
Quoted 48 lines · Alexander Kanavin

CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know the content is safe.

Quoted 34 lines · Deepesh via lists.openembedded.org

We have removed rust-llvm and updated the Rust build to depend on Clang instead. With this change, we successfully built Rust for both native and target. Additionally, we ran a full bitbake world build without encountering any issues after dropping rust-llvm.

We now add these flags "-C link-arg=-lz -C link-arg=-lzstd" because of this following diff otherwise we will get errors during link time.

Setup in rust-llvm

(quoted diff) +0 -3
-DLLVM_ENABLE_ZLIB=OFF \
-DLLVM_ENABLE_ZSTD=OFF \
-DLLVM_ENABLE_FFI=OFF \

Setup in clang

(quoted diff) +0 -2
-DLLVM_ENABLE_FFI=ON \
-DLLVM_ENABLE_ZSTD=ON \

You can find the relevant changes on the poky-contrib branch here:
https://git.yoctoproject.org/poky-contrib/commit/?h=harish/rust-llvm

Differences seen in builds:

with rust-llvm for bitbake rust
real 54m54.184s
user 0m13.470s
sys 0m1.380s

f/s usage
41G

without rust-llvm for bitbake rust
real 57m51.015s
user 0m18.129s
sys 0m2.051s

Quoted 4 lines

f/s usage
45G

We are open for suggestions, improvements, or concerns regarding this change.

Thanks for checking this! Is it possible to have a conversation in the rust upstream about starting to use proper clang, or reasons to continue using rust-llvm? Maybe there's a ticket or you can open one?

Quoted 4 lines

While 'proper clang' appears to work now, deviating from what rust developers do is risky and can cause problems.

Alex

Hi All,

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 <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 <https://rustc-dev-guide.rust-lang.org/backend/updating-llvm.html#updating-llvm>

Things to note when using Upstream LLVM:
- Rust may include cherry-picked bugfixes in its LLVM fork and so using upstream LLVM might lacking bug fixes from rust's forked llvm. (But, this anyway we will catch it up with newly released rust update)
- If a bug shows up using vanilla LLVM, it's on us to track it down unless it's a known issue. (In general, the latest llvm is always under test with rust nightly builds)

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.

Do let us know how can we proceed on this.

Regards,
Deepesh

#3 lore raw
Quoted 28 lines · Deepesh via lists.openembedded.org

 Hi All,

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#updat
ing-llvm

 Things to note when using Upstream LLVM:
 - Rust may include cherry-picked bugfixes in its LLVM fork and so using upstream LLVM might lacking bug fixes from rust's forked llvm. (But,
 this anyway we will catch it up with newly released rust update)
 - If a bug shows up using vanilla LLVM, it's on us to track it down unless it's a known issue. (In general, the latest llvm is always under test with
 rust nightly builds)

 Impact on Yocto Rust upgrades:

Quoted 9 lines

 - 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.

 Do let us know how can we proceed on this.

Given that information, I think there is a compelling case for us to use standard llvm. Thanks for looking into it!

Cheers,

Richard

#4 lore raw
In reply to Deepesh Varatharajan

Excellent, thanks Deepesh!

I’m guessing we’re a bit late for M3 for this, but I’d love to see this integrated post-release.

Ross

Quoted 92 lines · Deepesh via lists.openembedded.org
Quoted 50 lines · Alexander Kanavin

CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know the content is safe.

Quoted 34 lines · Deepesh via lists.openembedded.org

We have removed rust-llvm and updated the Rust build to depend on Clang instead. With this change, we successfully built Rust for both native and target. Additionally, we ran a full bitbake world build without encountering any issues after dropping rust-llvm.

We now add these flags "-C link-arg=-lz -C link-arg=-lzstd" because of this following diff otherwise we will get errors during link time.

Setup in rust-llvm

(quoted diff) +0 -3
-DLLVM_ENABLE_ZLIB=OFF \
-DLLVM_ENABLE_ZSTD=OFF \
-DLLVM_ENABLE_FFI=OFF \

Setup in clang

(quoted diff) +0 -2
-DLLVM_ENABLE_FFI=ON \
-DLLVM_ENABLE_ZSTD=ON \

You can find the relevant changes on the poky-contrib branch here:
https://git.yoctoproject.org/poky-contrib/commit/?h=harish/rust-llvm

Differences seen in builds:

with rust-llvm for bitbake rust
real 54m54.184s
user 0m13.470s
sys 0m1.380s

f/s usage
41G

without rust-llvm for bitbake rust
real 57m51.015s
user 0m18.129s
sys 0m2.051s

Quoted 5 lines

f/s usage
45G

We are open for suggestions, improvements, or concerns regarding this change.

Thanks for checking this! Is it possible to have a conversation in the rust upstream about starting to use proper clang, or reasons to continue using rust-llvm? Maybe there's a ticket or you can open one?

Quoted 4 lines

While 'proper clang' appears to work now, deviating from what rust developers do is risky and can cause problems.

Alex

Hi All,
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

Things to note when using Upstream LLVM:
- Rust may include cherry-picked bugfixes in its LLVM fork and so using upstream LLVM might lacking bug fixes from rust's forked llvm. (But, this anyway we will catch it up with newly released rust update)
- If a bug shows up using vanilla LLVM, it's on us to track it down unless it's a known issue. (In general, the latest llvm is always under test with rust nightly builds)

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.

Do let us know how can we proceed on this.
Regards,
Deepesh

Quoted 2 lines

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#223093): https://lists.openembedded.org/g/openembedded-core/message/223093
Mute This Topic: https://lists.openembedded.org/mt/114933250/6875888
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#5 lore raw
In reply to Deepesh Varatharajan
Quoted 61 lines · Deepesh Varatharajan

On 28-08-2025 18:33, Alexander Kanavin wrote:

CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know the content is safe.

On Thu, 28 Aug 2025 at 13:45, Varatharajan, Deepesh via lists.openembedded.org <[email protected]> wrote:

We have removed rust-llvm and updated the Rust build to depend on Clang instead. With this change, we successfully built Rust for both native and target. Additionally, we ran a full bitbake world build without encountering any issues after dropping rust-llvm.

We now add these flags "-C link-arg=-lz -C link-arg=-lzstd" because of this following diff otherwise we will get errors during link time.

Setup in rust-llvm

(quoted diff) +0 -3
-DLLVM_ENABLE_ZLIB=OFF \
-DLLVM_ENABLE_ZSTD=OFF \
-DLLVM_ENABLE_FFI=OFF \

Setup in clang

(quoted diff) +0 -2
-DLLVM_ENABLE_FFI=ON \
-DLLVM_ENABLE_ZSTD=ON \

You can find the relevant changes on the poky-contrib branch here:
https://git.yoctoproject.org/poky-contrib/commit/?h=harish/rust-llvm

Differences seen in builds:

with rust-llvm for bitbake rust
real 54m54.184s
user 0m13.470s
sys 0m1.380s

f/s usage
41G

without rust-llvm for bitbake rust
real 57m51.015s
user 0m18.129s
sys 0m2.051s

f/s usage
45G

We are open for suggestions, improvements, or concerns regarding this change.

Thanks for checking this! Is it possible to have a conversation in the rust upstream about starting to use proper clang, or reasons to continue using rust-llvm? Maybe there's a ticket or you can open one?

While 'proper clang' appears to work now, deviating from what rust developers do is risky and can cause problems.

Alex

Hi All,

Quoted 8 lines

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

Thanks for the discussion, I think its expected that there are rust specific backports, but it seems its not a whole lot of patches with llvm20
and I hope things are just getting better with future releases. We need to ensure that such patches are not regressing clang if we do that sort
of backport, hopefully there will be no conflcits.

Quoted 10 lines

Things to note when using Upstream LLVM:
- Rust may include cherry-picked bugfixes in its LLVM fork and so using upstream LLVM might lacking bug fixes from rust's forked llvm. (But, this anyway we will catch it up with newly released rust update)
- If a bug shows up using vanilla LLVM, it's on us to track it down unless it's a known issue. (In general, the latest llvm is always under test with rust nightly builds)

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.

right

Quoted 8 lines

Regarding the rust forked llvm local patches:
- There are no local patches on rust forked llvm other than the backported fixes from llvm master.

Do let us know how can we proceed on this.

I think we should go ahead, we have llvm-21 already in final stages so that might be a bit to address, do find out which version of rust will use llvm 21.

Quoted 2 lines

Regards,
Deepesh

#6 lore raw
Quoted 97 lines · Khem Raj

CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know the content is safe.

Quoted 60 lines · Deepesh Varatharajan

On 28-08-2025 18:33, Alexander Kanavin wrote:

CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know the content is safe.

On Thu, 28 Aug 2025 at 13:45, Varatharajan, Deepesh via lists.openembedded.org <[email protected]> wrote:

We have removed rust-llvm and updated the Rust build to depend on Clang instead. With this change, we successfully built Rust for both native and target. Additionally, we ran a full bitbake world build without encountering any issues after dropping rust-llvm.

We now add these flags "-C link-arg=-lz -C link-arg=-lzstd" because of this following diff otherwise we will get errors during link time.

Setup in rust-llvm

(quoted diff) +0 -3
-DLLVM_ENABLE_ZLIB=OFF \
-DLLVM_ENABLE_ZSTD=OFF \
-DLLVM_ENABLE_FFI=OFF \

Setup in clang

(quoted diff) +0 -2
-DLLVM_ENABLE_FFI=ON \
-DLLVM_ENABLE_ZSTD=ON \

You can find the relevant changes on the poky-contrib branch here:
https://git.yoctoproject.org/poky-contrib/commit/?h=harish/rust-llvm

Differences seen in builds:

with rust-llvm for bitbake rust
real 54m54.184s
user 0m13.470s
sys 0m1.380s

f/s usage
41G

without rust-llvm for bitbake rust
real 57m51.015s
user 0m18.129s
sys 0m2.051s

f/s usage
45G

We are open for suggestions, improvements, or concerns regarding this change.

Thanks for checking this! Is it possible to have a conversation in the rust upstream about starting to use proper clang, or reasons to continue using rust-llvm? Maybe there's a ticket or you can open one?

While 'proper clang' appears to work now, deviating from what rust developers do is risky and can cause problems.

Alex

Hi All,

Quoted 8 lines

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

Thanks for the discussion, I think its expected that there are rust specific backports, but it seems its not a whole lot of patches with llvm20
and I hope things are just getting better with future releases. We need to ensure that such patches are not regressing clang if we do that sort
of backport, hopefully there will be no conflcits.

Quoted 9 lines

Things to note when using Upstream LLVM:
- Rust may include cherry-picked bugfixes in its LLVM fork and so using upstream LLVM might lacking bug fixes from rust's forked llvm. (But, this anyway we will catch it up with newly released rust update)
- If a bug shows up using vanilla LLVM, it's on us to track it down unless it's a known issue. (In general, the latest llvm is always under test with rust nightly builds)

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.

right

Quoted 5 lines

Regarding the rust forked llvm local patches:
- There are no local patches on rust forked llvm other than the backported fixes from llvm master.

Quoted 5 lines
Quoted 2 lines

Do let us know how can we proceed on this.

I think we should go ahead, we have llvm-21 already in final stages so that might be a bit to address, do find out which version of rust will use llvm 21.

Rust 1.91(Nightly) is using llvm 21.

Quoted 3 lines
Quoted 3 lines

Regards,
Deepesh

1) d35840afa50d [rust] Add CI Checks to Rust fork
  - This patch adds CI monitoring for PR statuses.
2) 801294e8f616 [rust] Changes needed for 'x86_64-fortanix-unknown-sgx' nightly target.
  - This patch enables libunwind to work inside SGX enclaves (target: x86_64-fortanix-unknown-sgx) by replacing all OS and libc dependencies with Rust-based equivalents, allowing safe stack unwinding in Rust SGX apps without relying on pthreads, malloc, or standard I/O.

https://rustc-dev-guide.rust-lang.org/backend/updating-llvm.html <https://rustc-dev-guide.rust-lang.org/backend/updating-llvm.html>

These two patches are specific to the Rust nightly forked llvm and have not been carried into the stable branch or official release tags, where only bug fixes backported from LLVM master are maintained.

The backported bug fixing patches from llvm upstream applied on top of the Rust forked LLVM (v20.1.7) for Rust 1.89 are already present in the upstream LLVM 21.1.0 tag. With the poky master-next branch now upgraded to Clang 21.1.0, I was able to build Rust 1.89 successfully by depending on Clang.

Can I go ahead and submit the patch to delete rust-llvm after the Clang 21.1.0 upgrade is merged into poky-master?

Regards,
Deepesh

#7 lore raw
Quoted 120 lines · Deepesh Varatharajan

On 09-09-2025 21:44, Khem Raj wrote:

CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know the content is safe.

On Tue, Sep 9, 2025 at 1:19 AM Deepesh Varatharajan <[email protected]> wrote:

On 28-08-2025 18:33, Alexander Kanavin wrote:

CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know the content is safe.

On Thu, 28 Aug 2025 at 13:45, Varatharajan, Deepesh via lists.openembedded.org <[email protected]> wrote:

We have removed rust-llvm and updated the Rust build to depend on Clang instead. With this change, we successfully built Rust for both native and target. Additionally, we ran a full bitbake world build without encountering any issues after dropping rust-llvm.

We now add these flags "-C link-arg=-lz -C link-arg=-lzstd" because of this following diff otherwise we will get errors during link time.

Setup in rust-llvm

(quoted diff) +0 -3
-DLLVM_ENABLE_ZLIB=OFF \
-DLLVM_ENABLE_ZSTD=OFF \
-DLLVM_ENABLE_FFI=OFF \

Setup in clang

(quoted diff) +0 -2
-DLLVM_ENABLE_FFI=ON \
-DLLVM_ENABLE_ZSTD=ON \

You can find the relevant changes on the poky-contrib branch here:
https://git.yoctoproject.org/poky-contrib/commit/?h=harish/rust-llvm

Differences seen in builds:

with rust-llvm for bitbake rust
real 54m54.184s
user 0m13.470s
sys 0m1.380s

f/s usage
41G

without rust-llvm for bitbake rust
real 57m51.015s
user 0m18.129s
sys 0m2.051s

f/s usage
45G

We are open for suggestions, improvements, or concerns regarding this change.

Thanks for checking this! Is it possible to have a conversation in the rust upstream about starting to use proper clang, or reasons to continue using rust-llvm? Maybe there's a ticket or you can open one?

While 'proper clang' appears to work now, deviating from what rust developers do is risky and can cause problems.

Alex

Hi All,

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

Thanks for the discussion, I think its expected that there are rust specific backports, but it seems its not a whole lot of patches with llvm20
and I hope things are just getting better with future releases. We need to ensure that such patches are not regressing clang if we do that sort
of backport, hopefully there will be no conflcits.

Things to note when using Upstream LLVM:
- Rust may include cherry-picked bugfixes in its LLVM fork and so using upstream LLVM might lacking bug fixes from rust's forked llvm. (But, this anyway we will catch it up with newly released rust update)
- If a bug shows up using vanilla LLVM, it's on us to track it down unless it's a known issue. (In general, the latest llvm is always under test with rust nightly builds)

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.

right

Regarding the rust forked llvm local patches:
- There are no local patches on rust forked llvm other than the backported fixes from llvm master.

Do let us know how can we proceed on this.

I think we should go ahead, we have llvm-21 already in final stages so that might be a bit to address, do find out which version of rust will use llvm 21.

Rust 1.91(Nightly) is using llvm 21.

Regards,
Deepesh

1) d35840afa50d [rust] Add CI Checks to Rust fork
  - This patch adds CI monitoring for PR statuses.
2) 801294e8f616 [rust] Changes needed for 'x86_64-fortanix-unknown-sgx' nightly target.
  - This patch enables libunwind to work inside SGX enclaves (target: x86_64-fortanix-unknown-sgx) by replacing all OS and libc dependencies with Rust-based equivalents, allowing safe stack unwinding in Rust SGX apps without relying on pthreads, malloc, or standard I/O.

Quoted 9 lines

https://rustc-dev-guide.rust-lang.org/backend/updating-llvm.html

These two patches are specific to the Rust nightly forked llvm and have not been carried into the stable branch or official release tags, where only bug fixes backported from LLVM master are maintained.

The backported bug fixing patches from llvm upstream applied on top of the Rust forked LLVM (v20.1.7) for Rust 1.89 are already present in the upstream LLVM 21.1.0 tag. With the poky master-next branch now upgraded to Clang 21.1.0, I was able to build Rust 1.89 successfully by depending on Clang.

as per https://releases.rs/ 1.91 release is a couple of months away, so it won't make it into the upcoming YP release.

Quoted 2 lines

Can I go ahead and submit the patch to delete rust-llvm after the Clang 21.1.0 upgrade is merged into poky-master?

This might have to consider the fact that there might be fixes in rust itself to deal with newer LLVM or it might rely on some llvm 21 features indirectly. so pushing rust < 1.91 to use llvm 21 while feasible needs some serious testing. If we get good results we might have better confidence.

Quoted 4 lines

Regards,
Deepesh

#8 lore raw
In reply to Deepesh Varatharajan
Quoted 37 lines · Deepesh via lists.openembedded.org

Hi All,

We have removed rust-llvm and updated the Rust build to depend on Clang instead. With this change, we successfully built Rust for both native and target. Additionally, we ran a full bitbake world build without encountering any issues after dropping rust-llvm.

We now add these flags "-C link-arg=-lz -C link-arg=-lzstd" because of this following diff otherwise we will get errors during link time.

Setup in rust-llvm

(quoted diff) +0 -3
-DLLVM_ENABLE_ZLIB=OFF \
-DLLVM_ENABLE_ZSTD=OFF \
-DLLVM_ENABLE_FFI=OFF \

Setup in clang

(quoted diff) +0 -2
-DLLVM_ENABLE_FFI=ON \
-DLLVM_ENABLE_ZSTD=ON \

You can find the relevant changes on the poky-contrib branch here:
https://git.yoctoproject.org/poky-contrib/commit/?h=harish/rust-llvm

Differences seen in builds:

with rust-llvm for bitbake rust
real 54m54.184s
user 0m13.470s
sys 0m1.380s

f/s usage
41G

without rust-llvm for bitbake rust
real 57m51.015s
user 0m18.129s
sys 0m2.051s

Quoted 4 lines

f/s usage
45G

We are open for suggestions, improvements, or concerns regarding this change.

This is cool. I think it will help regain the build time that regressed by adding clang to core.
rust's llvm fork carries patches. I would like you to look into those and see if they
are convenience patches or functional one's that we need to consider for clang.

Quoted 13 lines

Regards,
Deepesh

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#222566): https://lists.openembedded.org/g/openembedded-core/message/222566
Mute This Topic: https://lists.openembedded.org/mt/114933250/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-