gcc: fix building darwin->linux cross compiler

This reverts d9feea5 with some slight modifications to work with
other changes since then.

Fixes #88213.
This commit is contained in:
Gaelan Steele
2020-05-26 03:16:03 -07:00
parent b0b0a06788
commit 459c60dda2
7 changed files with 65 additions and 37 deletions
+9 -6
View File
@@ -9,7 +9,7 @@
, enableLTO ? true
, texinfo ? null
, perl ? null # optional, for texi2pod (then pod2man)
, gmp, mpfr, libmpc, gettext, which
, gmp, mpfr, libmpc, gettext, which, patchelf
, libelf # optional, for link-time optimizations (LTO)
, isl ? null # optional, for the Graphite optimization framework.
, zlib ? null
@@ -147,11 +147,14 @@ stdenv.mkDerivation ({
# For building runtime libs
depsBuildTarget =
if hostPlatform == buildPlatform then [
targetPackages.stdenv.cc.bintools # newly-built gcc will be used
] else assert targetPlatform == hostPlatform; [ # build != host == target
stdenv.cc
];
(
if hostPlatform == buildPlatform then [
targetPackages.stdenv.cc.bintools # newly-built gcc will be used
] else assert targetPlatform == hostPlatform; [ # build != host == target
stdenv.cc
]
)
++ optional targetPlatform.isLinux patchelf;
buildInputs = [
gmp mpfr libmpc libelf