Merge pull request #99511 from r-burns/go-cross
go: fix cross, enable ppc64le
This commit is contained in:
commit
0794fb0419
@ -1,7 +1,8 @@
|
||||
{ stdenv, fetchurl, tzdata, iana-etc, runCommand
|
||||
, perl, which, pkgconfig, patch, procps, pcre, cacert, Security, Foundation
|
||||
, mailcap, runtimeShell
|
||||
, buildPackages, pkgsTargetTarget
|
||||
, buildPackages
|
||||
, pkgsBuildTarget
|
||||
, fetchpatch
|
||||
}:
|
||||
|
||||
@ -25,8 +26,12 @@ let
|
||||
"armv5tel" = "arm";
|
||||
"armv6l" = "arm";
|
||||
"armv7l" = "arm";
|
||||
"powerpc64le" = "ppc64le";
|
||||
}.${platform.parsed.cpu.name} or (throw "Unsupported system");
|
||||
|
||||
# We need a target compiler which is still runnable at build time,
|
||||
# to handle the cross-building case where build != host == target
|
||||
targetCC = pkgsBuildTarget.targetPackages.stdenv.cc;
|
||||
in
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
@ -166,11 +171,11 @@ stdenv.mkDerivation rec {
|
||||
# {CC,CXX}_FOR_TARGET must be only set for cross compilation case as go expect those
|
||||
# to be different from CC/CXX
|
||||
CC_FOR_TARGET = if (stdenv.buildPlatform != stdenv.targetPlatform) then
|
||||
"${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}cc"
|
||||
"${targetCC}/bin/${targetCC.targetPrefix}cc"
|
||||
else
|
||||
null;
|
||||
CXX_FOR_TARGET = if (stdenv.buildPlatform != stdenv.targetPlatform) then
|
||||
"${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}c++"
|
||||
"${targetCC}/bin/${targetCC.targetPrefix}c++"
|
||||
else
|
||||
null;
|
||||
|
||||
|
@ -1,7 +1,8 @@
|
||||
{ stdenv, fetchurl, tzdata, iana-etc, runCommand
|
||||
, perl, which, pkgconfig, patch, procps, pcre, cacert, Security, Foundation
|
||||
, mailcap, runtimeShell
|
||||
, buildPackages, pkgsTargetTarget
|
||||
, buildPackages
|
||||
, pkgsBuildTarget
|
||||
, fetchpatch
|
||||
}:
|
||||
|
||||
@ -25,8 +26,12 @@ let
|
||||
"armv5tel" = "arm";
|
||||
"armv6l" = "arm";
|
||||
"armv7l" = "arm";
|
||||
"powerpc64le" = "ppc64le";
|
||||
}.${platform.parsed.cpu.name} or (throw "Unsupported system");
|
||||
|
||||
# We need a target compiler which is still runnable at build time,
|
||||
# to handle the cross-building case where build != host == target
|
||||
targetCC = pkgsBuildTarget.targetPackages.stdenv.cc;
|
||||
in
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
@ -169,11 +174,11 @@ stdenv.mkDerivation rec {
|
||||
# {CC,CXX}_FOR_TARGET must be only set for cross compilation case as go expect those
|
||||
# to be different from CC/CXX
|
||||
CC_FOR_TARGET = if (stdenv.buildPlatform != stdenv.targetPlatform) then
|
||||
"${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}cc"
|
||||
"${targetCC}/bin/${targetCC.targetPrefix}cc"
|
||||
else
|
||||
null;
|
||||
CXX_FOR_TARGET = if (stdenv.buildPlatform != stdenv.targetPlatform) then
|
||||
"${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}c++"
|
||||
"${targetCC}/bin/${targetCC.targetPrefix}c++"
|
||||
else
|
||||
null;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user