diff options
author | Simon Marlow <marlowsd@gmail.com> | 2017-03-02 16:17:12 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-03-02 19:58:01 -0500 |
commit | a6874e546294173c166859769dd8054887a6ded7 (patch) | |
tree | fa2b2000ff6b4dcab30807adf3f8e3685550b9cf /docs | |
parent | 57d969ec9bea8ca44e735845e9aa91292fe5e75b (diff) | |
download | haskell-a6874e546294173c166859769dd8054887a6ded7.tar.gz |
Add -fwhole-archive-hs-libs
We're building a demo to show how to hot-swap Haskell code in a
running process, and unfortunately it wasn't possible to convince GHC
to generate the correct linker command line without this extra knob.
Test Plan:
Tested it on a hot-swapping demo (which is not released yet, but will
be shortly)
Reviewers: niteria, austin, erikd, JonCoens, bgamari
Reviewed By: bgamari
Subscribers: Phyx, rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D3136
Diffstat (limited to 'docs')
-rw-r--r-- | docs/users_guide/phases.rst | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/docs/users_guide/phases.rst b/docs/users_guide/phases.rst index b1a6310e6d..6bc97675f5 100644 --- a/docs/users_guide/phases.rst +++ b/docs/users_guide/phases.rst @@ -853,3 +853,18 @@ for example). the dynamic symbol table. Currently Linux and Windows/MinGW32 only. This is equivalent to using ``-optl -rdynamic`` on Linux, and ``-optl -export-all-symbols`` on Windows. + +.. ghc-flag:: -fwhole-archive-hs-libs + + When linking a binary executable, this inserts the flag + ``-Wl,--whole-archive`` before any ``-l`` flags for Haskell + libraries, and ``-Wl,--no-whole-archive`` afterwards (on OS X, the + flag is ``-Wl,-all_load``, there is no equivalent for + ``-Wl,--no-whole-archive``). This flag also disables the use of + ``-Wl,--gc-sections`` (``-Wl,-dead_strip`` on OS X). + + This is for specialist applications that may require symbols + defined in these Haskell libraries at runtime even though they + aren't referenced by any other code linked into the executable. + If you're using ``-fwhole-archive-hs-libs``, you probably also + want ``-rdynamic``. |