From 196c392f59fd63370267b678c3e7eb75ab139320 Mon Sep 17 00:00:00 2001 From: Soispha Date: Tue, 31 Oct 2023 18:55:18 +0100 Subject: [PATCH] build(flake): Switch to nixpkgs's wrapped mold linker By now a wrapped version of mold exists, which thus works with the NixOS libraries. This is obviously the same as my self-wrapped version, but vendoring is just not important here. --- flake.nix | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/flake.nix b/flake.nix index e88e2b1..6f383c7 100644 --- a/flake.nix +++ b/flake.nix @@ -37,28 +37,6 @@ ... }: flake-utils.lib.eachDefaultSystem (system: let - inherit (pkgs) lib; - bintools-wrapper = "${nixpkgs}/pkgs/build-support/bintools-wrapper"; - mold' = pkgs.symlinkJoin { - name = "mold"; - paths = [pkgs.mold]; - nativeBuildInputs = [pkgs.makeWrapper]; - suffixSalt = lib.replaceStrings ["-" "."] ["_" "_"] pkgs.targetPlatform.config; - postBuild = '' - for bin in ${pkgs.mold}/bin/*; do - rm $out/bin/"$(basename "$bin")" - - export prog="$bin" - substituteAll "${bintools-wrapper}/ld-wrapper.sh" $out/bin/"$(basename "$bin")" - chmod +x $out/bin/"$(basename "$bin")" - - mkdir -p $out/nix-support - substituteAll "${bintools-wrapper}/add-flags.sh" $out/nix-support/add-flags.sh - substituteAll "${bintools-wrapper}/add-hardening.sh" $out/nix-support/add-hardening.sh - substituteAll "${bintools-wrapper}/../wrapper-common/utils.bash" $out/nix-support/utils.bash - done - ''; - }; pkgs = import nixpkgs { inherit system; overlays = [(import rust-overlay)]; @@ -79,7 +57,7 @@ nativeBuildInputs = with pkgs; [ pkg-config - mold' + mold-wrapped ]; buildInputs = with pkgs; [ openssl