From d56f7d9fe4920e85092c36fa191ef05b58929774 Mon Sep 17 00:00:00 2001 From: zowoq <59103226+zowoq@users.noreply.github.com> Date: Wed, 25 Jan 2023 19:11:12 +1000 Subject: [PATCH] go: various gccgo changes (#211850) * gccgo: mark broken on darwin * gccgo12: init create versioned gccgo for bootstrapping go * go: use versioned gccgo for bootstrapping --- pkgs/development/compilers/go/1.18.nix | 2 +- pkgs/development/compilers/go/1.19.nix | 2 +- pkgs/development/compilers/go/1.20.nix | 2 +- pkgs/top-level/all-packages.nix | 17 ++++++++++++++++- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/pkgs/development/compilers/go/1.18.nix b/pkgs/development/compilers/go/1.18.nix index 4a1e516ff1ce..3c089f02920a 100644 --- a/pkgs/development/compilers/go/1.18.nix +++ b/pkgs/development/compilers/go/1.18.nix @@ -18,7 +18,7 @@ let useGccGoBootstrap = stdenv.buildPlatform.isMusl || stdenv.buildPlatform.isRiscV; - goBootstrap = if useGccGoBootstrap then buildPackages.gccgo else buildPackages.callPackage ./bootstrap116.nix { }; + goBootstrap = if useGccGoBootstrap then buildPackages.gccgo12 else buildPackages.callPackage ./bootstrap116.nix { }; skopeoTest = skopeo.override { buildGoModule = buildGo118Module; }; diff --git a/pkgs/development/compilers/go/1.19.nix b/pkgs/development/compilers/go/1.19.nix index af6c99a50e25..27223e6dea6e 100644 --- a/pkgs/development/compilers/go/1.19.nix +++ b/pkgs/development/compilers/go/1.19.nix @@ -18,7 +18,7 @@ let useGccGoBootstrap = stdenv.buildPlatform.isMusl || stdenv.buildPlatform.isRiscV; - goBootstrap = if useGccGoBootstrap then buildPackages.gccgo else buildPackages.callPackage ./bootstrap116.nix { }; + goBootstrap = if useGccGoBootstrap then buildPackages.gccgo12 else buildPackages.callPackage ./bootstrap116.nix { }; skopeoTest = skopeo.override { buildGoModule = buildGo119Module; }; diff --git a/pkgs/development/compilers/go/1.20.nix b/pkgs/development/compilers/go/1.20.nix index ec2669ed868f..be569ed688c9 100644 --- a/pkgs/development/compilers/go/1.20.nix +++ b/pkgs/development/compilers/go/1.20.nix @@ -18,7 +18,7 @@ let useGccGoBootstrap = stdenv.buildPlatform.isMusl || stdenv.buildPlatform.isRiscV; - goBootstrap = if useGccGoBootstrap then buildPackages.gccgo else buildPackages.callPackage ./bootstrap117.nix { }; + goBootstrap = if useGccGoBootstrap then buildPackages.gccgo12 else buildPackages.callPackage ./bootstrap117.nix { }; skopeoTest = skopeo.override { buildGoModule = buildGo120Module; }; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 437867c3baab..5ce449c85a7a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -14553,13 +14553,28 @@ with pkgs; gnu-smalltalk = callPackage ../development/compilers/gnu-smalltalk { }; - gccgo = wrapCC ((if stdenv.hostPlatform.isMusl then gcc_latest else gcc).cc.override { + gccgo = wrapCC (gcc.cc.override { name = "gccgo"; langCC = true; #required for go. langC = true; langGo = true; langJit = true; profiledCompiler = false; + } // { + # not supported on darwin: https://github.com/golang/go/issues/463 + meta.broken = stdenv.hostPlatform.isDarwin; + }); + + gccgo12 = wrapCC (gcc12.cc.override { + name = "gccgo"; + langCC = true; #required for go. + langC = true; + langGo = true; + langJit = true; + profiledCompiler = false; + } // { + # not supported on darwin: https://github.com/golang/go/issues/463 + meta.broken = stdenv.hostPlatform.isDarwin; }); ghdl = ghdl-mcode;