about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/compilers/gcc/8
diff options
context:
space:
mode:
authorGaelan Steele <gbs@canishe.com>2020-05-26 03:16:03 -0700
committerAlyssa Ross <hi@alyssa.is>2020-11-27 13:27:00 +0000
commit0e5b3d4420d5e9c37533b11639d421b609f92e46 (patch)
tree4260d4283dd2c5261120a09c4f740d23d3a4e763 /nixpkgs/pkgs/development/compilers/gcc/8
parente14330c5be9b005d4310cd4dc0d384cff882aedc (diff)
downloadnixlib-0e5b3d4420d5e9c37533b11639d421b609f92e46.tar
nixlib-0e5b3d4420d5e9c37533b11639d421b609f92e46.tar.gz
nixlib-0e5b3d4420d5e9c37533b11639d421b609f92e46.tar.bz2
nixlib-0e5b3d4420d5e9c37533b11639d421b609f92e46.tar.lz
nixlib-0e5b3d4420d5e9c37533b11639d421b609f92e46.tar.xz
nixlib-0e5b3d4420d5e9c37533b11639d421b609f92e46.tar.zst
nixlib-0e5b3d4420d5e9c37533b11639d421b609f92e46.zip
gcc: fix building darwin->linux cross compiler
This reverts d9feea5 with some slight modifications to work with
other changes since then.

Fixes #88213.

(cherry picked from commit 459c60dda2406d2207d2afd90f210ffc87efde54)
Diffstat (limited to 'nixpkgs/pkgs/development/compilers/gcc/8')
-rw-r--r--nixpkgs/pkgs/development/compilers/gcc/8/default.nix15
1 files changed, 9 insertions, 6 deletions
diff --git a/nixpkgs/pkgs/development/compilers/gcc/8/default.nix b/nixpkgs/pkgs/development/compilers/gcc/8/default.nix
index 5a6e20c0f412..9e6a24d12948 100644
--- a/nixpkgs/pkgs/development/compilers/gcc/8/default.nix
+++ b/nixpkgs/pkgs/development/compilers/gcc/8/default.nix
@@ -10,7 +10,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
@@ -148,11 +148,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