about summary refs log tree commit diff
path: root/pkgs/build-support
diff options
context:
space:
mode:
authorWill Dietz <w@wdtz.org>2018-01-05 18:51:41 -0600
committerWill Dietz <w@wdtz.org>2018-01-05 18:55:13 -0600
commit40b2647b694ef6bf20fce5df02d4115ce6430b3b (patch)
treeeedd1a2b3ddf742640c1feb830d392ac1477c01f /pkgs/build-support
parent1fafe29a6a881c56164f13c07e93fcf1f4a2779d (diff)
downloadnixlib-40b2647b694ef6bf20fce5df02d4115ce6430b3b.tar
nixlib-40b2647b694ef6bf20fce5df02d4115ce6430b3b.tar.gz
nixlib-40b2647b694ef6bf20fce5df02d4115ce6430b3b.tar.bz2
nixlib-40b2647b694ef6bf20fce5df02d4115ce6430b3b.tar.lz
nixlib-40b2647b694ef6bf20fce5df02d4115ce6430b3b.tar.xz
nixlib-40b2647b694ef6bf20fce5df02d4115ce6430b3b.tar.zst
nixlib-40b2647b694ef6bf20fce5df02d4115ce6430b3b.zip
gcc-wrapper-old: grab name of dynamicLinker for bintools
Diffstat (limited to 'pkgs/build-support')
-rw-r--r--pkgs/build-support/gcc-wrapper-old/default.nix27
1 files changed, 2 insertions, 25 deletions
diff --git a/pkgs/build-support/gcc-wrapper-old/default.nix b/pkgs/build-support/gcc-wrapper-old/default.nix
index ae17989d932b..2c2b2c0e1d5c 100644
--- a/pkgs/build-support/gcc-wrapper-old/default.nix
+++ b/pkgs/build-support/gcc-wrapper-old/default.nix
@@ -8,7 +8,7 @@
 { name ? "", stdenv, lib, nativeTools, nativeLibc, nativePrefix ? ""
 , gcc ? null, libc ? null, binutils ? null, coreutils ? null, shell ? stdenv.shell
 , zlib ? null
-, hostPlatform, targetPlatform
+, hostPlatform, targetPlatform, targetPackages
 }:
 
 assert nativeTools -> nativePrefix != "";
@@ -58,18 +58,6 @@ stdenv.mkDerivation {
   zlib = if gcc != null && gcc ? langVhdl then zlib else null;
   shell = shell + shell.shellPath or "";
 
-  crossAttrs = {
-    #
-    # This is not the best way to do this. I think the reference should be
-    # the style in the gcc-cross-wrapper, but to keep a stable stdenv now I
-    # do this sufficient if/else.
-    dynamicLinker =
-      (if hostPlatform.arch == "arm" then "ld-linux.so.3" else
-       if hostPlatform.arch == "mips" then "ld.so.1" else
-       if stdenv.lib.hasSuffix "pc-gnu" hostPlatform.config then "ld.so.1" else
-       abort "don't know the name of the dynamic linker for this platform");
-  };
-
   preferLocalBuild = true;
 
   meta =
@@ -83,17 +71,6 @@ stdenv.mkDerivation {
   # The dynamic linker has different names on different platforms.
   dynamicLinker =
     if !nativeLibc then
-      (if targetPlatform.system == "i686-linux"     then "ld-linux.so.2" else
-       if targetPlatform.system == "x86_64-linux"   then "ld-linux-x86-64.so.2" else
-       # ARM with a wildcard, which can be "" or "-armhf".
-       if targetPlatform.isArm                      then "ld-linux*.so.3" else
-       if targetPlatform.system == "aarch64-linux"  then "ld-linux-aarch64.so.1" else
-       if targetPlatform.system == "powerpc-linux"  then "ld.so.1" else
-       if targetPlatform.system == "mips64el-linux" then "ld.so.1" else
-       if targetPlatform.system == "x86_64-darwin"  then "/usr/lib/dyld" else
-       if stdenv.lib.hasSuffix "pc-gnu" targetPlatform.config then "ld.so.1" else
-       builtins.trace
-         "Don't know the name of the dynamic linker for platform ${targetPlatform.config}, so guessing instead."
-         null)
+      targetPackages.stdenv.cc.bintools.dynamicLinker
     else "";
 }