Skip to content

Bundled LLD is not found when sysroot is changed #48772

Closed
@phil-opp

Description

@phil-opp

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 using xargo. The following error occurs:

error: linker `lld` not found
  |
  = note: No such file or directory (os error 2)

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions