.so file creation for new passes

Hello,

I was going through the LLVM docs “writing an LLVM Pass”. Can someone tell me how to create the Hello.so file as it is said in the document. It talks about compiling the Hello pass using gmake. I am a Windows user (windows 7, cmake, visual studio 9 2008). I cant use cmake here as this hello pass has links to the llvm’s solution file, I mean It uses some of the header files from llvm’s solution file. Do I need to modify the program or the CMakeLists.txt file.?
And where can I find this loadable Hello.so file ?

Thanks a lot.

Hi !

The Hello world pass sources are in llvm/lib/Transform/Hello/*

If you compile llvm, the Hello library will be compiled too. It’s not installed but it’s in build_directory/Debug/lib/LLVMHello.so (or in build_directory/Release/lib/LLVMHello.so)

Olivier.

hi,

Hi !

The Hello world pass sources are in llvm/lib/Transform/Hello/*

If you compile llvm, the Hello library will be compiled too. It’s not installed but it’s in build_directory/Debug/lib/LLVMHello.so (or in build_directory/Release/lib/LLVMHello.so)

Olivier.

Hello,

I was going through the LLVM docs “writing an LLVM Pass”. Can someone tell me how to create the Hello.so file as it is said in the document. It talks about compiling the Hello pass using gmake. I am a Windows user

(windows 7, cmake, visual studio 9 2008).

loadable module is not supported in windows, so the project for “Hello” will not be create and you can not run it as “http://llvm.org/docs/WritingAnLLVMPass.html#quickstart” describe.

If you compile llvm, the Hello library will be compiled too. It's not
installed but it's in build_directory/Debug/lib/LLVMHello.so (or in
build_directory/Release/lib/LLVMHello.so)

Loadable passes are not supported on windows due to lack of OS dynamic
linking support (and I doubt they will be supported ever).

Thanks a lot for the reply guys. So, does that mean that I cant write my own passes if I work on Windows side of the LLVM? Is there any other way to use a new pass. How are windows users supposed to work?

Thanks again.

It is pretty easy to link in a project pass into opt. You will need
to replicate LinkAllPasses for your pass and fiddle with makefile for
opt. See below for an example of most of the work you would need to
do. Note that this only matters if you want to work in a project for
your new pass rather than just working in the tree.

Andrew

Index: ../../tools/bugpoint/bugpoint.cpp