[LLVMdev] All the passes (even the LLVMHello.so) fail at doFinalization()

Tianyin Xu tixu at cs.ucsd.edu
Tue Aug 12 16:21:01 PDT 2014


Use the gold plugin stuff,

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

~t



On Tue, Aug 12, 2014 at 10:12 AM, Duncan P. N. Exon Smith <
dexonsmith at apple.com> wrote:

> How did you create hello.bc?
>
> > On 2014-Aug-12, at 01:15, Tianyin Xu <tixu at cs.ucsd.edu> wrote:
> >
> > The module is shipped with the source code, so it's from the developers
> (not me).
> >
> > The path in the source tree is:
> > llvm-3.4.2.src/lib/Transforms/Hello
> >
> > 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
> >
> > LLVMHello.so 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.so -hello < hello.bc >
> /dev/null
> >
> > (and verify will be invoked by default).
> >
> > ~t
> >
> >
> >
> >
> >
> > On Tue, Aug 12, 2014 at 1:02 AM, Eric Christopher <echristo at gmail.com>
> wrote:
> > That doesn't tell me where your module came from. How did you create
> > the module that you're attempting to verify?
> >
> > -eric
> >
> > On Tue, Aug 12, 2014 at 1:00 AM, Tianyin Xu <tixu at cs.ucsd.edu> wrote:
> > > I just follow the tutorial:
> http://llvm.org/docs/WritingAnLLVMPass.html
> > >
> > > Actually it's not only my module, I used the LLVMHello.so (a sample
> module
> > > in the source tree) and get the crash (I didn't do anything :-P).
> > >
> > > ~t
> > >
> > >
> > > On Tue, Aug 12, 2014 at 12:57 AM, Eric Christopher <echristo at gmail.com
> >
> > > wrote:
> > >>
> > >> Weird, it definitely shouldn't be crashing. How did you create your
> > >> module?
> > >>
> > >> -eric
> > >>
> > >> On Tue, Aug 12, 2014 at 12:56 AM, Tianyin Xu <tixu at cs.ucsd.edu>
> wrote:
> > >> > no... I guess verifier runs by default and it points to the
> > >> > doFinailization() function :-(
> > >> >
> > >> > ~t
> > >> >
> > >> >
> > >> > On Tue, Aug 12, 2014 at 12:53 AM, Eric Christopher <
> echristo at gmail.com>
> > >> > wrote:
> > >> >>
> > >> >> No idea, I was suggesting to just run the verifier to see if it
> would
> > >> >> pinpoint what's broken about the module.
> > >> >>
> > >> >> -eric
> > >> >>
> > >> >> On Tue, Aug 12, 2014 at 12:52 AM, Tianyin Xu <tixu at cs.ucsd.edu>
> wrote:
> > >> >> > Oh, you mean opt -disable-verify?
> > >> >> >
> > >> >> > Yes, it does eliminate the crashing...
> > >> >> >
> > >> >> > Do you know what's the problem, Eric?
> > >> >> >
> > >> >> > Thanks a lot!
> > >> >> > ~t
> > >> >> >
> > >> >> >
> > >> >> > On Tue, Aug 12, 2014 at 12:42 AM, Eric Christopher
> > >> >> > <echristo at gmail.com>
> > >> >> > wrote:
> > >> >> >>
> > >> >> >> Tried opt -verify on your module?
> > >> >> >>
> > >> >> >> -eric
> > >> >> >>
> > >> >> >> On Tue, Aug 12, 2014 at 12:28 AM, Tianyin Xu <tixu at cs.ucsd.edu>
> > >> >> >> wrote:
> > >> >> >> > Hi all,
> > >> >> >> >
> > >> >> >> > I find all my passes are all broken with LLVM 3.4. Then I
> tried
> > >> >> >> > out
> > >> >> >> > the
> > >> >> >> > LLVMHello.so specified in the LLVM doc,
> > >> >> >> > http://llvm.org/docs/WritingAnLLVMPass.html
> > >> >> >> > 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?
> > >> >> >> >
> > >> >> >> > Thanks!
> > >> >> >> > Tianyin
> > >> >> >> >
> > >> >> >> >
> > >> >> >> >
> > >> >> >> >
> > >> >> >> >
> -----------------------------------------------------------------------------------------------------------------
> > >> >> >> >
> > >> >> >> > #opt -load ../../../Debug+Asserts/lib/LLVMHello.so -hello
> > >> >> >> > -time-passes <
> > >> >> >> > bcfiles/hello.bc
> > >> >> >> > ...
> > >> >> >> > (PRINT ALL THE FUNCTIONS, EVERYTHING IS FINE.)
> > >> >> >> > ...
> > >> >> >> > wrong initalizer for intrinsic global variable
> > >> >> >> > [0 x i8*] zeroinitializer
> > >> >> >> > Broken module found, compilation aborted!
> > >> >> >> > 0  opt             0x00000000019ac447
> > >> >> >> > llvm::sys::PrintStackTrace(_IO_FILE*)
> > >> >> >> > + 38
> > >> >> >> > 1  opt             0x00000000019ac6ce
> > >> >> >> > 2  opt             0x00000000019ac112
> > >> >> >> > 3  libpthread.so.0 0x00007feee0c77cb0
> > >> >> >> > 4  libc.so.6       0x00007feedfca2425 gsignal + 53
> > >> >> >> > 5  libc.so.6       0x00007feedfca5b8b abort + 379
> > >> >> >> > 6  opt             0x0000000001953173
> > >> >> >> > 7  opt             0x0000000001953097
> > >> >> >> > 8  opt             0x0000000001928676
> > >> >> >> > llvm::FPPassManager::doFinalization(llvm::Module&) + 88
> > >> >> >> > 9  opt             0x0000000001928a8a
> > >> >> >> > 10 opt             0x0000000001928ef0
> > >> >> >> > llvm::legacy::PassManagerImpl::run(llvm::Module&) + 254
> > >> >> >> > 11 opt             0x0000000001929103
> > >> >> >> > llvm::legacy::PassManager::run(llvm::Module&) + 39
> > >> >> >> > 12 opt             0x00000000008f88cd main + 5778
> > >> >> >> > 13 libc.so.6       0x00007feedfc8d76d __libc_start_main + 237
> > >> >> >> > 14 opt             0x00000000008ea589
> > >> >> >> > Stack dump:
> > >> >> >> > 0. Program arguments: opt -load
> > >> >> >> > ../../../Debug+Asserts/lib/LLVMHello.so
> > >> >> >> > -hello -time-passes
> > >> >> >> > Aborted (core dumped)
> > >> >> >> >
> > >> >> >> > --
> > >> >> >> > Tianyin XU,
> > >> >> >> > http://cseweb.ucsd.edu/~tixu/
> > >> >> >> >
> > >> >> >> > _______________________________________________
> > >> >> >> > LLVM Developers mailing list
> > >> >> >> > LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> > >> >> >> > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
> > >> >> >> >
> > >> >> >
> > >> >> >
> > >> >> >
> > >> >> >
> > >> >> > --
> > >> >> > Tianyin XU,
> > >> >> > http://cseweb.ucsd.edu/~tixu/
> > >> >
> > >> >
> > >> >
> > >> >
> > >> > --
> > >> > Tianyin XU,
> > >> > http://cseweb.ucsd.edu/~tixu/
> > >
> > >
> > >
> > >
> > > --
> > > Tianyin XU,
> > > http://cseweb.ucsd.edu/~tixu/
> >
> >
> >
> > --
> > Tianyin XU,
> > http://cseweb.ucsd.edu/~tixu/
> > _______________________________________________
> > LLVM Developers mailing list
> > LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>


-- 
Tianyin XU,
http://cseweb.ucsd.edu/~tixu/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140812/33094327/attachment.html>


More information about the llvm-dev mailing list