Unable to schedule 'Dominator Tree Construction' required by 'Module Verifier'

I have a simple parser / JIT execution module which I recently split up into separate shared libraries.

Previously, and as a test case, I'd generate IR, and immediately reparse / execute it. Now, the execution step lives in a separate but linked shared library. As soon as this happened, this error start popping up:

Unable to schedule 'Dominator Tree Construction' required by 'Module Verifier'
Unable to schedule pass
UNREACHABLE executed at PassManager.cpp:1230!

I've reduced it to the bare minimum test case - parser + linked execution, and it fails as long as the execution code is run from a dylib.

This is with the latest SVN code, on OS X 10.8

Anyone else seen this behaviour? Hopefully I'm missing something obvious

.m

Hi Mondi, maybe: don't link your dynamic library against the LLVM libraries.
If the tool you load it into is already linked against them (like the opt tool
is) then global constructors will be run twice (once when your tool is started
and once when the dynamic library is loaded) and strange things will happen.

Ciao, Duncan.

Thanks, that was exactly the problem.

.m