#4465: GHCi linker failure on Windows
----------------------------+-----------------------------------------------
Reporter: joellathrop | Owner:
Type: bug | Status: new
Priority: normal | Component: GHCi
Version: 6.12.3 | Keywords: ghci linker -L DLL
Testcase: | Blockedby:
Os: Windows | Blocking:
Architecture: x86 | Failure: Incorrect result at runtime
----------------------------+-----------------------------------------------
On Windows, GHCi seems unable to find a DLL in a non-standard location,
even when that location is provided with -L.
Presume a valid DLL named "foo.dll" in "c:\temp\test". An attempt to load
"foo" into GHCi when the current working directory is "c:\temp\test" is
successful:
{{{
C:\temp\test>ghci -lfoo
GHCi, version 6.12.3: 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 package ffi-1.0 ... linking ... done.
Loading object (dynamic) foo ... done
final link ... done
Prelude>
}}}
However, if the current working directory is "c:\temp" all attempts to
load "foo" into GHCi using the -L switch fail:
{{{
C:\temp>ghci -lfoo -Ltest
GHCi, version 6.12.3: 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 package ffi-1.0 ... linking ... done.
: foo: The specified module could not be found.
Loading object (dynamic) foo ... failed.
<command line>: user specified .o/.so/.DLL could not be loaded (addDLL:
could no
t load DLL)
Whilst trying to load: (dynamic) foo
Additional directories searched: test
}}}
{{{
C:\temp>ghci -lfoo -L\temp\test
GHCi, version 6.12.3: 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 package ffi-1.0 ... linking ... done.
: foo: The specified module could not be found.
Loading object (dynamic) foo ... failed.
<command line>: user specified .o/.so/.DLL could not be loaded (addDLL:
could no
t load DLL)
Whilst trying to load: (dynamic) foo
Additional directories searched: \temp\test
}}}
{{{
C:\temp>ghci -lfoo -Lc:\temp\test
GHCi, version 6.12.3: 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 package ffi-1.0 ... linking ... done.
: foo: The specified module could not be found.
Loading object (dynamic) foo ... failed.
<command line>: user specified .o/.so/.DLL could not be loaded (addDLL:
could no
t load DLL)
Whilst trying to load: (dynamic) foo
Additional directories searched: c:\temp\test
}}}
However, GHCi has no problem loading "foo" if the path component is
included in the -l option. (Naturally, this is not ideal and far from the
accepted usage of -l and -L.)
{{{
C:\temp>ghci -ltest\foo
GHCi, version 6.12.3: 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 package ffi-1.0 ... linking ... done.
Loading object (dynamic) test\foo ... done
final link ... done
Prelude>
}}}
Finally, this issue does not manifest on Linux. Everything seems to work
fine there.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4465>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs