Jakob Praher
2005-Mar-01 17:21 UTC
[LLVMdev] Re: question about gccld and external libraries
Misha Brukman wrote:> Hey, Jakob -- > > On Tue, Mar 01, 2005 at 05:55:07PM +0100, Jakob Praher wrote: > >>I'm really new to llvm. I've successfully bootstrapped llvm-14 on my >>system and am able to successfully compile c code to llvm. >> >>the problem is now that gccld is complaining that it can't find the >>libraries, like "c" or "crtend". [1] > > > Did you install the bytecode libraries into the C/C++ frontend lib > directory? >thanks for the pointer. Yes I've done that, but in the new shell session I apparently forgot to set the LLVM_LIB_SEARCH_PATH. now gccld isn't complaining anymore but the interpreter doesn't seem to like it still: ERROR: Program used external function 'clock_gettime' which could not be resolved! lli((anonymous namespace)::PrintStackTrace()+0x1a)[0x862a53e] lli((anonymous namespace)::SignalHandler(int)+0xd3)[0x862a807] [0xffffe420] lli(llvm::JIT::getPointerToFunction(llvm::Function*)+0x199)[0x837e863] lli((anonymous namespace)::JITEmitter::getPointerToGlobal(llvm::GlobalValue*, void*, bool)+0xdb)[0x8380287] lli((anonymous namespace)::JITEmitter::finishFunction(llvm::MachineFunction&)+0x18f)[0x838048f] lli((anonymous namespace)::Emitter::runOnMachineFunction(llvm::MachineFunction&)+0x102)[0x840d448] ... -- Jakob
Chris Lattner
2005-Mar-01 17:34 UTC
[LLVMdev] Re: question about gccld and external libraries
On Tue, 1 Mar 2005, Jakob Praher wrote:> thanks for the pointer. Yes I've done that, but in the new shell session I > apparently forgot to set the LLVM_LIB_SEARCH_PATH. > > now gccld isn't complaining anymore but the interpreter doesn't seem to like > it still:It looks like the jit doesn't find these because they are located in librt. Try this (or adapt to whatever system you're using): lli -load /usr/lib/librt.so yourprog.bc If you pass '-lrt' when linking your program, it should take care of this for you. -Chris -- http://nondot.org/sabre/ http://llvm.cs.uiuc.edu/
Jakob Praher
2005-Mar-01 17:45 UTC
[LLVMdev] Re: question about gccld and external libraries
Chris Lattner wrote:> On Tue, 1 Mar 2005, Jakob Praher wrote: > >> thanks for the pointer. Yes I've done that, but in the new shell >> session I apparently forgot to set the LLVM_LIB_SEARCH_PATH. >> >> now gccld isn't complaining anymore but the interpreter doesn't seem >> to like it still: > > > It looks like the jit doesn't find these because they are located in > librt. Try this (or adapt to whatever system you're using): > > lli -load /usr/lib/librt.so yourprog.bcoh. thanks that worked.> > If you pass '-lrt' when linking your program, it should take care of > this for you. >ah ok. so every library thet gccld can't find as a bytecode lib is added to the shell script then. -- Jakob
Maybe Matching Threads
- [LLVMdev] Re: question about gccld and external libraries
- [LLVMdev] Re: question about gccld and external libraries
- [LLVMdev] question about gccld and external libraries
- [LLVMdev] question about gccld and external libraries
- [LLVMdev] Re: question about gccld and external libraries