summary refs log tree commit diff
path: root/pkgs/development/compilers/ghc/8.2.1-binary.nix
diff options
context:
space:
mode:
authorWill Dietz <w@wdtz.org>2018-07-10 22:06:23 -0500
committerWill Dietz <w@wdtz.org>2018-07-11 11:06:20 -0500
commit4a1d311c4941839b0d1abf14df2c50cbc5434009 (patch)
tree087a68baf45a20d3d9a5e647847bb63b3b80b4a9 /pkgs/development/compilers/ghc/8.2.1-binary.nix
parent2d1d17032b4b6c885f4b3d834a1da2200f65598b (diff)
downloadnixlib-4a1d311c4941839b0d1abf14df2c50cbc5434009.tar
nixlib-4a1d311c4941839b0d1abf14df2c50cbc5434009.tar.gz
nixlib-4a1d311c4941839b0d1abf14df2c50cbc5434009.tar.bz2
nixlib-4a1d311c4941839b0d1abf14df2c50cbc5434009.tar.lz
nixlib-4a1d311c4941839b0d1abf14df2c50cbc5434009.tar.xz
nixlib-4a1d311c4941839b0d1abf14df2c50cbc5434009.tar.zst
nixlib-4a1d311c4941839b0d1abf14df2c50cbc5434009.zip
ghc821-binary: use glibc on musl
These prebuilt binaries need to be used with glibc,
it doesn't matter what we're using otherwise.

This may seem a bit strange but has the huge advantage
of not needing to create/host/download musl-specific variants,
and instead continue to use the official ones from upstream.
Diffstat (limited to 'pkgs/development/compilers/ghc/8.2.1-binary.nix')
-rw-r--r--pkgs/development/compilers/ghc/8.2.1-binary.nix10
1 files changed, 8 insertions, 2 deletions
diff --git a/pkgs/development/compilers/ghc/8.2.1-binary.nix b/pkgs/development/compilers/ghc/8.2.1-binary.nix
index 9bd7dfcb9fc1..4a3c817e9fcb 100644
--- a/pkgs/development/compilers/ghc/8.2.1-binary.nix
+++ b/pkgs/development/compilers/ghc/8.2.1-binary.nix
@@ -1,6 +1,6 @@
 { stdenv
 , fetchurl, perl, gcc, llvm_39
-, ncurses5, gmp, libiconv
+, ncurses5, gmp, glibc, libiconv
 }:
 
 # Prebuilt only does native
@@ -14,6 +14,12 @@ let
   libEnvVar = stdenv.lib.optionalString stdenv.hostPlatform.isDarwin "DY"
     + "LD_LIBRARY_PATH";
 
+  glibcDynLinker = assert stdenv.isLinux;
+    if stdenv.hostPlatform.libc == "glibc" then
+       stdenv.cc.bintools.dynamicLinker
+    else
+      "${stdenv.lib.getLib glibc}/lib/ld-linux*";
+
 in
 
 stdenv.mkDerivation rec {
@@ -95,7 +101,7 @@ stdenv.mkDerivation rec {
       find . -type f -perm -0100 -exec patchelf \
           --replace-needed libncurses${stdenv.lib.optionalString stdenv.is64bit "w"}.so.5 libncurses.so \
           --replace-needed libtinfo.so libtinfo.so.5 \
-          --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" {} \;
+          --interpreter ${glibcDynLinker} {} \;
 
       paxmark m ./ghc-${version}/ghc/stage2/build/tmp/ghc-stage2