[LLVMdev] problem with my LLVM pass

Peter Boström pbos at kth.se
Thu Oct 18 04:24:58 PDT 2012


On tor, 2012-10-18 at 18:11 +0800, Jun Koi wrote:
> On Thu, Oct 18, 2012 at 5:42 PM, Duncan Sands <baldrick at free.fr> wrote:
> > Hi Jun,
> >
> >
> >>> don't use cmake?
> >>>
> >>
> >> you mean i should not use cmake? what is wrong here?
> >
> >
> > LLVM cmake support is missing all kinds of features compared to
> > configure+make
> > (search for cmake bug reports in bugzilla to find these).  Your issue is
> > probably just another missing feature.  So if you don't want to hack on
> > cmake I
> > suggest you use configure+make if possible.
> >
> >
> >> cmake is still preferred as i want to compile my code with MS Visual
> >> Studio on Windows, too.
> >
> >
> > In order to make progress on your pass I suggest you use configure and make
> > for
> > the moment, and in parallel try to resolve the cmake problem yourself.
> 
> this is a smart idea, thanks!
> 
> so i moved the code to under llvm-3.1.src/lib/Transforms/, and use the
> Makefile from http://www.llvm.org/docs/WritingAnLLVMPass.html#makefile
> all the compilation went flawless without any problem.
> 
> then this requires me to put my code into the LLVM source tree, and i
> dont like this.
> i tried to move my code and my Makefile elsewhere, and compilation failed.
> so the questions are:
> 
> (1) how can i fix the Makefile, so i can compile my pass from anywhere?
> 
> (2) is it (pass compilation) possible without the LLVM source code?

I build a LLVM pass for my thesis to a .so file separately from the
tree, and run it using opt -load my_pass.so -my_pass file.bc

I don't claim that this is how it's supposed to be done, but it's
working for me, so it's at least possible. I'm still learning a lot
here. :)

https://github.com/pbos/spinn/blob/master/Makefile

The 'llvm-spinn.so' rule builds my pass, and an example of how the pass
is then used (opt -load) is under 'plug-test'.

- Peter

> thanks,
> Jun
> 
> >
> > Ciao, Duncan.
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev





More information about the llvm-dev mailing list