Hadrian: support dynamically linking ghc
authorDavid Eichmann <EichmannD@gmail.com>
Thu, 29 Nov 2018 17:22:16 +0000 (18:22 +0100)
committerAlp Mestanogullari <alpmestan@gmail.com>
Thu, 29 Nov 2018 17:22:17 +0000 (18:22 +0100)
commit79d5427e1f9de02c0b171bf5db46b6b49c6f85e3
tree4a567176b30bdafe578bd60c2a646d8bb2567708
parentfb9971607c5a41ade71338188c683ee9cb8ca6fc
Hadrian: support dynamically linking ghc

* (#15837 point 5) Use the -rpath gcc option and using the $ORIGIN
variable which the dynamic linker sets to the location of the ghc
binary.
* (#15837 point 4) "-fPIC -dynamic" options are used when building ghc
when either ghc or the rts have a dynamic way.
* (#15837 point 7) "-shared -dynload deploy" options are only used when
linking a library (no longer when linking a program).

Reviewers: bgamari, alpmestan

Reviewed By: alpmestan

Subscribers: adamse, rwbarton, carter

Differential Revision: https://phabricator.haskell.org/D5281
hadrian/src/Context.hs
hadrian/src/Hadrian/Utilities.hs
hadrian/src/Settings/Builders/Ghc.hs