| Summary: | Recent rust changes to use external LLVM breaks rust with clang + llvm runtime | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] OE-Core | Reporter: | Khem Raj <raj.khem> | ||||
| Component: | devtools / tool chain | Assignee: | Deepesh Varatharajan <deepesh.varatharajan> | ||||
| Status: | NEW --- | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | Medium+ | CC: | meta.mr.watcher, meta.watcher, raj.khem, randy.macleod, ross.burton, tim.orling | ||||
| Version: | unspecified | ||||||
| Target Milestone: | 6.1 M3 | ||||||
| Hardware: | All | ||||||
| OS: | Multiple | ||||||
| See Also: | https://bugzilla.yoctoproject.org/show_bug.cgi?id=16360 | ||||||
| Whiteboard: | |||||||
| OS type for building Yocto: | --- | Type of Regression: | --- | ||||
| Verified: | Documentation change: | Don't know | |||||
| Attachments: |
|
||||||
|
Description
Khem Raj
2025-10-21 17:43:32 UTC
Here is ML discussion for more context - https://lists.openembedded.org/g/openembedded-core/topic/patch_v5_2_3_rust_use_llvm/115768136 one way forward would be to let clang be allowed as host compiler going forward. That will cleanup clang-native.bbclass and clang.bbclass as well, where we do not have to specify additional dependencies and it will resemble gcc and gcc-native classes. Currently, we expect gcc toolchain to be pre-installed on build hosts and that reflects in this difference. As a POC, I have the attached patch which can compile rust (bitbake rust) with clang and libc++ default host toolchain and TC_CXX_RUNTIME = "llvm" Install pre-requisites ( ArchLinux ) sudo pacman -S --needed \ llvm llvm-libs \ clang lld lldb \ compiler-rt libc++ libc++abi \ openmp libclc Fedora sudo dnf install \ llvm clang clang-tools-extra clang-analyzer \ lld lldb \ compiler-rt libomp \ libcxx libcxxabi \ libclc Ubuntu/Debian sudo apt update sudo apt install \ clang clang-tools \ lld lldb \ libomp-dev \ libc++-dev libc++abi-dev \ libclc-dev Add PREFERRED_TOOLCHAIN_NATIVE = "clang" to config metadata Created attachment 5148 [details]
POC patch
Sundeep, Can you look at this bug with the team an decide if it's the same as another bug to track and fix how we build Rust? Consult Khem as needed. |