From 30e7afbdb4af65bec068b017491554bfb2e6115a Mon Sep 17 00:00:00 2001 From: Zhaofeng Li Date: Fri, 20 Jan 2023 21:26:37 -0700 Subject: [PATCH] go: Bootstrap on RISC-V with gccgo --- pkgs/development/compilers/go/1.18.nix | 5 +++-- pkgs/development/compilers/go/1.19.nix | 5 +++-- pkgs/development/compilers/go/1.20.nix | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/pkgs/development/compilers/go/1.18.nix b/pkgs/development/compilers/go/1.18.nix index 46c5e8b31003..4a1e516ff1ce 100644 --- a/pkgs/development/compilers/go/1.18.nix +++ b/pkgs/development/compilers/go/1.18.nix @@ -17,7 +17,8 @@ }: let - goBootstrap = if stdenv.buildPlatform.isMusl then buildPackages.gccgo else buildPackages.callPackage ./bootstrap116.nix { }; + useGccGoBootstrap = stdenv.buildPlatform.isMusl || stdenv.buildPlatform.isRiscV; + goBootstrap = if useGccGoBootstrap then buildPackages.gccgo else buildPackages.callPackage ./bootstrap116.nix { }; skopeoTest = skopeo.override { buildGoModule = buildGo118Module; }; @@ -113,7 +114,7 @@ stdenv.mkDerivation rec { GO386 = "softfloat"; # from Arch: don't assume sse2 on i686 CGO_ENABLED = 1; - GOROOT_BOOTSTRAP = if stdenv.buildPlatform.isMusl then goBootstrap else "${goBootstrap}/share/go"; + GOROOT_BOOTSTRAP = if useGccGoBootstrap then goBootstrap else "${goBootstrap}/share/go"; buildPhase = '' runHook preBuild diff --git a/pkgs/development/compilers/go/1.19.nix b/pkgs/development/compilers/go/1.19.nix index afe4072641f0..af6c99a50e25 100644 --- a/pkgs/development/compilers/go/1.19.nix +++ b/pkgs/development/compilers/go/1.19.nix @@ -17,7 +17,8 @@ }: let - goBootstrap = if stdenv.buildPlatform.isMusl then buildPackages.gccgo else buildPackages.callPackage ./bootstrap116.nix { }; + useGccGoBootstrap = stdenv.buildPlatform.isMusl || stdenv.buildPlatform.isRiscV; + goBootstrap = if useGccGoBootstrap then buildPackages.gccgo else buildPackages.callPackage ./bootstrap116.nix { }; skopeoTest = skopeo.override { buildGoModule = buildGo119Module; }; @@ -113,7 +114,7 @@ stdenv.mkDerivation rec { GO386 = "softfloat"; # from Arch: don't assume sse2 on i686 CGO_ENABLED = 1; - GOROOT_BOOTSTRAP = if stdenv.buildPlatform.isMusl then goBootstrap else "${goBootstrap}/share/go"; + GOROOT_BOOTSTRAP = if useGccGoBootstrap then goBootstrap else "${goBootstrap}/share/go"; buildPhase = '' runHook preBuild diff --git a/pkgs/development/compilers/go/1.20.nix b/pkgs/development/compilers/go/1.20.nix index 134ca0f5b668..ec2669ed868f 100644 --- a/pkgs/development/compilers/go/1.20.nix +++ b/pkgs/development/compilers/go/1.20.nix @@ -17,7 +17,8 @@ }: let - goBootstrap = if stdenv.buildPlatform.isMusl then buildPackages.gccgo else buildPackages.callPackage ./bootstrap117.nix { }; + useGccGoBootstrap = stdenv.buildPlatform.isMusl || stdenv.buildPlatform.isRiscV; + goBootstrap = if useGccGoBootstrap then buildPackages.gccgo else buildPackages.callPackage ./bootstrap117.nix { }; skopeoTest = skopeo.override { buildGoModule = buildGo120Module; }; @@ -113,7 +114,7 @@ stdenv.mkDerivation rec { GO386 = "softfloat"; # from Arch: don't assume sse2 on i686 CGO_ENABLED = 1; - GOROOT_BOOTSTRAP = if stdenv.buildPlatform.isMusl then goBootstrap else "${goBootstrap}/share/go"; + GOROOT_BOOTSTRAP = if useGccGoBootstrap then goBootstrap else "${goBootstrap}/share/go"; buildPhase = '' runHook preBuild