go: fix cross, enable ppc64le
This commit is contained in:
parent
77cdb1f64f
commit
8c5f66fbdf
@ -1,7 +1,8 @@
|
|||||||
{ stdenv, fetchurl, tzdata, iana-etc, runCommand
|
{ stdenv, fetchurl, tzdata, iana-etc, runCommand
|
||||||
, perl, which, pkgconfig, patch, procps, pcre, cacert, Security, Foundation
|
, perl, which, pkgconfig, patch, procps, pcre, cacert, Security, Foundation
|
||||||
, mailcap, runtimeShell
|
, mailcap, runtimeShell
|
||||||
, buildPackages, pkgsTargetTarget
|
, buildPackages
|
||||||
|
, pkgsBuildTarget
|
||||||
, fetchpatch
|
, fetchpatch
|
||||||
}:
|
}:
|
||||||
|
|
||||||
@ -25,8 +26,12 @@ let
|
|||||||
"armv5tel" = "arm";
|
"armv5tel" = "arm";
|
||||||
"armv6l" = "arm";
|
"armv6l" = "arm";
|
||||||
"armv7l" = "arm";
|
"armv7l" = "arm";
|
||||||
|
"powerpc64le" = "ppc64le";
|
||||||
}.${platform.parsed.cpu.name} or (throw "Unsupported system");
|
}.${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
|
in
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
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
|
# {CC,CXX}_FOR_TARGET must be only set for cross compilation case as go expect those
|
||||||
# to be different from CC/CXX
|
# to be different from CC/CXX
|
||||||
CC_FOR_TARGET = if (stdenv.buildPlatform != stdenv.targetPlatform) then
|
CC_FOR_TARGET = if (stdenv.buildPlatform != stdenv.targetPlatform) then
|
||||||
"${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}cc"
|
"${targetCC}/bin/${targetCC.targetPrefix}cc"
|
||||||
else
|
else
|
||||||
null;
|
null;
|
||||||
CXX_FOR_TARGET = if (stdenv.buildPlatform != stdenv.targetPlatform) then
|
CXX_FOR_TARGET = if (stdenv.buildPlatform != stdenv.targetPlatform) then
|
||||||
"${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}c++"
|
"${targetCC}/bin/${targetCC.targetPrefix}c++"
|
||||||
else
|
else
|
||||||
null;
|
null;
|
||||||
|
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
{ stdenv, fetchurl, tzdata, iana-etc, runCommand
|
{ stdenv, fetchurl, tzdata, iana-etc, runCommand
|
||||||
, perl, which, pkgconfig, patch, procps, pcre, cacert, Security, Foundation
|
, perl, which, pkgconfig, patch, procps, pcre, cacert, Security, Foundation
|
||||||
, mailcap, runtimeShell
|
, mailcap, runtimeShell
|
||||||
, buildPackages, pkgsTargetTarget
|
, buildPackages
|
||||||
|
, pkgsBuildTarget
|
||||||
, fetchpatch
|
, fetchpatch
|
||||||
}:
|
}:
|
||||||
|
|
||||||
@ -25,8 +26,12 @@ let
|
|||||||
"armv5tel" = "arm";
|
"armv5tel" = "arm";
|
||||||
"armv6l" = "arm";
|
"armv6l" = "arm";
|
||||||
"armv7l" = "arm";
|
"armv7l" = "arm";
|
||||||
|
"powerpc64le" = "ppc64le";
|
||||||
}.${platform.parsed.cpu.name} or (throw "Unsupported system");
|
}.${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
|
in
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
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
|
# {CC,CXX}_FOR_TARGET must be only set for cross compilation case as go expect those
|
||||||
# to be different from CC/CXX
|
# to be different from CC/CXX
|
||||||
CC_FOR_TARGET = if (stdenv.buildPlatform != stdenv.targetPlatform) then
|
CC_FOR_TARGET = if (stdenv.buildPlatform != stdenv.targetPlatform) then
|
||||||
"${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}cc"
|
"${targetCC}/bin/${targetCC.targetPrefix}cc"
|
||||||
else
|
else
|
||||||
null;
|
null;
|
||||||
CXX_FOR_TARGET = if (stdenv.buildPlatform != stdenv.targetPlatform) then
|
CXX_FOR_TARGET = if (stdenv.buildPlatform != stdenv.targetPlatform) then
|
||||||
"${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}c++"
|
"${targetCC}/bin/${targetCC.targetPrefix}c++"
|
||||||
else
|
else
|
||||||
null;
|
null;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user