LLVM and dynamic linking

Ben Gamari bgamari.foss at gmail.com
Fri Dec 20 13:45:50 UTC 2013

Simon Marlow <marlowsd at gmail.com> writes:

> This sounds right to me.  Did you submit a patch?
Not yet, I'm currently fighting through some build system issues which
are preventing me from actually installing and testing the compiler on
my ARM box.

> Note that dynamic linking with LLVM is likely to produce significantly 
> worse code that with the NCG right now, because the LLVM back end uses 
> dynamic references even for symbols in the same package, whereas the NCG 
> back-end uses direct static references for these.
Right. However it (hopefully) works on ARM which is more than I can say
about the NCG. Moreover, I'm hopeful that it will be possible to fix
LLVM's output.

Would this not simply be a matter of flagging package-local symbols with
LLVM's `private` linkage type[1]? In the case where you have references
both internal and external to the package could you not define two
overlapping symbols, one flagged with `private` and the other
`external`? Perhaps I'm missing a subtlety?


- Ben

[1] http://llvm.org/docs/LangRef.html#linkage-types
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 489 bytes
Desc: not available
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20131220/e6095365/attachment.sig>

More information about the ghc-devs mailing list