From 748b5d1121baef74c0137e9fe00a2e2346fb1597 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Sat, 13 Sep 2025 16:30:21 +0200 Subject: [PATCH 1/2] go_1_24: Disable CGO for powerpc64-linux target --- pkgs/development/compilers/go/1.24.nix | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pkgs/development/compilers/go/1.24.nix b/pkgs/development/compilers/go/1.24.nix index 3513bd317ba1..947123c5e170 100644 --- a/pkgs/development/compilers/go/1.24.nix +++ b/pkgs/development/compilers/go/1.24.nix @@ -80,7 +80,19 @@ stdenv.mkDerivation (finalAttrs: { GO386 = "softfloat"; # from Arch: don't assume sse2 on i686 # Wasi does not support CGO - CGO_ENABLED = if stdenv.targetPlatform.isWasi then 0 else 1; + # ppc64/linux CGO is incomplete/borked, and will likely not receive any further improvements + # https://github.com/golang/go/issues/8912 + # https://github.com/golang/go/issues/13192 + CGO_ENABLED = + if + ( + stdenv.targetPlatform.isWasi + || (stdenv.targetPlatform.isPower64 && stdenv.targetPlatform.isBigEndian) + ) + then + 0 + else + 1; GOROOT_BOOTSTRAP = "${goBootstrap}/share/go"; From 68fcc594571bf702353cb199e78fc8e9c6d7e94a Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Sat, 13 Sep 2025 16:31:07 +0200 Subject: [PATCH 2/2] go_1_25: Disable CGO for powerpc64-linux target --- pkgs/development/compilers/go/1.25.nix | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pkgs/development/compilers/go/1.25.nix b/pkgs/development/compilers/go/1.25.nix index 9d7bab15e3ef..bd2426b7f721 100644 --- a/pkgs/development/compilers/go/1.25.nix +++ b/pkgs/development/compilers/go/1.25.nix @@ -85,7 +85,19 @@ stdenv.mkDerivation (finalAttrs: { GO386 = "softfloat"; # from Arch: don't assume sse2 on i686 # Wasi does not support CGO - CGO_ENABLED = if stdenv.targetPlatform.isWasi then 0 else 1; + # ppc64/linux CGO is incomplete/borked, and will likely not receive any further improvements + # https://github.com/golang/go/issues/8912 + # https://github.com/golang/go/issues/13192 + CGO_ENABLED = + if + ( + stdenv.targetPlatform.isWasi + || (stdenv.targetPlatform.isPower64 && stdenv.targetPlatform.isBigEndian) + ) + then + 0 + else + 1; GOROOT_BOOTSTRAP = "${goBootstrap}/share/go";