about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/compilers/gcc/common/pre-configure.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/compilers/gcc/common/pre-configure.nix')
-rw-r--r--nixpkgs/pkgs/development/compilers/gcc/common/pre-configure.nix9
1 files changed, 8 insertions, 1 deletions
diff --git a/nixpkgs/pkgs/development/compilers/gcc/common/pre-configure.nix b/nixpkgs/pkgs/development/compilers/gcc/common/pre-configure.nix
index 1c65b4a8ba64..d9977e0ba2f9 100644
--- a/nixpkgs/pkgs/development/compilers/gcc/common/pre-configure.nix
+++ b/nixpkgs/pkgs/development/compilers/gcc/common/pre-configure.nix
@@ -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
+''