[LLVMdev] Getting started with LLVM Passes
Chris Lattner
sabre at nondot.org
Fri Jul 8 17:18:36 PDT 2005
On Fri, 8 Jul 2005, Sean Peisert wrote:
> I am attempting to get started with LLVM passes by running the Hello
> pass. On my FreeBSD 5.x box, I've written and compiled (with
> llvm-gcc) a Hello program, and also compiled the Hello pass in the
> lib/Transforms/Hello directory.
>
> I know that this results in a number of files, as follows:
>> ls -l LLVM/llvm/lib/Transforms/Hello/Debug/
> total 128
> -rw-r--r-- 1 sean staff 11004 Jul 8 16:25 Hello.d
> -rw-r--r-- 1 sean staff 358 Jul 8 16:25 Hello.lo
> -rw-r--r-- 1 sean staff 115984 Jul 8 16:25 Hello.o
>
> However, running the opt command results in the following error:
>
>> opt -load LLVM/llvm/lib/Transforms/Hello/Debug/Hello.lo < hello.bc > /dev/null
> Error opening 'LLVM/llvm/lib/Transforms/Hello/Debug/Hello.lo': Can't
> open :LLVM/llvm/lib/Transforms/Hello/Debug/Hello.lo: Cannot open
> "LLVM/llvm/lib/Transforms/Hello/Debug/Hello.lo.so"
> -load request ignored.
-load works with shared objects (.so files), not libtool objects. The
trick is that they get built into your llvm/Debug/lib/ directory. Try
something like this:
opt -load LLVM/llvm/Debug/lib/libhello.so ...
-Chris
--
http://nondot.org/sabre/
http://llvm.cs.uiuc.edu/
More information about the llvm-dev
mailing list