#7097: linker fails to load package with binding to foreign library
-------------------------------+--------------------------------------------
Reporter: nus | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Runtime System | Version: 7.4.2
Keywords: | Os: Windows
Architecture: x86 | Failure: None/Unknown
Difficulty: Unknown | Testcase:
Blockedby: | Blocking:
Related: 2283 |
-------------------------------+--------------------------------------------
Comment(by nus):
Replying to [comment:2 simonmar]:
> When linking the binary, how does the linker know it also needs
`ws2_32.dll`?
It doesn't. Only the stub file is linked in. The stub file is a peculiar
to Windows way to produce an indirection/relocation. When the produced
binary is executed, the Windows dynamic loader takes care of the
`__imp__WSACleanup@0` symbol redirection/resolution.
> I wonder why GHCi doesn't also find `libws2_32.a`? Maybe it isn't on
the search path for some reason.
It doesn't search for `libxxx.a`, and the path searched does not include
the location of the stub file. Also, I believe the PEI386 handling in
rts/Linker.c currently would be unable to load such stub files.
Please, pardon my brevity, still looking into this.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7097#comment:3>
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