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.
This commit is contained in:
parent
66e3b362c3
commit
196c392f59
24
flake.nix
24
flake.nix
|
@ -37,28 +37,6 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
flake-utils.lib.eachDefaultSystem (system: let
|
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 {
|
pkgs = import nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
overlays = [(import rust-overlay)];
|
overlays = [(import rust-overlay)];
|
||||||
|
@ -79,7 +57,7 @@
|
||||||
|
|
||||||
nativeBuildInputs = with pkgs; [
|
nativeBuildInputs = with pkgs; [
|
||||||
pkg-config
|
pkg-config
|
||||||
mold'
|
mold-wrapped
|
||||||
];
|
];
|
||||||
buildInputs = with pkgs; [
|
buildInputs = with pkgs; [
|
||||||
openssl
|
openssl
|
||||||
|
|
Reference in New Issue