[LLVMdev] stdlib.h

Chris Lattner sabre at nondot.org
Mon Aug 21 10:30:35 PDT 2006


On Sun, 20 Aug 2006, Fernando Magno Quintao Pereira wrote:
> Thank you, Reid,
>    I tried llvm-gcc -lcrtend ary3.c -o ary3, but I get
> gccld: warning: Cannot find library 'crtend'
> gccld: warning: Cannot find library 'c'
>
> I have the libraries in my llvm directory:
> llvm/runtime/GCCLibraries/crtend
>
> Well, how do I link this to the LLVM runtime stuff? Before building from
> the source, I had copied all the .h from my old gcc 4.0 to
> llvm/cfrontend/and_so_forth... and I was able to compile .c all right. The
> problem was the .cpp.

You need to follow the directions here:
http://llvm.org/docs/CFEBuildInstrs.html#llvm-gcc3-instructions

In particular, you must run the install-bytecode target, as instructed.

-Chris

>> Try adding -lcrtend to the gcc link line. You need to link in the LLVM
>> runtime stuff.
>>
>> Reid.
>>
>>>     I've rebuild my llvm-gcc3 (not llvm-gcc4) from source, and now it can
>>> find stdlib.c and all the other sources, but I am having some other
>>> problems with the new libraries.
>>> 1) If I try: llvm-gcc source.c -o source; llc -f source.bc -o ch.s ;
>>>  gcc ch.s -o exec,
>>>     I end up getting this error from gcc:
>>> /usr/bin/ld: Undefined symbols:
>>> ___main
>>> collect2: ld returned 1 exit status
>>>     If I fix this, by replacing ___main by main manually, the program
>>> seg-faults.
>>>
>>> It used to work fine with the cfrontend that came together with llvm. Do
>>> you
>>> guys know what can be happening?
>>>
>>> 2) If I try: llvm-g++ source.cpp -o source ; source
>>> I get this error:
>>> ERROR: Program used external function '__llvm_eh_add_uncaught_exception'
>>> which could not be resolved!
>>> Abort
>>>
>>> Could some one help me fixing this? Do I have to use llvm-gcc4?
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/



More information about the llvm-dev mailing list