Add -fexternal-dynamic-refs
authorSimon Marlow <smarlow@fb.com>
Wed, 28 Feb 2018 19:03:37 +0000 (11:03 -0800)
committerSimon Marlow <marlowsd@gmail.com>
Thu, 8 Mar 2018 08:36:15 +0000 (08:36 +0000)
commitd99a65a80cb671363fa41c826b95b9a89de60878
treef5a659eb0f44e6b2a62b24f39e4b8db36ba321ed
parent43fbb905eade2e3e3af67ce944262709763b6578
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
compiler/cmm/CLabel.hs
compiler/main/DynFlags.hs
compiler/nativeGen/PIC.hs
docs/users_guide/8.6.1-notes.rst
docs/users_guide/phases.rst
testsuite/tests/ghci/scripts/T9293.stdout
testsuite/tests/ghci/scripts/ghci024.stdout
testsuite/tests/ghci/scripts/ghci057.stdout