Fwd: Compiling Core Haskell using GHC API

Marek Wawrzos marek.28.93 at gmail.com
Thu Oct 8 14:22:01 UTC 2015


Hello,

I'm trying to compile some module with GHC API. I'm going to feed GHC with
Core generated by me.

So far is noticed, that function compileCoreToObj ends with an runtime
error on each call. In spide of this function produces some *.o and *.hi
files. However, produced interface file does not contain any item in
exports field, what makes compiled module unusable.

Because of this problem, I tried to achieve my goal by using steps
described here: https://wiki.haskell.org/GHC/As_a_library (the second
example)
I was able to print out Core produced form file. If I'm not wrong,
modifying structures passing on between sequent calls does not effect on
produced *.hi and *.o files. Both files are generated by `load
LoadAllTargets' call, and further calls (parseModule, loadModule, ...) does
not effect on generated files.

Could You give me any advices in that topic? Am I right about
compileCoreToObj and functions mentioned above?

Best Regards,
Marek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20151008/65627c6e/attachment.html>


More information about the ghc-devs mailing list