gcc*: force building a cross compiler if host and target platform differ
gcc's configure system has the nasty habit (for us) of judging for itself if it is building a cross compiler (or cross compiling), but on the limited information of the build, host and target platforms' config which only contains a subset of the information we encode in `stdenv.*Platform`. The practical consequence was that prior to this change building `pkgsLLVM.buildPackages.gcc` actually fails because it refuses to use `--with-headers` with something it believes to not be a cross compiler. As a workaround we force the appropriate variable in the configure script to always be `yes` regardless of its own conditional check. At some point we probably should report this issue in some capacity, so future gcc versions don't force us into workarounds like this and acdc783418538f23cdfb671bc8fd4b1c076979bd.
This commit is contained in:
parent
8c6d819143
commit
2d176b593b
@ -186,7 +186,7 @@ stdenv.mkDerivation ({
|
|||||||
|
|
||||||
preConfigure = import ../common/pre-configure.nix {
|
preConfigure = import ../common/pre-configure.nix {
|
||||||
inherit lib;
|
inherit lib;
|
||||||
inherit version hostPlatform gnatboot langAda langGo langJit;
|
inherit version targetPlatform hostPlatform gnatboot langAda langGo langJit;
|
||||||
};
|
};
|
||||||
|
|
||||||
dontDisableStatic = true;
|
dontDisableStatic = true;
|
||||||
|
@ -186,7 +186,7 @@ stdenv.mkDerivation ({
|
|||||||
|
|
||||||
preConfigure = import ../common/pre-configure.nix {
|
preConfigure = import ../common/pre-configure.nix {
|
||||||
inherit lib;
|
inherit lib;
|
||||||
inherit version hostPlatform gnatboot langAda langGo langJit;
|
inherit version targetPlatform hostPlatform gnatboot langAda langGo langJit;
|
||||||
};
|
};
|
||||||
|
|
||||||
dontDisableStatic = true;
|
dontDisableStatic = true;
|
||||||
|
@ -196,7 +196,7 @@ stdenv.mkDerivation ({
|
|||||||
|
|
||||||
preConfigure = import ../common/pre-configure.nix {
|
preConfigure = import ../common/pre-configure.nix {
|
||||||
inherit lib;
|
inherit lib;
|
||||||
inherit version hostPlatform langJava langGo;
|
inherit version targetPlatform hostPlatform langJava langGo;
|
||||||
};
|
};
|
||||||
|
|
||||||
dontDisableStatic = true;
|
dontDisableStatic = true;
|
||||||
|
@ -209,7 +209,7 @@ stdenv.mkDerivation ({
|
|||||||
|
|
||||||
preConfigure = import ../common/pre-configure.nix {
|
preConfigure = import ../common/pre-configure.nix {
|
||||||
inherit lib;
|
inherit lib;
|
||||||
inherit version hostPlatform langJava langGo;
|
inherit version targetPlatform hostPlatform langJava langGo;
|
||||||
};
|
};
|
||||||
|
|
||||||
dontDisableStatic = true;
|
dontDisableStatic = true;
|
||||||
|
@ -232,7 +232,7 @@ stdenv.mkDerivation ({
|
|||||||
|
|
||||||
preConfigure = import ../common/pre-configure.nix {
|
preConfigure = import ../common/pre-configure.nix {
|
||||||
inherit lib;
|
inherit lib;
|
||||||
inherit version hostPlatform gnatboot langJava langAda langGo;
|
inherit version targetPlatform hostPlatform gnatboot langJava langAda langGo;
|
||||||
};
|
};
|
||||||
|
|
||||||
dontDisableStatic = true;
|
dontDisableStatic = true;
|
||||||
|
@ -197,7 +197,7 @@ stdenv.mkDerivation ({
|
|||||||
|
|
||||||
preConfigure = import ../common/pre-configure.nix {
|
preConfigure = import ../common/pre-configure.nix {
|
||||||
inherit lib;
|
inherit lib;
|
||||||
inherit version hostPlatform langGo;
|
inherit version targetPlatform hostPlatform langGo;
|
||||||
};
|
};
|
||||||
|
|
||||||
dontDisableStatic = true;
|
dontDisableStatic = true;
|
||||||
|
@ -183,7 +183,7 @@ stdenv.mkDerivation ({
|
|||||||
|
|
||||||
preConfigure = import ../common/pre-configure.nix {
|
preConfigure = import ../common/pre-configure.nix {
|
||||||
inherit lib;
|
inherit lib;
|
||||||
inherit version hostPlatform langGo;
|
inherit version targetPlatform hostPlatform langGo;
|
||||||
};
|
};
|
||||||
|
|
||||||
dontDisableStatic = true;
|
dontDisableStatic = true;
|
||||||
|
@ -200,7 +200,7 @@ stdenv.mkDerivation ({
|
|||||||
|
|
||||||
preConfigure = import ../common/pre-configure.nix {
|
preConfigure = import ../common/pre-configure.nix {
|
||||||
inherit lib;
|
inherit lib;
|
||||||
inherit version hostPlatform gnatboot langAda langGo langJit;
|
inherit version targetPlatform hostPlatform gnatboot langAda langGo langJit;
|
||||||
};
|
};
|
||||||
|
|
||||||
dontDisableStatic = true;
|
dontDisableStatic = true;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ lib, version, hostPlatform
|
{ lib, version, hostPlatform, targetPlatform
|
||||||
, gnatboot ? null
|
, gnatboot ? null
|
||||||
, langAda ? false
|
, langAda ? false
|
||||||
, langJava ? false
|
, langJava ? false
|
||||||
@ -58,3 +58,10 @@ lib.optionalString (hostPlatform.isSunOS && hostPlatform.is64bit) ''
|
|||||||
+ lib.optionalString (hostPlatform.isDarwin && langJit) ''
|
+ lib.optionalString (hostPlatform.isDarwin && langJit) ''
|
||||||
export STRIP='strip -x'
|
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
|
||||||
|
''
|
||||||
|
Loading…
x
Reference in New Issue
Block a user