Skip to content

Commit

Permalink
haskell-cabal.eclass: enable dynamic linking for all binaries (ghc-7.…
Browse files Browse the repository at this point in the history
…10.1_rc3)

This change will change default static linkage behaviour
from static to dynamic.

As a result linking times will speed up and binaries
will depend on more runtime haskell libraries (just like C libraries).

Binaries, like pandoc now take 500KB instead of previous 25MB blobs.

Signed-off-by: Sergei Trofimovich <siarheit@google.com>
  • Loading branch information
trofi committed Mar 18, 2015
1 parent 426ebbb commit 656844f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
7 changes: 0 additions & 7 deletions eclass/ghc-package.eclass
Expand Up @@ -126,13 +126,6 @@ ghc-supports-smp() {
$(ghc-getghc) --info | grep "Support SMP" | grep -q "YES"
}

# @FUNCTION: ghc-supports-dynamic-by-default
# @DESCRIPTION:
# checks if ghc links against shared haskell libraries by default
ghc-supports-dynamic-by-default() {
$(ghc-getghc) --info | grep "Dynamic by default" | grep -q "YES"
}

# @FUNCTION: ghc-supports-interpreter
# @DESCRIPTION:
# checks if ghc has interpreter mode (aka GHCi)
Expand Down
10 changes: 8 additions & 2 deletions eclass/haskell-cabal.eclass
Expand Up @@ -387,8 +387,14 @@ cabal-configure() {

if $(ghc-supports-shared-libraries); then
# maybe a bit lower
if $(ghc-supports-dynamic-by-default); then
cabalconf+=(--enable-shared)
cabalconf+=(--enable-shared)

# Experimental support for dynamically linked binaries.
# We are enabling it since 7.10.1_rc3
if version_is_at_least "7.10.0.20150316" "$(ghc-version)"; then
# Known to break on ghc-7.8/Cabal-1.18
# https://ghc.haskell.org/trac/ghc/ticket/9625
cabalconf+=(--enable-executable-dynamic)
fi
fi

Expand Down

0 comments on commit 656844f

Please sign in to comment.