Skip to content
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

Switch from ld (the default linker) to using lld for GNU Linux targets #8166

Merged
merged 2 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,18 @@ rustdocflags = ["-Znormalize-docs"]
[target.x86_64-pc-windows-msvc]
linker = "rust-lld"

[target.aarch64-apple-darwin]
[target.'cfg(target_os = "macos")']
linker = "rust-lld"

[target.x86_64-apple-darwin]
linker = "rust-lld"
[target.'cfg(all(target_os = "linux", target_env = "gnu"))']
rustflags = [
"--cfg",
"tokio_unstable",
"-Zshare-generics=y",
"-Zthreads=8",
"-Csymbol-mangling-version=v0",
"-Clink-arg=-fuse-ld=lld",
]

[alias]
xtask = "run --package xtask --"
Expand Down
5 changes: 5 additions & 0 deletions .github/actions/setup-rust/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ runs:
# we want more specific settings
cache: false

- name: "Install LLD (LLVM Linker) for Linux"
if: runner.os == 'Linux'
shell: bash
run: sudo apt-get -y update && sudo apt-get install -y lld

- name: "Set Windows default host to MinGW"
if: ${{ inputs.windows == 'true' }}
shell: bash
Expand Down
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ Thanks for your interest in contributing to Turbo!
- [Rust](https://www.rust-lang.org/tools/install)
- [cargo-groups](https://github.com/nicholaslyang/cargo-groups) (used to group crates into Turborepo-specific ones and Turbopack-specific ones)

### Linux Dependencies

- LLD (LLVM Linker), as it's not installed by default on many Linux distributions (e.g. `apt install lld`).

## Contributing to Turborepo

### Building Turborepo
Expand Down
Loading