Skip to content

Commit ac158df

Browse files
committed
Configure Mold in ci-config.toml, so it's used only on CI
1 parent 99b7167 commit ac158df

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

.cargo/ci-config.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,15 @@
1010
# Here, we opted to use `[target.'cfg(all())']` instead of `[build]` because `[target.'**']` is guaranteed to be cumulative.
1111
[target.'cfg(all())']
1212
rustflags = ["-D", "warnings"]
13+
14+
# Use Mold on Linux, because it's faster than GNU ld and LLD.
15+
#
16+
# We no longer set this in the default `config.toml` so that developers can opt in to Wild, which
17+
# is faster than Mold, in their own ~/.cargo/config.toml.
18+
[target.x86_64-unknown-linux-gnu]
19+
linker = "clang"
20+
rustflags = ["-C", "link-arg=-fuse-ld=mold"]
21+
22+
[target.aarch64-unknown-linux-gnu]
23+
linker = "clang"
24+
rustflags = ["-C", "link-arg=-fuse-ld=mold"]

.cargo/config.toml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,6 @@ rustflags = ["-C", "symbol-mangling-version=v0", "--cfg", "tokio_unstable"]
55
[alias]
66
xtask = "run --package xtask --"
77

8-
[target.x86_64-unknown-linux-gnu]
9-
linker = "clang"
10-
rustflags = ["-C", "link-arg=-fuse-ld=mold"]
11-
12-
[target.aarch64-unknown-linux-gnu]
13-
linker = "clang"
14-
rustflags = ["-C", "link-arg=-fuse-ld=mold"]
15-
168
[target.'cfg(target_os = "windows")']
179
rustflags = [
1810
"--cfg",

0 commit comments

Comments
 (0)