@@ -131,14 +131,17 @@ stdenv.mkDerivation rec {
131131 substituteInPlace "src/cmd/link/internal/ld/lib.go" --replace dsymutil ${llvm}/bin/llvm-dsymutil
132132 '';
133133
134− GOOS = if stdenv.isDarwin then "darwin" else "linux";
135− GOARCH = if stdenv.isDarwin then "amd64"
136− else if stdenv.targetPlatform.isi686 then "386"
137− else if stdenv.targetPlatform.isx86_64 then "amd64"
138− else if stdenv.targetPlatform.isAarch32 then "arm"
139− else if stdenv.targetPlatform.isAarch64 then "arm64"
140− else throw "Unsupported system";
141− GOARM = toString (stdenv.lib.intersectLists [(stdenv.targetPlatform.parsed.cpu.version or "")] ["5" "6" "7"]);
134+ GOOS = stdenv.hostPlatform.parsed.kernel.name;
135+ GOARCH = {
136+ "i686" = "386";
137+ "x86_64" = "amd64";
138+ "aarch64" = "arm64";
139+ "arm" = "arm";
140+ "armv5tel" = "arm";
141+ "armv6l" = "arm";
142+ "armv7l" = "arm";
143+ }.${stdenv.hostPlatform.parsed.cpu.name} or (throw "Unsupported system");
144+ GOARM = toString (stdenv.lib.intersectLists [(stdenv.hostPlatform.parsed.cpu.version or "")] ["5" "6" "7"]);
142145 GO386 = 387; # from Arch: don't assume sse2 on i686
143146 CGO_ENABLED = 1;
144147 GOROOT_BOOTSTRAP = "${goBootstrap}/share/go";