File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 7373 inherit ( bootPkgs ) ghc ;
7474
7575 # TODO check if this posible fix for segfaults works or not.
76- libffiStaticEnabled = if libffi == null || ! stdenv . targetPlatform . isMusl
77- then libffi
78- else targetPackages . libffi . overrideAttrs ( old : { dontDisableStatic = true ; } ) ;
76+ targetLibffi =
77+ if stdenv . targetPlatform . isMusl
78+ then targetPackages . libffi . overrideAttrs ( old : { dontDisableStatic = true ; } )
79+ else if targetPlatform != hostPlatform
80+ then targetPackages . libffi
81+ else libffi ;
7982
8083 # TODO(@Ericson2314) Make unconditional
8184 targetPrefix = stdenv . lib . optionalString
116119
117120 # Splicer will pull out correct variations
118121 libDeps = platform : stdenv . lib . optional enableTerminfo [ ncurses ]
119- ++ [ libffiStaticEnabled ]
122+ ++ [ targetLibffi ]
120123 ++ stdenv . lib . optional ( ! enableIntegerSimple ) gmp
121124 ++ stdenv . lib . optional ( platform . libc != "glibc" && ! targetPlatform . isWindows ) libiconv ;
122125
@@ -208,7 +211,7 @@ in let configured-src = stdenv.mkDerivation (rec {
208211 configureFlags = [
209212 "--datadir=$doc/share/doc/ghc"
210213 "--with-curses-includes=${ ncurses . dev } /include" "--with-curses-libraries=${ ncurses . out } /lib"
211- ] ++ stdenv . lib . optionals ( libffiStaticEnabled != null ) [ "--with-system-libffi" "--with-ffi-includes=${ libffiStaticEnabled . dev } /include" "--with-ffi-libraries=${ libffiStaticEnabled . out } /lib"
214+ ] ++ stdenv . lib . optionals ( targetLibffi != null ) [ "--with-system-libffi" "--with-ffi-includes=${ targetLibffi . dev } /include" "--with-ffi-libraries=${ targetLibffi . out } /lib"
212215 ] ++ stdenv . lib . optional ( ! enableIntegerSimple ) [
213216 "--with-gmp-includes=${ targetPackages . gmp . dev } /include" "--with-gmp-libraries=${ targetPackages . gmp . out } /lib"
214217 ] ++ stdenv . lib . optional ( targetPlatform == hostPlatform && hostPlatform . libc != "glibc" && ! targetPlatform . isWindows ) [
You can’t perform that action at this time.
0 commit comments