summaryrefslogtreecommitdiff
path: root/compiler/ghc.cabal.in
diff options
context:
space:
mode:
authorMoritz Angermann <moritz.angermann@gmail.com>2020-05-14 08:18:31 +0800
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-06-07 08:46:42 -0400
commit6dae65484f9552239652f743e2303fa17aae953b (patch)
tree63d59e6b673c6c2cb66c9d29cba0cc1ddf2b2b64 /compiler/ghc.cabal.in
parentb022051a50d30e39d86ee21e565e899e7e98255f (diff)
downloadhaskell-6dae65484f9552239652f743e2303fa17aae953b.tar.gz
Disable DLL loading if without system linker
Some platforms (musl, aarch64) do not have a working dynamic linker implemented in the libc, even though we might see dlopen. It will ultimately just return that this is not supported. Hence we'll add a flag to the compiler to flat our disable loading dlls. This is needed as we will otherwise try to load the shared library even if this will subsequently fail. At that point we have given up looking for static options though.
Diffstat (limited to 'compiler/ghc.cabal.in')
-rw-r--r--compiler/ghc.cabal.in9
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler/ghc.cabal.in b/compiler/ghc.cabal.in
index 1024f0c98f..718047f777 100644
--- a/compiler/ghc.cabal.in
+++ b/compiler/ghc.cabal.in
@@ -55,6 +55,11 @@ Flag integer-gmp
Manual: True
Default: False
+Flag dynamic-system-linker
+ Description: The system can load dynamic code. This is not the case for musl.
+ Default: True
+ Manual: False
+
Library
Default-Language: Haskell2010
Exposed: False
@@ -108,6 +113,10 @@ Library
CPP-Options: -DINTEGER_SIMPLE
build-depends: integer-simple >= 0.1.1.1
+ -- if no dynamic system linker is available, don't try DLLs.
+ if flag(dynamic-system-linker)
+ CPP-Options: -DCAN_LOAD_DLL
+
Other-Extensions:
BangPatterns
CPP