summaryrefslogtreecommitdiff
path: root/docs/users_guide
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2021-06-17 16:52:58 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-06-20 07:13:41 -0400
commit6281a333303a4dbe75a97a87c17c0fbace5268f5 (patch)
tree72f0fc5405fe5bfefdc5cd8183d10389f5b53079 /docs/users_guide
parent6c783817ef089e85642c3383937117cff9d15f67 (diff)
downloadhaskell-6281a333303a4dbe75a97a87c17c0fbace5268f5.tar.gz
Linker/darwin: Properly honour -fno-use-rpaths
The specification is now simple * On linux, use `-Xlinker -rpath -Xlinker` to set the rpath of the executable * On darwin, never use `-Xlinker -rpath -Xlinker`, always inject the rpath afterwards, see `runInjectRPaths`. * If `-fno-use-rpaths` is passed then *never* inject anything into the rpath. Fixes #20004
Diffstat (limited to 'docs/users_guide')
-rw-r--r--docs/users_guide/expected-undocumented-flags.txt1
-rw-r--r--docs/users_guide/phases.rst14
2 files changed, 13 insertions, 2 deletions
diff --git a/docs/users_guide/expected-undocumented-flags.txt b/docs/users_guide/expected-undocumented-flags.txt
index f7e55fa573..9861386d0c 100644
--- a/docs/users_guide/expected-undocumented-flags.txt
+++ b/docs/users_guide/expected-undocumented-flags.txt
@@ -82,7 +82,6 @@
-fspecialize-aggressively
-fth
-ftype-function-depth
--fuse-rpaths
-fversion-macros
-fvia-c
-haddock-opts
diff --git a/docs/users_guide/phases.rst b/docs/users_guide/phases.rst
index 73d9777f99..6833ce36d7 100644
--- a/docs/users_guide/phases.rst
+++ b/docs/users_guide/phases.rst
@@ -824,6 +824,18 @@ for example).
Where to find user-supplied libraries… Prepend the directory ⟨dir⟩
to the library directories path.
+.. ghc-flag:: -fuse-rpaths
+ :shortdesc: Set the rpath based on -L flags
+ :type: dynamic
+ :category: linking
+
+ This flag is enabled by default and will set the rpath of the linked
+ object to the library directories of dependent packages.
+
+ When building binaries to distribute it can be useful to pass your own
+ linker options to control the rpath and disable the automatic injection of
+ rpath entries by disabling this flag.
+
.. ghc-flag:: -framework-path ⟨dir⟩
:shortdesc: On Darwin/OS X/iOS only, add ⟨dir⟩ to the list of directories
searched for frameworks. This option corresponds to the ``-F``
@@ -911,7 +923,7 @@ for example).
When linking shared libraries (:ghc-flag:`-shared`) GHC does not
automatically link the RTS. This is to allow choosing the RTS flavour
(:ghc-flag:`-threaded`, :ghc-flag:`-eventlog`, etc) when linking an
- executable.
+ executable.
However when the shared library is the intended product it is useful to be
able to reverse this default. See :ref:`shared-libraries-c-api` for an
usage example.