Align GHCi's library search order more closely with LDs
authorTamar Christina <tamar@zhox.com>
Mon, 31 Oct 2016 21:03:14 +0000 (21:03 +0000)
committerTamar Christina <tamar@zhox.com>
Mon, 31 Oct 2016 21:03:14 +0000 (21:03 +0000)
commit795be0ea60fc81aefdaf6ecb1dc9b03c4a5c9f86
treec1b71a9a55e6395c21308bb243094d5163178281
parent80d4a03332e09064e5542924f2897d7eb573f19e
Align GHCi's library search order more closely with LDs

Summary:
Given a static library and an import library in the same folder. e.g.

```
libfoo.a
libfoo.dll.a
```

running `ghci -lfoo` we should prefer the import library `libfoo.dll.a`
over `libfoo.a` because we prefer having to just load the DLL.
And not having to do any linking.

This also more closely emulated the behaviour of LD, which has a search order of

```
libxxx.dll.a
xxx.dll.a
libxxx.a
cygxxx.dll (*)
libxxx.dll
xxx.dll
```

Test Plan: ./validate

Reviewers: RyanGlScott, austin, hvr, bgamari, erikd, simonmar

Reviewed By: RyanGlScott

Subscribers: thomie, #ghc_windows_task_force

Differential Revision: https://phabricator.haskell.org/D2651

GHC Trac Issues: #12771
compiler/ghci/Linker.hs
testsuite/tests/rts/T12771/Makefile [new file with mode: 0644]
testsuite/tests/rts/T12771/T12771.stdout [new file with mode: 0644]
testsuite/tests/rts/T12771/all.T [new file with mode: 0644]
testsuite/tests/rts/T12771/foo.c [new file with mode: 0644]
testsuite/tests/rts/T12771/foo_dll.c [new file with mode: 0644]
testsuite/tests/rts/T12771/main.hs [new file with mode: 0644]