stdenv: throw when using mold for targeting darwin
Mold does not support linking Mach-O, but still can be used on MacOS to emit ELF. Fixes: #338970
This commit is contained in:
parent
8899e78e6c
commit
e8f0b7b782
@ -261,7 +261,10 @@ rec {
|
|||||||
in
|
in
|
||||||
overrideCC targetStdenv cc;
|
overrideCC targetStdenv cc;
|
||||||
|
|
||||||
useMoldLinker = stdenv: let
|
useMoldLinker = stdenv:
|
||||||
|
if stdenv.targetPlatform.isDarwin
|
||||||
|
then throw "Mold can't be used to emit Mach-O (Darwin) binaries"
|
||||||
|
else let
|
||||||
bintools = stdenv.cc.bintools.override {
|
bintools = stdenv.cc.bintools.override {
|
||||||
extraBuildCommands = ''
|
extraBuildCommands = ''
|
||||||
wrap ${stdenv.cc.bintools.targetPrefix}ld.mold ${../build-support/bintools-wrapper/ld-wrapper.sh} ${pkgs.mold}/bin/ld.mold
|
wrap ${stdenv.cc.bintools.targetPrefix}ld.mold ${../build-support/bintools-wrapper/ld-wrapper.sh} ${pkgs.mold}/bin/ld.mold
|
||||||
@ -280,7 +283,6 @@ rec {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
/* Modify a stdenv so that it builds binaries optimized specifically
|
/* Modify a stdenv so that it builds binaries optimized specifically
|
||||||
for the machine they are built on.
|
for the machine they are built on.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user