summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorSimon Marlow <smarlow@fb.com>2018-02-28 11:03:37 -0800
committerSimon Marlow <marlowsd@gmail.com>2018-03-08 08:36:15 +0000
commitd99a65a80cb671363fa41c826b95b9a89de60878 (patch)
treef5a659eb0f44e6b2a62b24f39e4b8db36ba321ed /docs
parent43fbb905eade2e3e3af67ce944262709763b6578 (diff)
downloadhaskell-d99a65a80cb671363fa41c826b95b9a89de60878.tar.gz
Add -fexternal-dynamic-refs
Summary: The `-dynamic` flag does two things: * In the code generator, it generates code designed to link against external shared libraries. References outside of the current module go through platform-specific indirection tables (e.g. the GOT on ELF). * It enables a "way", which changes which hi files we look for (`Foo.dyn_hi`) and which libraries we link against. Some specialised applications want the first of these without the second. (I could go into detail here but it's probably not all that important). This diff splits out the code-generation effects of `-dynamic` from the "way" parts of its behaviour, via a new flag `-fexternal-dynamic-refs`. Test Plan: validate Reviewers: niteria, bgamari, erikd Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4477
Diffstat (limited to 'docs')
-rw-r--r--docs/users_guide/8.6.1-notes.rst5
-rw-r--r--docs/users_guide/phases.rst20
2 files changed, 19 insertions, 6 deletions
diff --git a/docs/users_guide/8.6.1-notes.rst b/docs/users_guide/8.6.1-notes.rst
index 17617ac61a..1e3f509843 100644
--- a/docs/users_guide/8.6.1-notes.rst
+++ b/docs/users_guide/8.6.1-notes.rst
@@ -56,6 +56,11 @@ Compiler
- GHC now supports British spelling of :extension:`GeneralizedNewtypeDeriving`.
+- The code-generation effects of :ghc-flag:`-dynamic` can now be
+ enabled independently by the flag
+ :ghc-flag:`-fexternal-dynamic-refs`. If you don't know why you might
+ need this, you don't need it.
+
Runtime system
~~~~~~~~~~~~~~
diff --git a/docs/users_guide/phases.rst b/docs/users_guide/phases.rst
index ad9daf1279..a2c25c79eb 100644
--- a/docs/users_guide/phases.rst
+++ b/docs/users_guide/phases.rst
@@ -580,6 +580,15 @@ Options affecting code generation
Windows, position-independent code is never used so the flag is a
no-op on that platform.
+.. ghc-flag:: -fexternal-dynamic-refs
+ :shortdesc: Generate code for linking against dynamic libraries
+ :type: dynamic
+ :category: codegen
+
+ When generating code, assume that entities imported from a
+ different module might be dynamically linked. This flag is enabled
+ automatically by :ghc-flag:`-dynamic`.
+
.. ghc-flag:: -fPIE
:shortdesc: Generate code for a position-independent executable (where available)
:type: dynamic
@@ -596,12 +605,11 @@ Options affecting code generation
:category: codegen
:noindex:
- When generating code, assume that entities imported from a different
- package will be dynamically linked. This can reduce code size
- tremendously, but may slow-down cross-package calls of non-inlined
- functions. There can be some complications combining :ghc-flag:`-shared`
- with this flag relating to linking in the RTS under Linux. See
- :ghc-ticket:`10352`.
+ Build code for dynamic linking. This can reduce code size
+ tremendously, but may slow-down cross-module calls of non-inlined
+ functions. There can be some complications combining
+ :ghc-flag:`-shared` with this flag relating to linking in the RTS
+ under Linux. See :ghc-ticket:`10352`.
Note that using this option when linking causes GHC to link against
shared libraries.