From 93d765be7e7db383c08b41bce4591b00abbfdbb1 Mon Sep 17 00:00:00 2001 From: doyougnu Date: Wed, 3 Jul 2024 13:56:04 -0400 Subject: [PATCH] haskell.compiler.ghc8107: use libffi 3.3 This is the libffi version that GHC 8.10.7 was released with. libffi >= 3.4 in nixpkgs is no longer getting configured with the configure flag that enabled GHC to continue working. See https://gitlab.haskell.org/ghc/ghc/-/issues/20051. Fixes #324384. Co-authored-by: sternenseemann --- pkgs/development/compilers/ghc/8.10.7.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pkgs/development/compilers/ghc/8.10.7.nix b/pkgs/development/compilers/ghc/8.10.7.nix index c8669a2761f8..7b873d903eee 100644 --- a/pkgs/development/compilers/ghc/8.10.7.nix +++ b/pkgs/development/compilers/ghc/8.10.7.nix @@ -9,7 +9,9 @@ , libiconv ? null, ncurses , # GHC can be built with system libffi or a bundled one. - libffi ? null + # we explicitly use libffi-3.3 here because 3.4 removes a flag that causes + # problems for ghc-8.10.7's RTS. See #324384. + libffi_3_3 ? null , useLLVM ? !(stdenv.targetPlatform.isx86 || stdenv.targetPlatform.isPower @@ -119,7 +121,7 @@ let # Splicer will pull out correct variations libDeps = platform: lib.optional enableTerminfo ncurses - ++ [libffi] + ++ [libffi_3_3] ++ lib.optional (!enableIntegerSimple) gmp ++ lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv; @@ -334,10 +336,10 @@ stdenv.mkDerivation (rec { configureFlags = [ "--datadir=$doc/share/doc/ghc" "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib" - ] ++ lib.optionals (libffi != null) [ + ] ++ lib.optionals (libffi_3_3 != null) [ "--with-system-libffi" - "--with-ffi-includes=${targetPackages.libffi.dev}/include" - "--with-ffi-libraries=${targetPackages.libffi.out}/lib" + "--with-ffi-includes=${targetPackages.libffi_3_3.dev}/include" + "--with-ffi-libraries=${targetPackages.libffi_3_3.out}/lib" ] ++ lib.optionals (targetPlatform == hostPlatform && !enableIntegerSimple) [ "--with-gmp-includes=${targetPackages.gmp.dev}/include" "--with-gmp-libraries=${targetPackages.gmp.out}/lib"