Unverified Commit d60e6bf8 authored by Artturin's avatar Artturin Committed by GitHub
Browse files

stdenv: throw when using mold for targeting darwin (#338984)

parents 2349afa4 e8f0b7b7
Loading
Loading
Loading
Loading
+21 −19
Original line number Diff line number Diff line
@@ -261,7 +261,10 @@ rec {
    in
    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 {
        extraBuildCommands = ''
          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
     for the machine they are built on.