Skip to content

rustc can't find the linker when --sysroot is set to a local build of the sysroot #125246

Description

@RalfJung

This is a recent regression, starting with #124129: when --sysroot is set, in my case to /home/r/.cache/cargo-careful where I have prepared a locally built sysroot (that's https://github.com/RalfJung/cargo-careful), then rustc now assumes it can find the linker in the sysroot, which does not work. See RalfJung/cargo-careful#31 for some more details.

It is new to me that the sysroot is supposed to contain the linker as well, is that expected behavior?

Also the error message in that case is really unhelpful.^^

  = note: collect2: fatal error: cannot find 'ld'
          compilation terminated.

Maybe rustc should check that the path it sets for -B actually exists before starting cc?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions