[LLVMdev] No crt2.o file found

Matthew Bromberg mattcbro at earthlink.net
Sat Dec 16 15:38:56 PST 2006


I managed to get the llvm tool chain compiled on my windows machine 
using mingw a couple of weeks ago. 
When I tried to run the simple test case provided in the documentation I 
ran into a problem of missing object files.

I attempted to compile the simple hello.c hello world application.  
Unfortunately I get the following

$ llvm-gcc hello.c -o hello.exe
ld: crt2.o: No such file: No such file or directory


After copying the contents of llvm/Release/bin to llvm/bin I then tried,
$ llvm-gcc -O3 -emit-llvm hello.c -c -o hello.bc


but then after running



$ lli hello.bc

I got.


ERROR: Program used external function '_alloca' which could not be resolved!

This application has requested the Runtime to terminate it in an unusual 
way.
Please contact the application's support team for more information.

Something must be wrong with my installation.  For one, I note that 
there is no crt2.o anywhere in the llvm directory, although such object 
files do exist in the mingw installation I used to compile the llvm 
tools.  I do not know why lli does not work and why it can't find alloca.




More information about the llvm-dev mailing list