Skip to contentSkip to conversation

rust: dynamically link with llvm for all rust variants

PATCH In review Alexander Kanavin 3 participants 5 messages Mar 10 – Mar 11

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rust: dynamically link with llvm for all rust variants

From: Alexander Kanavin <[email protected]>

This is a followup to an earlier fix, which did it only for rust-native; additional testing revealed that nativsdk and target builds have the same problem as they bootstrap the compiler by first building an internal native version that links with native llvm parts.

[YOCTO #16058]

---
 meta/recipes-devtools/rust/rust_1.94.0.bb | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
meta/recipes-devtools/rust/rust_1.94.0.bb +1 -2
index 2be0bd8d89..cfee48ec78 100644
@@ -124,8 +124,7 @@ python do_configure() {
 
     # [llvm]
     config.add_section("llvm")
-    if d.getVar('PN') == "rust-native":
-        config.set("llvm", "link-shared", e(True))
+    config.set("llvm", "link-shared", e(True))
     config.set("llvm", "static-libstdcpp", e(False))
     config.set("llvm", "download-ci-llvm", e(False))
     if "llvm" in (d.getVar('TC_CXX_RUNTIME') or ""):
Signature · 1 line
2.47.3
#3 lore raw
In reply to Varatharajan, Deepesh
Quoted 10 lines · Deepesh via lists.openembedded.org Varatharajan

Hi Alex,

This change need tweaks in rust.py and rust recipe to support multilib builds. Without tweaks rust selftest and rust multilib builds will fail.

Required changes can be found here :
https://git.openembedded.org/openembedded-core-contrib/commit/?h=deepesh/sunil-rust-issue&id=44ce23e12e411ef9a1724e79c2b6ac6d5f0ddedc

Regards,
Deepesh

Hi Alex, Deepesh,

I believe it is related to this error?

/tmp/work/test4341/rustc_codegen_llvm-e21c84994fd391cb: error while loading shared libraries: libLLVM.so.21.1: cannot open shared object file: No such file or directory
error: test failed, to rerun pass -p rustc_codegen_llvm --lib
https://autobuilder.yoctoproject.org/valkyrie/#/builders/58/builds/1177
https://autobuilder.yoctoproject.org/valkyrie/#/builders/42/builds/3286

Thanks,
Mathieu

Signature · 3 lines
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#4 lore raw
Quoted 9 lines · Mathieu Dubois-Briand

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 5 lines · Deepesh via lists.openembedded.org Varatharajan

Hi Alex,

This change need tweaks in rust.py and rust recipe to support multilib builds. Without tweaks rust selftest and rust multilib builds will fail.

Quoted 8 lines
Quoted 5 lines

Required changes can be found here :
https://git.openembedded.org/openembedded-core-contrib/commit/?h=deepesh/sunil-rust-issue&id=44ce23e12e411ef9a1724e79c2b6ac6d5f0ddedc

Regards,
Deepesh

Hi Alex, Deepesh,

I believe it is related to this error?

Yes it is.

Quoted 14 lines

/tmp/work/test4341/rustc_codegen_llvm-e21c84994fd391cb: error while loading shared libraries: libLLVM.so.21.1: cannot open shared object file: No such file or directory
error: test failed, to rerun pass -p rustc_codegen_llvm --lib
https://autobuilder.yoctoproject.org/valkyrie/#/builders/58/builds/1177
https://autobuilder.yoctoproject.org/valkyrie/#/builders/42/builds/3286

Thanks,
Mathieu

--
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com