go: only set CC when cross-compiling

This avoids he default CC for cgo being hardcoded, when we only want to
overwrite it during compilation.
wip/yesman
Bouke van der Bijl 4 years ago committed by zowoq
parent cee7631c08
commit 81a8b76b3a
  1. 3
      pkgs/development/compilers/go/1.13.nix
  2. 3
      pkgs/development/compilers/go/1.14.nix

@ -186,8 +186,11 @@ stdenv.mkDerivation rec {
export PATH=$(pwd)/bin:$PATH
${optionalString (stdenv.buildPlatform != stdenv.targetPlatform) ''
# 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
''}
ulimit -a
'';

@ -193,8 +193,11 @@ stdenv.mkDerivation rec {
export PATH=$(pwd)/bin:$PATH
${optionalString (stdenv.buildPlatform != stdenv.targetPlatform) ''
# 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
''}
ulimit -a
'';

Loading…
Cancel
Save