-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bundled LLD is not found when sysroot is changed #48772
Comments
After some debugging with @steveklabnik I think this may be due to the use of xargo where the sysroot is changing so rustc's unable to find its original sysroot which contains lld |
@alexcrichton Makes sense, thanks! I updated the issue title and description. I wonder why |
Ah yeah currently it is in the sysroot to mirror the placement of other items like codegen backends and One of two changes need to happen here I think:
|
We already do this in Xargo but we copy / hardlink / symlink only the lib directory, not the bin directory which is where lld is. I'd be happy to accept a PR that adds the bin directory to Xargo's copy of the host / original sysroot.
We'll probably have to do this if / when Xargo functionality gets added to Cargo since the last invocation will be |
I made a PR to xargo that seems to do the trick |
200: Copy bin directory to host sysroot r=japaric a=FenrirWolf Allows custom targets to use the copy of `lld` bundled with Rust. cc rust-lang/rust#48772
So, now that new xargo is released, should we close this? |
The issue is resolved by the new |
Since #48125, a LLD binary is shipped with Rust. According to this comment, it can be used by specifying
"linker-flavor": "ld.lld"
in target specs. However, this fails when the sysroot is changed, for example when compiling for a custom target usingxargo
. The following error occurs:The problem is that the
lld
binary is part of the host sysroot (e.g. in.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin
on linux), so Rust does not find it when the sysroot is changed.The text was updated successfully, but these errors were encountered: