<div dir="ltr"><div><span style="font-family:arial,helvetica,sans-serif">Greetings, LLVM wizards.</span></div><div><span style="font-family:arial,helvetica,sans-serif"><br></span></div><div><span style="font-family:arial,helvetica,sans-serif">I am using clang to compile a C++ module, and an ExecutionEngine (MCJIT) to execute a function it defines. That works (or pretends to). However, if I call the module's constructors first:</span></div><div><br></div><div style="margin-left:40px"><span style="font-family:monospace,monospace">exec_engine->runStaticConstructorsDestructors(false);</span></div><div style="margin-left:40px"><span style="font-family:monospace,monospace">exec_engine->runFunctionAsMain(function, argvec, NULL);</span></div><div><br></div><div><span style="font-family:arial,helvetica,sans-serif">execution still works, but my program crashes when it exits, in __run_exit_handlers(). I can't tell from gdb what exit handler is crashing, but no calls are made to atexit() or on_exit(); all exit handlers are installed via __cxa_atexit().</span></div><div><span style="font-family:arial,helvetica,sans-serif"><br></span></div><div><span style="font-family:arial,helvetica,sans-serif">This may or may not be meaningful, but I am forced to compile with -fno-use-cxa-atexit, otherwise clang complains that __dso_handle could not be resolved.</span></div><div><span style="font-family:arial,helvetica,sans-serif"><br></span></div><div><span style="font-family:arial,helvetica,sans-serif">Any guidance would be MUCH appreciated. I am at a loss... Also, if you know of a better place to look for help than this mailing list, that would be appreciated, too.<br></span></div><div><span style="font-family:arial,helvetica,sans-serif"><br></span></div><div><span style="font-family:arial,helvetica,sans-serif">Thanks,</span></div><div><span style="font-family:arial,helvetica,sans-serif">Geoff<br></span></div></div>