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 #65898

Merged
merged 2 commits into from
Aug 6, 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
15 changes: 12 additions & 3 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,20 @@ rustflags = ["-C", "target-feature=+crt-static"]
[target.aarch64-pc-windows-msvc]
linker = "rust-lld"

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

[target.aarch64-unknown-linux-gnu]
linker = "aarch64-linux-gnu-gcc"
[target.'cfg(all(target_os = "linux", target_env = "gnu"))']
rustflags = [
"--cfg",
"tokio_unstable",
"-Zshare-generics=y",
"-Zthreads=8",
"-Zunstable-options",
"-Csymbol-mangling-version=v0",
"-Clinker-flavor=gnu-lld-cc",
"-Clink-self-contained=+linker",
]

[target.aarch64-unknown-linux-musl]
linker = "aarch64-linux-musl-gcc"
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 @@ -16,6 +16,11 @@ runs:
rustflags: ''
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: 'Add cargo problem matchers'
shell: bash
run: echo "::add-matcher::${{ github.action_path }}/matchers.json"
21 changes: 14 additions & 7 deletions contributing/core/developing.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,21 @@
- All pull requests should be opened against `canary`.
- The changes on the `canary` branch are published to the `@canary` tag on npm regularly.

To develop locally:
## Dependencies

- Install Rust and Cargo via [rustup](https://rustup.rs).
- Install the [GitHub CLI](https://github.com/cli/cli#installation).
- Enable pnpm:
```
corepack enable pnpm
```
- (Linux) Install LLD, the LLVM linker:
```
sudo apt install lld
```

## Local Development

1. Install Rust and Cargo via [rustup](https://rustup.rs).
1. Install the [GitHub CLI](https://github.com/cli/cli#installation).
1. Clone the Next.js repository (download only recent commits for faster clone):
```
gh repo clone vercel/next.js -- --filter=blob:none --branch canary --single-branch
Expand All @@ -16,10 +27,6 @@ To develop locally:
```
git checkout -b MY_BRANCH_NAME origin/canary
```
1. Enable pnpm:
```
corepack enable pnpm
```
1. Install the dependencies with:
```
pnpm install
Expand Down
Loading