hi, all
I have some questions about LLVM
1. I recently compiled LLVM on my X86 machine correctly. But when I use
the built LLVm compiling programs(in the getting started guide), I got
an warning saying can not find library "lc" (something like that). Yet
LLVM did yeild a execution native code and it runs correctly except with
a waring saying something like "__main**"(I cann't remember very clearly).
I followed all the install instructions except the installation dir for
llvm is /home/my/llvm/llvm-bin/ and llvmgcc dir is
/home/my/llvm/llvm/llvm-gcc and the configure option is
--prefix=/home/my/llvm/llvm-bin/ --enable-jit
--llvmgccdir=/home/my/llvm/llvm/llvm-gcc
btw: there was an error when installing LLVM, the system complained "no
pax command...". What pax is?
2. I want to do some work on register allocation using LLVM, which parts
of code should I read? ( The whole source is too big for me)
thans.
--zhoufeng
You should check out llvm/lib/CodeGen and particularly the LiveVariables and
RegAlloc* files.
I have some questions about LLVM
1. I recently compiled LLVM on my X86 machine correctly. But when I use
the built LLVm compiling programs(in the getting started guide), I got
an warning saying can not find library "lc" (something like that). Yet
LLVM did yeild a execution native code and it runs correctly except with
a waring saying something like "__main**"(I cann't remember very clearly).
I followed all the install instructions except the installation dir for
llvm is /home/my/llvm/llvm-bin/ and llvmgcc dir is
/home/my/llvm/llvm/llvm-gcc and the configure option is
--prefix=/home/my/llvm/llvm-bin/ --enable-jit
--llvmgccdir=/home/my/llvm/llvm/llvm-gcc
Make sure you set your LLVM_LIB_SEARCH_PATH envvar, as specified in the
getting started guide:
http://llvm.cs.uiuc.edu/docs/GettingStarted.html#environment
btw: there was an error when installing LLVM, the system complained "no
pax command...". What pax is?
I have no idea.
2. I want to do some work on register allocation using LLVM, which parts
of code should I read? ( The whole source is too big for me)
As Alkis mentioned, the code in lib/CodeGen/* is the most relevant.
-Chris
At least on Mac OS X, pax is a packaging utility, that reads and
writes a bunch of formats including tar. I think it's used for Apple's
installer packages. Not sure why it'd be mentioned in an LLVM build
though. I've certainly never noticed it there.
What platform are you using?
-mike
Chris Lattner wrote:
Yes, I checked that envvar, and it is set.
The error msg when compiling a .c file is:
gccld: WARNING: Cannot find library -lc
gccld: WARNING: Cannot find library -lcrtend
Can LLVM be installed using a prefix?
–zhoufeng
Chris Lattner wrote:
A recent patch to the makefile system (you'll need to work from the latest CVS
files) allows LLVM to be correctly installed (and uninstalled) to the directory
named by the --prefix=<dir> argument of the configure script (/usr/local by
default).
The error message you're setting is occurring because gccld can't find the
"libc.gc and libcrtend.a" bytecode libraries. Those libraries are installed by
"make -C runtime install" which uses the value you passed to the (note the
name!) --with-llvmgccdir argument to configure. The same value should be given
to your LLVM_LIB_SEARCH_PATH. I'm not sure if its a typo or not, but if the
configure options you gave below are pasted from the actual usage then you have
a command line error there. The "--llvmgccdir=..." should be
"--with-llvmgccdir=...". Probably if you correct that, you'll end up with
bytecode libraries installed in the right place.
Reid.
zhou feng wrote:
Yes, I checked that envvar, and it is set.
The error msg when compiling a .c file is:
gccld: WARNING: Cannot find library -lc
gccld: WARNING: Cannot find library -lcrtend
Can LLVM be installed using a prefix?
Yes, LLVM can. Those errors are being emitted because it can't find those
libraries, which are part of the C front-end. This implies that either
the envvar is set wrong or that you got a C front-end without the runtime
libraries. If the envvar is set correctly, you should be able to do:
ls $LLVM_LIB_SEARCH_PATH/libcrtend.a
and see a file.
-Chris