Skip to content

Commit

Permalink
feat(rust): use mold linker for Linux targets
Browse files Browse the repository at this point in the history
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
  • Loading branch information
rvolosatovs committed Jul 19, 2023
1 parent 472f1dd commit 8713102
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/rust/mkAttrs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,13 @@ with self.lib.rust.targets;

CARGO_BUILD_TARGET = target;
}
// optionalAttrs pkgsCross.stdenv.hostPlatform.isLinux {
nativeBuildInputs = [
final.mold
];

RUSTFLAGS = "-Clink-arg=-fuse-ld=mold";
}
// optionalAttrs (final.stdenv.buildPlatform.config != pkgsCross.stdenv.hostPlatform.config) (
{
strictDeps = true;
Expand Down

0 comments on commit 8713102

Please sign in to comment.