mold: wrap so it can find system libraries

Add a wrapped version as `mold` as `mold-wrapped`.

Currently `mold` mostly works, but the moment users start to need to
link system libraries they get linking errors. It's been reported on
github:

Re #242816

and on user forums, e.g.:

https://discourse.nixos.org/t/using-mold-as-linker-prevents-libraries-from-being-found
This commit is contained in:
Dawid Ciężarkiewicz 2023-09-24 15:15:45 -07:00 committed by Artturin
parent 093f098d26
commit 30f2ab26fe
2 changed files with 8 additions and 1 deletions

View File

@ -48,7 +48,7 @@ stdenv.mkDerivation rec {
};
meta = with lib; {
description = "A faster drop-in replacement for existing Unix linkers";
description = "A faster drop-in replacement for existing Unix linkers (unwrapped)";
longDescription = ''
mold is a faster drop-in replacement for existing Unix linkers. It is
several times faster than the LLVM lld linker. mold is designed to

View File

@ -19647,6 +19647,13 @@ with pkgs;
mold = callPackage ../development/tools/mold { };
mold-wrapped = wrapBintoolsWith {
bintools = mold;
extraBuildCommands = ''
wrap mold ${../build-support/bintools-wrapper/ld-wrapper.sh} ${mold}/bin/ld.mold
'';
};
mommy = callPackage ../tools/misc/mommy { };
moon = callPackage ../development/tools/build-managers/moon/default.nix { };