Skip to content

Commit d1714e6

Browse files
committed
Switch from ld (the default linker) to using lld for GNU Linux targets
Copies changes from vercel/turborepo#8166
1 parent 829e2eb commit d1714e6

File tree

2 files changed

+24
-10
lines changed

2 files changed

+24
-10
lines changed

.cargo/config.toml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,18 @@ rustflags = ["-C", "target-feature=+crt-static"]
1818
[target.i686-pc-windows-msvc]
1919
rustflags = ["-C", "target-feature=+crt-static"]
2020

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

24-
[target.aarch64-unknown-linux-gnu]
25-
linker = "aarch64-linux-gnu-gcc"
24+
[target.'cfg(all(target_os = "linux", target_env = "gnu"))']
25+
rustflags = [
26+
"--cfg",
27+
"tokio_unstable",
28+
"-Zshare-generics=y",
29+
"-Zthreads=8",
30+
"-Csymbol-mangling-version=v0",
31+
"-Clink-arg=-fuse-ld=lld",
32+
]
2633

2734
[target.aarch64-unknown-linux-musl]
2835
linker = "aarch64-linux-musl-gcc"

contributing/core/developing.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,21 @@
44
- All pull requests should be opened against `canary`.
55
- The changes on the `canary` branch are published to the `@canary` tag on npm regularly.
66

7-
To develop locally:
7+
## Dependencies
8+
9+
- Install Rust and Cargo via [rustup](https://rustup.rs).
10+
- Install the [GitHub CLI](https://github.com/cli/cli#installation).
11+
- Enable pnpm:
12+
```
13+
corepack enable pnpm
14+
```
15+
- (Linux) Install LLD, the LLVM linker:
16+
```
17+
sudo apt install lld
18+
```
19+
20+
## Local Development
821

9-
1. Install Rust and Cargo via [rustup](https://rustup.rs).
10-
1. Install the [GitHub CLI](https://github.com/cli/cli#installation).
1122
1. Clone the Next.js repository (download only recent commits for faster clone):
1223
```
1324
gh repo clone vercel/next.js -- --filter=blob:none --branch canary --single-branch
@@ -16,10 +27,6 @@ To develop locally:
1627
```
1728
git checkout -b MY_BRANCH_NAME origin/canary
1829
```
19-
1. Enable pnpm:
20-
```
21-
corepack enable pnpm
22-
```
2330
1. Install the dependencies with:
2431
```
2532
pnpm install

0 commit comments

Comments
 (0)