opt refuses to load a pass


I'm having problems while using a custom pass with opt. The pass compiles and links just fine but, when I try to use it with opt:

opt -load LLVMmyPass.so -my-flag -f aes.bc -o aes_bb.bc

opt refuses to load it with the following error:

Error opening 'LLVMmyPass.so': LLVMmyPass.so: undefined symbol: _ZN4llvm9DebugFlagE
   -load request ignored.

and then complains that the flag "-my-flag" cannot be found. A quick look at google makes me think that the missing symbol belongs to libLLVMSupport.a, which should be already linked to opt, shouldn't it? Somebody suggested me that perhaps LLVM and my pass were compiled with different options (one in Release and another in Debug, for instance) but I double-checked and both are in Debug mode.

Can anyone spot the problem here? Thanks ahead!

Just in case someone reads this one, the problem is solved. For my pass, the whole LLVM had to be compiled with assertions enabled.