Skip to content

Commit

Permalink
nix: link using mold
Browse files Browse the repository at this point in the history
  • Loading branch information
pnmadelaine committed Jun 6, 2024
1 parent 2560601 commit 822f616
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,11 @@
ml-kem = craneLib.buildPackage {
name = "ml-kem";
inherit src cargoArtifacts;
postPatch = ''
substituteInPlace libcrux-ml-kem/c/CMakeLists.txt \
--replace " -flto" " # -flto" \
--replace "add_link_options(-flto)" "#add_link_options(-flto)"
'';
nativeBuildInputs = [
pkgs.clang
pkgs.cmake
pkgs.gbenchmark
pkgs.mold-wrapped
pkgs.ninja
pkgs.python3
];
Expand All @@ -57,6 +53,8 @@
cmake \
-DFETCHCONTENT_SOURCE_DIR_GOOGLETEST=${googletest} \
-DFETCHCONTENT_SOURCE_DIR_JSON=${json} \
-DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=mold" \
-DCMAKE_SHARED_LINKER_FLAGS="-fuse-ld=mold" \
-G "Ninja Multi-Config" -B build
cmake --build build --config Release
'';
Expand Down

0 comments on commit 822f616

Please sign in to comment.