Use mold linker for development.

This speeds up check and build times.
This commit is contained in:
Orne Brocaar 2024-05-03 16:32:06 +01:00
parent c51653d1bc
commit 4f1a1bbce5
2 changed files with 6 additions and 0 deletions

View File

@ -1,3 +1,7 @@
[target.x86_64-unknown-linux-gnu]
linker = "clang"
rustflags = ["-C", "link-arg=-fuse-ld=mold"]
[target.x86_64-unknown-linux-musl]
rustflags = ["-C", "target-feature=+crt-static", "-C", "link-arg=-s", "-C", "link-arg=-lc", "-C", "link-arg=-lgcc"]
@ -6,3 +10,4 @@ rustflags = ["-C", "target-feature=+crt-static", "-C", "link-arg=-s", "-C", "lin
[target.armv7-unknown-linux-musleabihf]
rustflags = ["-C", "target-feature=+crt-static", "-C", "link-arg=-s", "-C", "link-arg=-lc", "-C", "link-arg=-lgcc"]

View File

@ -18,6 +18,7 @@ pkgs.mkShell {
pkgs.protoc-gen-grpc-web # grpc-web api
pkgs.protoc-gen-go # go api
pkgs.protoc-gen-go-grpc
pkgs.mold
];
LIBCLANG_PATH = "${pkgs.llvmPackages.libclang.lib}/lib";
BINDGEN_EXTRA_CLANG_ARGS = "-I${pkgs.llvmPackages.libclang.lib}/lib/clang/${pkgs.llvmPackages.libclang.version}/include";