GHCi cannot load .so in ./
In my directory ./ I have an empty file Foo.hs and a shared object file mylib.so. From that directory in the shell,
$ ghci Foo *.so
GHCi, version 7.8.2: http://www.haskell.org/ghc/ :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading object (dynamic) mylib.so ... failed.
<command line>: user specified .o/.so/.DLL could not be loaded (mylib.so: cannot open shared object file: No such file or directory)
Whilst trying to load: (dynamic) mylib.so
Additional directories searched: (none)
It's interesting that GHCi searches ./ and identifies the correct object file, but then fails to load it. I have also tried the path ./*.so, mylib.so and ./mylib.so for the GHCi option.
However, if I move mylib.so to a directory ./Temp,
$ ghci Foo Temp/*.so
loads without issue.