All the passes (even the fail at doFinalization()

Hi all,

I find all my passes are all broken with LLVM 3.4. Then I tried out the specified in the LLVM doc,

and it also crashes.

It seems all the functions in the pass do work, but LLVM crashes in the doFinalization() step.

Does anyone know this problem?


Tried opt -verify on your module?


Oh, you mean opt -disable-verify?

Yes, it does eliminate the crashing…

Do you know what’s the problem, Eric?

Thanks a lot!

No idea, I was suggesting to just run the verifier to see if it would
pinpoint what's broken about the module.


no… I guess verifier runs by default and it points to the doFinailization() function :frowning:


Weird, it definitely shouldn't be crashing. How did you create your module?


I just follow the tutorial:

Actually it’s not only my module, I used the (a sample module in the source tree) and get the crash (I didn’t do anything :-P).


That doesn't tell me where your module came from. How did you create
the module that you're attempting to verify?


The module is shipped with the source code, so it’s from the developers (not me).

The path in the source tree is:

After compiled LLVM

#./configure --prefix=XXX --with-binutils-include=/path-to-binutils-2.24/include --enable-debug-symbols --enable-debug-runtime --enable-assertions --disable-optimized; make; make install is generated at llvm-3.4.2.src/Debug+Asserts/lib

According to the tutorial, the following command should be called to invoke it,

#opt -load …/…/…/Debug+Asserts/lib/ -hello < hello.bc > /dev/null

(and verify will be invoked by default).


How did you create hello.bc?

Use the gold plugin stuff,

first use clang -flto to generate the bitcode file for each source file,
and then use to link different files together.