hi, 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] all is fine, if I just use intrinsified functions like printf and friends, but I want to use the clock_gettime function and now the lli dumps. thanks for any pointers. -- jakob [1] gccld -o test-llvm -L/mnt/fire300/jp/llvm-14/lib/gcc/i686-pc-linux-gnu/3.4-llvm -L/mnt/fire300/jp/llvm-14/lib/gcc/i686-pc-linux-gnu/3.4-llvm/../../.. /tmp/ccc7ax7O.o -lc -lcrtend gccld: warning: Cannot find library 'c' gccld: warning: Cannot find library 'crtend' gccld: warning: Cannot find library 'c' gccld: warning: Cannot find library 'crtend'
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? See http://llvm.cs.uiuc.edu/docs/CFEBuildInstrs.html#instructions 7. Go back into the LLVM source tree proper. Rerun configure, using the same options as the last time. This will cause the configuration to now find the newly built llvm-gcc and llvm-g++ executables. 8. Rebuild your CVS tree. This shouldn't cause the whole thing to be rebuilt, but it should build the runtime libraries. After the tree is built, install the runtime libraries into your GCC front-end build tree. These are the commands you need: % gmake % gmake -C runtime install-bytecode -- Misha Brukman :: http://misha.brukman.net :: http://llvm.cs.uiuc.edu
Jakob Praher wrote:> hi, > > 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]If you built your own llvm-gcc, then you need to build and install the bytecode libraries as Misha directed. However, if you downloaded a pre-built llvm-gcc frontend, then the bytecode libraries should already be pre-built for you. If that is the case, then chances are good that you need to set LLVM_LIB_SEARCH_PATH so that gccld can find the libraries. You can try setting the environment variable LLVM_LIB_SEARCH_PATH to <cfrontend>/bytecode-libs, where <cfrontend> is the general installation directory of llvm-gcc. For example, if I downloaded the binary llvm-gcc frontend for Linux and installed it in /home/john/cfrontend, then I would set LLVM_LIB_SEARCH_PATH to /home/john/cfrontend/x86/llvm-gcc/bytecode-libs. This step will not be required in future versions of LLVM, which is probably why you missed it. The docs on the web page are the current ones geared for the next release. If you go to http://llvm.cs.uiuc.edu/releases/1.4/docs/index.html, you will see the documentation pertaining to LLVM 1.4.> > all is fine, if I just use intrinsified functions like printf and > friends, but I want to use the clock_gettime function and now the lli > dumps. > > thanks for any pointers. > > > -- jakob > > [1] > gccld -o test-llvm > -L/mnt/fire300/jp/llvm-14/lib/gcc/i686-pc-linux-gnu/3.4-llvm > -L/mnt/fire300/jp/llvm-14/lib/gcc/i686-pc-linux-gnu/3.4-llvm/../../.. > /tmp/ccc7ax7O.o -lc -lcrtend > > gccld: warning: Cannot find library 'c' > gccld: warning: Cannot find library 'crtend' > gccld: warning: Cannot find library 'c' > gccld: warning: Cannot find library 'crtend' > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://mail.cs.uiuc.edu/mailman/listinfo/llvmdevRegards, -- John T. -- John T. Criswell Research Programmer University of Illinois at Urbana-Champaign "It's today!" said Piglet. "My favorite day," said Pooh.
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
Apparently Analagous Threads
- [LLVMdev] Re: question about gccld and external libraries
- [LLVMdev] question about gccld and external libraries
- [LLVMdev] Re: question about gccld and external libraries
- [LLVMdev] Can you hint on solution to following problem
- [LLVMdev] Re: question about gccld and external libraries