From 4a1d311c4941839b0d1abf14df2c50cbc5434009 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Tue, 10 Jul 2018 22:06:23 -0500 Subject: 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. --- pkgs/development/compilers/ghc/8.2.1-binary.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'pkgs/development/compilers') 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 -- cgit 1.4.1