anchor.diff:    propagatedBuildInputs = lib.optionals stdenv.isDarwin [ xcbuild ];
   
     depsTargetTargetPropagated = lib.optionals stdenv.isDarwin [ Security Foundation ];
  +
  +  depsBuildTarget = lib.optional isCross targetCC;
  +
  +  depsTargetTarget = lib.optional (threadsCross != null) threadsCross;
   
     hardeningDisable = [ "all" ];
   
  
positive.code:   # {CC,CXX}_FOR_TARGET must be only set for cross compilation case as go expect those
    # to be different from CC/CXX
    CC_FOR_TARGET =
      if (stdenv.buildPlatform != stdenv.targetPlatform) then
        "${targetCC}/bin/${targetCC.targetPrefix}cc"
      else
        null;
    CXX_FOR_TARGET =
      if (stdenv.buildPlatform != stdenv.targetPlatform) then
        "${targetCC}/bin/${targetCC.targetPrefix}c++"
      else
        null;
  
negative.code: 
      export PATH=$(pwd)/bin:$PATH
  
      ${lib.optionalString isCross ''
      # Independent from host/target, CC should produce code for the building system.
      # We only set it when cross-compiling.
      export CC=${buildPackages.stdenv.cc}/bin/cc
  