4 ms·
I wonder if it would be a good idea for Rust to switch to mold for debug compilation.
by nynx 4y ago
I wonder if it would be a good idea for Rust to switch to mold for debug compilation.
- pizza234 4y agoFor 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).
- epage 4y agoFor more on switching Rust to mold, see https://github.com/rust-lang/rust/issues/94347 https://github.com/rust-lang/rust/issues/94347