Merge pull request #123419 from sternenseemann/gcc-native-cross

gcc*: force building a cross compiler if host and target platform differ
This commit is contained in:
John Ericson 2021-05-17 16:05:03 -07:00 committed by GitHub
commit 6ad0e5cab2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 16 additions and 9 deletions

View file

@ -186,7 +186,7 @@ stdenv.mkDerivation ({
preConfigure = import ../common/pre-configure.nix {
inherit lib;
inherit version hostPlatform gnatboot langAda langGo langJit;
inherit version targetPlatform hostPlatform gnatboot langAda langGo langJit;
};
dontDisableStatic = true;

View file

@ -186,7 +186,7 @@ stdenv.mkDerivation ({
preConfigure = import ../common/pre-configure.nix {
inherit lib;
inherit version hostPlatform gnatboot langAda langGo langJit;
inherit version targetPlatform hostPlatform gnatboot langAda langGo langJit;
};
dontDisableStatic = true;

View file

@ -196,7 +196,7 @@ stdenv.mkDerivation ({
preConfigure = import ../common/pre-configure.nix {
inherit lib;
inherit version hostPlatform langJava langGo;
inherit version targetPlatform hostPlatform langJava langGo;
};
dontDisableStatic = true;

View file

@ -209,7 +209,7 @@ stdenv.mkDerivation ({
preConfigure = import ../common/pre-configure.nix {
inherit lib;
inherit version hostPlatform langJava langGo;
inherit version targetPlatform hostPlatform langJava langGo;
};
dontDisableStatic = true;

View file

@ -232,7 +232,7 @@ stdenv.mkDerivation ({
preConfigure = import ../common/pre-configure.nix {
inherit lib;
inherit version hostPlatform gnatboot langJava langAda langGo;
inherit version targetPlatform hostPlatform gnatboot langJava langAda langGo;
};
dontDisableStatic = true;

View file

@ -197,7 +197,7 @@ stdenv.mkDerivation ({
preConfigure = import ../common/pre-configure.nix {
inherit lib;
inherit version hostPlatform langGo;
inherit version targetPlatform hostPlatform langGo;
};
dontDisableStatic = true;

View file

@ -183,7 +183,7 @@ stdenv.mkDerivation ({
preConfigure = import ../common/pre-configure.nix {
inherit lib;
inherit version hostPlatform langGo;
inherit version targetPlatform hostPlatform langGo;
};
dontDisableStatic = true;

View file

@ -200,7 +200,7 @@ stdenv.mkDerivation ({
preConfigure = import ../common/pre-configure.nix {
inherit lib;
inherit version hostPlatform gnatboot langAda langGo langJit;
inherit version targetPlatform hostPlatform gnatboot langAda langGo langJit;
};
dontDisableStatic = true;

View file

@ -1,4 +1,4 @@
{ lib, version, hostPlatform
{ lib, version, hostPlatform, targetPlatform
, gnatboot ? null
, langAda ? false
, langJava ? false
@ -58,3 +58,10 @@ lib.optionalString (hostPlatform.isSunOS && hostPlatform.is64bit) ''
+ lib.optionalString (hostPlatform.isDarwin && langJit) ''
export STRIP='strip -x'
''
# HACK: if host and target config are the same, but the platforms are
# actually different we need to convince the configure script that it
# is in fact building a cross compiler although it doesn't believe it.
+ lib.optionalString (targetPlatform.config == hostPlatform.config && targetPlatform != hostPlatform) ''
substituteInPlace configure --replace is_cross_compiler=no is_cross_compiler=yes
''