3
0
Fork 0
forked from mirrors/nixpkgs

stdenvAdapters.useMoldLinker: set allowedRequisites to null

This commit is contained in:
Pavel Sobolev 2023-10-19 15:48:42 +03:00
parent bff80fa4b4
commit 17acba4cd1
No known key found for this signature in database

View file

@ -197,16 +197,10 @@ rec {
'';
};
in stdenv.override (old: {
cc = stdenv.cc.override {
inherit bintools;
};
allowedRequisites =
(lib.optional (stdenv.allowedRequisites or null != null) stdenv.allowedRequisites)
++ [ bintools pkgs.mold ]
# need to `outputSpecified = false` to make getLib work
++ (builtins.map (p: lib.getLib (p // { outputSpecified = false; })) pkgs.mold.buildInputs);
# gcc >12.1.0 supports '-fuse-ld=mold'
# the wrap ld above in bintools supports gcc <12.1.0 and shouldn't harm >12.1.0
allowedRequisites = null;
cc = stdenv.cc.override { inherit bintools; };
# gcc >12.1.0 supports '-fuse-ld=mold'
# the wrap ld above in bintools supports gcc <12.1.0 and shouldn't harm >12.1.0
# https://github.com/rui314/mold#how-to-use
} // lib.optionalAttrs (stdenv.cc.isClang || (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12")) {
mkDerivationFromStdenv = extendMkDerivationArgs old (args: {