Curious Windows GHCi linker behaviour .o vs. .dll

Brandon Allbery allbery.b at gmail.com
Sun Oct 12 12:45:00 UTC 2014


On Sun, Oct 12, 2014 at 6:11 AM, Herbert Valerio Riedel <hvriedel at gmail.com>
wrote:

> Personally, I think this was a very questionable decision on
>     Microsoft's part, as this way you effectively destroy any chance to
>     simply compile existing POSIX-compatible source code for no good
>     reason...
>

POSIX doesn't specify asm or linker level symbols, only C API. Most
Unix-like platforms have an underscore on the front of symbol names at link
level, so that the API doesn't have to avoid random platform-specific
register names or the assembler need to have magic prefixes on either
symbols or register names. So in fact, by adding the prefix underscore they
are *more* compatible with Unix linkage, and presumably the FFI for Windows
needs to start adding it the way the one for Unix does.

-- 
brandon s allbery kf8nh                               sine nomine associates
allbery.b at gmail.com                                  ballbery at sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20141012/7c3c229f/attachment.html>


More information about the ghc-devs mailing list