From 81a8b76b3aadd1c73122cc076d44796fbf9a112f Mon Sep 17 00:00:00 2001 From: Bouke van der Bijl Date: Tue, 23 Jun 2020 12:52:33 +0200 Subject: [PATCH] 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. --- pkgs/development/compilers/go/1.13.nix | 3 +++ pkgs/development/compilers/go/1.14.nix | 3 +++ 2 files changed, 6 insertions(+) diff --git a/pkgs/development/compilers/go/1.13.nix b/pkgs/development/compilers/go/1.13.nix index 48e4d9bdc6c..a158e1d4d3b 100644 --- a/pkgs/development/compilers/go/1.13.nix +++ b/pkgs/development/compilers/go/1.13.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 ''; diff --git a/pkgs/development/compilers/go/1.14.nix b/pkgs/development/compilers/go/1.14.nix index 95a602025d9..6ddd61253a4 100644 --- a/pkgs/development/compilers/go/1.14.nix +++ b/pkgs/development/compilers/go/1.14.nix @@ -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 '';