Support LIBRARY_PATH and LD_LIBRARY_PATH in rts
authorBen Gamari <ben@smart-cactus.org>
Mon, 15 Jan 2018 17:40:22 +0000 (12:40 -0500)
committerBen Gamari <ben@smart-cactus.org>
Mon, 15 Jan 2018 18:53:46 +0000 (13:53 -0500)
commit87917a594f37b70810013168a5df64d630620724
treefe3dcac388e173fe8fc0f9a8e8f01ce5d4ad413b
parent3d17f1f10fc00540ac052f2fd03182906aa47e35
Support LIBRARY_PATH and LD_LIBRARY_PATH in rts

`LIBRARY_PATH` is used to find libraries and other link artifacts while
`LD_LIBRARY_PATH` is used to find shared libraries by the loader.

Due to an implementation detail on Windows, using `LIBRARY_PATH` will
automatically add the path of any library found to the loader's path.

So in that case `LD_LIBRARY_PATH` won't be needed.

Test Plan:
./validate along with T14611 which has been made Windows only
due to linux using the system linker/loader by default. So I feel a
testcase there is unwarranted as the support is indirect via glibc.

Reviewers: hvr, bgamari, erikd, simonmar, RyanGlScott

Reviewed By: RyanGlScott

Subscribers: RyanGlScott, rwbarton, thomie, carter

GHC Trac Issues: #14611

Differential Revision: https://phabricator.haskell.org/D4275
compiler/ghci/Linker.hs
docs/users_guide/8.6.1-notes.rst
docs/users_guide/ghci.rst
testsuite/tests/rts/T14611/Makefile [new file with mode: 0644]
testsuite/tests/rts/T14611/T14611.stdout [new file with mode: 0644]
testsuite/tests/rts/T14611/all.T [new file with mode: 0644]
testsuite/tests/rts/T14611/foo.c [new file with mode: 0644]
testsuite/tests/rts/T14611/foo_dll.c [new file with mode: 0644]
testsuite/tests/rts/T14611/main.hs [new file with mode: 0644]