diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix index d1c57a77a58c..06aabf2a6f3e 100644 --- a/pkgs/build-support/cc-wrapper/default.nix +++ b/pkgs/build-support/cc-wrapper/default.nix @@ -264,6 +264,7 @@ stdenv.mkDerivation { + optionalString cc.langGo or false '' wrap ${targetPrefix}gccgo $wrapper $ccPath/${targetPrefix}gccgo + wrap ${targetPrefix}go ${./go-wrapper.sh} $ccPath/${targetPrefix}go ''; strictDeps = true; diff --git a/pkgs/build-support/cc-wrapper/go-wrapper.sh b/pkgs/build-support/cc-wrapper/go-wrapper.sh new file mode 100644 index 000000000000..5dfc5d2b73fc --- /dev/null +++ b/pkgs/build-support/cc-wrapper/go-wrapper.sh @@ -0,0 +1,11 @@ +#! @shell@ +set -eu -o pipefail +o posix +shopt -s nullglob + +if (( "${NIX_DEBUG:-0}" >= 7 )); then + set -x +fi + +export GCCGO="@out@/bin/gccgo" + +exec @prog@ "$@"