Set indirect linking for non wasm / RISC-V targets - #230
Set indirect linking for non wasm / RISC-V targets#230luca-della-vedova wants to merge 7 commits into
Conversation
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
|
Thanks for submitting, I'll take a look but might be a week or so until I have cycles! |
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
|
OK after a lot of hand-holding and several tests I reverted everything then created a simple analysis test to act as a regression test (that fails CI) in 1600851, together with a one line fix that makes CI green again in 6120dfc. Now if I understand correctly the test doesn't actually mean much, I managed to generate a self contained Python test here but, among others, it needs to explicitly ignore the installed toolchain and download llvm to reproduce the issue, which makes it take quite a long time (on my machine a few minutes only to download the toolchain). Instead, I "vibed" a reproduction example that pulls my branch before / after the fix in https://github.com/luca-della-vedova/self_contained_repro, which is
The reproduction itself reliably triggers the issue / fixes the issue. |
While I was trying to use
rules_rsto build a target through aconfig=remoteconfiguration, (specifically zenoh-c) I bumped into this error:My understanding of the AI investigation
This is quite wildly out of my area of comfort, I tried to feed it into an AI and the recommendation (that works for me) was to make sure to update linker type and rust flags to mirror how
linkeris set. Specifically, the lines immediately before the diff show that for RISC-V / wasm we userust-lld(which from what I understand is a "direct" linker since it's embedded in the Rust toolchain), while for other platforms we just use the default that is part of the requested toolchain.It seems that when no linker is specified (the
conditions://default : Nonebranch in thelinker'sselect) Rust falls back to its internal linker, which fails for on Linux / AMD64 with the error above.This set of changes fixes my build, but I am really out of my depth here.