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 73
73
inherit ( bootPkgs ) ghc ;
74
74
75
75
# 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 ;
79
82
80
83
# TODO(@Ericson2314) Make unconditional
81
84
targetPrefix = stdenv . lib . optionalString
116
119
117
120
# Splicer will pull out correct variations
118
121
libDeps = platform : stdenv . lib . optional enableTerminfo [ ncurses ]
119
- ++ [ libffiStaticEnabled ]
122
+ ++ [ targetLibffi ]
120
123
++ stdenv . lib . optional ( ! enableIntegerSimple ) gmp
121
124
++ stdenv . lib . optional ( platform . libc != "glibc" && ! targetPlatform . isWindows ) libiconv ;
122
125
@@ -208,7 +211,7 @@ in let configured-src = stdenv.mkDerivation (rec {
208
211
configureFlags = [
209
212
"--datadir=$doc/share/doc/ghc"
210
213
"--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"
212
215
] ++ stdenv . lib . optional ( ! enableIntegerSimple ) [
213
216
"--with-gmp-includes=${ targetPackages . gmp . dev } /include" "--with-gmp-libraries=${ targetPackages . gmp . out } /lib"
214
217
] ++ stdenv . lib . optional ( targetPlatform == hostPlatform && hostPlatform . libc != "glibc" && ! targetPlatform . isWindows ) [
You can’t perform that action at this time.
0 commit comments