From a7c774300b7eab779afb9a81b3f02f3bed69c943 Mon Sep 17 00:00:00 2001 From: Guillaume Bouchard Date: Mon, 4 Feb 2019 13:49:51 +0100 Subject: ghc-8.6.3: use system `libffi` Use the system `libffi` (`ie` nixpkgs's) instead of built-in libffi from ghc source tree. This will prevent library conflict when ghc dynamically links haskell packages (linked with ghc built-in libffi) and any external library which uses nixpkgs `libffi`. Closes https://github.com/NixOS/nixpkgs/pull/55208. --- pkgs/development/compilers/ghc/8.6.3.nix | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'pkgs/development/compilers/ghc') diff --git a/pkgs/development/compilers/ghc/8.6.3.nix b/pkgs/development/compilers/ghc/8.6.3.nix index 4e1f0dd9fc72..c57e4d96ae2e 100644 --- a/pkgs/development/compilers/ghc/8.6.3.nix +++ b/pkgs/development/compilers/ghc/8.6.3.nix @@ -6,6 +6,9 @@ , libiconv ? null, ncurses +, # GHC can be built with system libffi or a bundled one. + libffi ? null + , useLLVM ? !stdenv.targetPlatform.isx86 || (stdenv.targetPlatform.isMusl && stdenv.hostPlatform != stdenv.targetPlatform) , # LLVM is conceptually a run-time-only depedendency, but for # non-x86, we need LLVM to bootstrap later stages, so it becomes a @@ -65,6 +68,7 @@ let # Splicer will pull out correct variations libDeps = platform: stdenv.lib.optional enableTerminfo [ ncurses ] + ++ [libffi] ++ stdenv.lib.optional (!enableIntegerSimple) gmp ++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv; @@ -149,6 +153,7 @@ stdenv.mkDerivation (rec { configureFlags = [ "--datadir=$doc/share/doc/ghc" "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib" + ] ++ stdenv.lib.optionals (libffi != null) ["--with-system-libffi" "--with-ffi-includes=${libffi}/include" "--with-ffi-libraries=${libffi}/lib" ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && !enableIntegerSimple) [ "--with-gmp-includes=${targetPackages.gmp.dev}/include" "--with-gmp-libraries=${targetPackages.gmp.out}/lib" ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [ -- cgit 1.4.1