1. Faster rust builds!
[target.x86_64-unknown-linux-gnu]
linker = "clang"
rustflags = [
"-C", "link-arg=-fuse-ld=mold",
"-C", "target-cpu=native"
]
2. Faster `makepkg` with ArchLinux, by adding "-fuse-ld=mold" to CFLAGS.
1. Faster rust builds!
[target.x86_64-unknown-linux-gnu]
linker = "clang"
rustflags = [
"-C", "link-arg=-fuse-ld=mold",
"-C", "target-cpu=native"
]
2. Faster `makepkg` with ArchLinux, by adding "-fuse-ld=mold" to CFLAGS.
Git life pro tip (that you didn't know you needed until now): You can use .git/info/exclude (present in every Git repository) as a local, private version of .gitignore. It has the same syntax as .gitignore, but isn't tracked by Git. So you could add .cargo/config.toml to .git/info/exclude, changing the linker locally without Git considering it as an untracked file. I generally use this feature to ignore files that are specific to my development setup which I don't want to list in .gitignore.
A similar one: ~/.config/git/ignore is a global private gitignore.
Great for files across repos which you always want to ignore, such as temporary files from an editor
(fairly large Rust project, 24-core machine, Linux)
-- GNU Ld 2.31.1
>> cargo build --release
Compiling mfl v0.1.0 (/mnt/d/Programming/Projects/Rust/mfl/crates/mfl)
Finished release [optimized + debuginfo] target(s) in 10.14s
-- LLD-14
>> cargo build --release
Compiling mfl v0.1.0 (/mnt/d/Programming/Projects/Rust/mfl/crates/mfl)
Finished release [optimized + debuginfo] target(s) in 6.20s
-- Mold 2.0
>> cargo build --release
Compiling mfl v0.1.0 (/mnt/d/Programming/Projects/Rust/mfl/crates/mfl)
Finished release [optimized + debuginfo] target(s) in 6.02s
I did the following for each test: cargo clean
cargo build --release
touch crates/mfl/src/main.rs
cargo build --release
With the timings coming from the second build. The project links in LLVM, and the tests were done under WSL1 on Windows 10 with the files on the Windows file system, which is how the project is developed in general.