rust-lang / rust-lang/rustup

Automatically use lld for cross compilation

Open
#1,564 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
7k
Forks
1.1k
Avg merge
22h 40m
Merged PRs (30d)
46

Description

I was cross-compiling from windows to linux-musl and figured out that I don't actually need to install any separate linker. I can just point cargo to the lld that rustup has installed anyway:

[target.x86_64-unknown-linux-musl]
linker = "C:/Users/<username>/.rustup/toolchains/nightly-x86_64-pc-windows-msvc/lib/rustlib/x86_64-pc-windows-msvc/bin/rust-lld.exe"

After adding this to my .cargo/config it just works (of course as long as I don't depend on any C code).

It would be nice if I didn't need to configure this manually. Not sure if this is cargo or rustup issue.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

First determine whether rustup or Cargo should own automatic linker selection for the target.x86_64-unknown-linux-musl configuration. Compare the rustup-installed rust-lld path with the manual .cargo/config setup described in the report. Done means cross-compilation can use that linker without manual configuration, while retaining the stated limitation around C dependencies.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system, devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.