visual studio 2010 - GHC Foreign hs_init/hs_add_root crashes -


i don't repeat more necessary, brief summary: following adder example tutorial on machine win7 (64) vs 2010. don't use c++ plain c.

when using cl (ms compiler) cl /zi (and no other flag) works expected. if not use /zi , try execute exe goes flames.

why? (there must compiler/link options make init in start of haskell dll go wrong )

edit: investigation:

/zi not affect optimizations. however, /zi imply /debug; see /debug (generate debug info) more information.

/debug changes defaults /opt option ref noref , icf noicf (so, need explicitly specify /opt:ref or /opt:icf).]

/opt:icf can result in same address being assigned different functions or read data members (const variables compiled /gy). so, /opt:icf can break program depends on address of functions or read-only data members being different. see /gy (enable function-level linking) more information.

can confirm /opt:icf affect loading of haskell/ghc compiled shared library(dll) ?


Comments