3 ms·
For reference, it's trivial to configure it on one's projects: mkdir -p .cargo cat > .cargo/config.toml <<EOF [target.x86_64-unknown-linux-gnu]
by pizza234 4y ago
For reference, it's trivial to configure it on one's projects:
mkdir -p .cargo
cat > .cargo/config.toml <<EOF
[target.x86_64-unknown-linux-gnu]
linker = "/usr/bin/clang"
rustflags = ["-Clink-arg=-fuse-ld=/usr/bin/mold"]
EOF
(the above assumes a Linux target, and that the binaries are under `/usr/bin`)
It's certainly true that the default linker is sloooooooow; I wonder which are the challenges in making mold/lld the default.
- wh33zle 4y agoThis can also be set user-wide (and thus apply to all projects automatically) by placing the `config.toml` into `~/.cargo`.
- kzrdude 4y agoWhich version of clang should i have for this?
- pizza234 4y agoGood question! I can't answer, unfortunately. v13 and v14 surely work, but I think 12 will work as well (by that time, I was using lld, with mold is compatible).