Skip to content

Commit 793163e

Browse files
committed
No dynamic loading on x86.
1 parent 12b7e01 commit 793163e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

compiler/ghc/default.nix

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,9 @@ let
163163
WITH_TERMINFO=NO
164164
''
165165
# musl doesn't have a system-linker. Only on x86, and on x86 we need it, as
166-
# our elf linker for x86_64 is broken.
167-
+ lib.optionalString (targetPlatform.isAndroid || (targetPlatform.isMusl && !targetPlatform.isx86)) ''
166+
# our elf linker for x86_64 is broken. The i686 one seems also to not exist.
167+
# So it's really _just_ x86_64.
168+
+ lib.optionalString (targetPlatform.isAndroid || (targetPlatform.isMusl && !targetPlatform.isx86_64)) ''
168169
compiler_CONFIGURE_OPTS += --flags=-dynamic-system-linker
169170
''
170171
# While split sections are now enabled by default in ghc 8.8 for windows,
@@ -325,7 +326,7 @@ let
325326
# The fact that we need to set this here is pretty idiotic. GHC should figure this out on it's own.
326327
# Either have a runtime flag/setting to disable it or if dlopen fails, remember that it failed and
327328
# fall back to non-dynamic. We only have x86_64 dynamic linker with musl.
328-
+ lib.optionalString (targetPlatform.isAndroid || (targetPlatform.isMusl && !targetPlatform.isx86))
329+
+ lib.optionalString (targetPlatform.isAndroid || (targetPlatform.isMusl && !targetPlatform.isx86_64))
329330
" '*.ghc.cabal.configure.opts += --flags=-dynamic-system-linker'"
330331
# The following is required if we build on aarch64-darwin for aarch64-iOS. Otherwise older
331332
# iPhones/iPads/... won't understand the compiled code, as the compiler will emit LDSETALH

0 commit comments

Comments
 (0)