Skip to content

Commit

Permalink
ghc821-binary: use glibc on musl
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dtzWill committed Jul 11, 2018
1 parent 2d1d170 commit 4a1d311
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pkgs/development/compilers/ghc/8.2.1-binary.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ stdenv
, fetchurl, perl, gcc, llvm_39
, ncurses5, gmp, libiconv
, ncurses5, gmp, glibc, libiconv
}:

# Prebuilt only does native
Expand All @@ -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 {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4a1d311

Please sign in to comment.