meta: build with Mold linker on x86_64 Linux

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Id51e62dda1ec2ba895ffdbbd25c2f1256a6a6964
This commit is contained in:
raf 2025-11-30 17:23:57 +03:00
commit 3ad14a95a6
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
2 changed files with 12 additions and 4 deletions

4
.cargo/config.toml Normal file
View file

@ -0,0 +1,4 @@
# https://github.com/rui314/mold?tab=readme-ov-file#how-to-use
[target.'cfg(target_os = "linux")']
linker = "clang"
rustflags = ["-C", "link-arg=-fuse-ld=mold"]

View file

@ -1,27 +1,31 @@
{ {
mkShell, mkShell,
cargo,
rustc,
mold,
clang,
rust-analyzer-unwrapped, rust-analyzer-unwrapped,
rustfmt, rustfmt,
clippy, clippy,
cargo,
taplo, taplo,
rustc,
rustPlatform, rustPlatform,
gnuplot, gnuplot,
}: }:
mkShell { mkShell {
name = "microfetch";
strictDeps = true; strictDeps = true;
nativeBuildInputs = [ nativeBuildInputs = [
cargo cargo
rustc rustc
mold
clang
rust-analyzer-unwrapped rust-analyzer-unwrapped
(rustfmt.override {asNightly = true;}) (rustfmt.override {asNightly = true;})
clippy clippy
taplo taplo
gnuplot # For Criterion.rs plots gnuplot # for Criterion.rs plots
]; ];
env.RUST_SRC_PATH = "${rustPlatform.rustLibSrc}"; env.RUST_SRC_PATH = "${rustPlatform.rustLibSrc}";