[Haskell-cafe] Cabal: --enable-shared and executables

Magnus Therning magnus at therning.org
Thu Oct 31 20:26:27 UTC 2013

We've had a discussion about DSOs on the arch-haskell mailing list[1]
and it made me realise one thing:

  --enable-shared will cause the generation of DSOs for libraries, but
  it won't cause executables to be dynamically linked

Is the only way to cause these executables to be dynamically linked
against their dependencies to pass the -dynamic flag to ghc (e.g. via
the --ghc-options flag when configuring the package)?

That then raises the issue of finding the DSOs.  Something that is
discussed in the Ghc documentation[2].  However, the generated DSOs
are correctly linked to their dependencies.

I guess what I'm trying to get to is that it seems to me that Cabal
only provides half the solution to DSOs; it solves generation, but not
usage.  Is that an observation that people agree with?  Are there any
plans to solve this (maybe it's already solved in 1.18)?


[1]: http://www.haskell.org/pipermail/arch-haskell/2013-October/004599.html
[2]: http://www.haskell.org/ghc/docs/7.6.3/html/users_guide/using-shared-libs.html

Magnus Therning                      OpenPGP: 0xAB4DFBA4 
email: magnus at therning.org   jabber: magnus at therning.org
twitter: magthe               http://therning.org/magnus

The day after tomorrow is the third day of the rest of your life.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20131031/ea257dd3/attachment.sig>

More information about the Haskell-Cafe mailing list