[LLVMdev] Release 1.6 LLVM-Cfrontend build error on cygwin

JinTao chucking at sjtu.org
Sun May 14 06:19:41 PDT 2006

Dear llvmdev,
     I am new to LLVM , but have a task on writing a LLVM backend to generate some architecture specific assembly file.
	 Here is my cygwin build setting: GCC 3.4.4 , BIN UTILITY 2.15 ,and all other packages of the right version listed on the LLVM Getting Started doc.
	 I have successfully built Release 1.6 LLVM. All the tools has been installed there /usr/local/bin . 
	 But I have problem with building LLVM-Cfrontend that comes with this Release.
	 CFrontend build stopped after these lines
gcc   -O2 -DIN_GCC  -DDEFAULT_TARGET_MACHINE=\"i686-pc-cygwin\"  -W -Wall -Wwrit
e-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -fno
-common   -DHAVE_CONFIG_H -DGENERATOR_FILE  -o genattrtab.exe \
 genattrtab.o genautomata.o \
 rtl.o read-rtl.o bitmap.o ggc-none.o gensupport.o insn-conditions.o print-rtl1.
o errors.o \
 varray.o ../libiberty/libiberty.a -lm
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../libm.a: could not read symbols: Archi
ve has no index; run ranlib to add one
collect2: ld returned 1 exit status
make[1]: *** [genattrtab.exe] Error 1
make[1]: Leaving directory `/cygdrive/d/Project/LLVM/cfrontend/build/gcc'
make: *** [all-gcc] Error 2

	Any advice on that? I have done quite a lot of online search about LLVM build info  for several days, but no progress till now.   Blocked some what:-(

	Then I came up with another idea, can I work with the local built LLVM infrastructure and a prebuilt cfronte

	So I downloaded an experimental llvm-cfrontend cygwin binary (3.4-LLVM 20030924)as well as a prebuilt llvm binary. 

	But I cannot get a simple hello.c work with the combination of that cfrontend binary and my local built llvm infrastructure. I used "llvm-gcc -S hello.c; llvm-as hello.s; lli hello.s.bc;"
, but failed with    
	"ERROR: Program used external function 'printf' which could not be resolved!   Aborted"

	But isn't any call to standard library  resolved in runtime by the local VM,lli? 

	Strange thing is when I try that with the combination of the  prebuilt experimental cfrontend  and the prebuilt experimental llvm which was found in the same place as the cfrontend binary, the hello.c can run this time although with the warning info 

"WARNING: Program called __main but was not linked to libcrtend.a.
This probably won't hurt anything unless the program is written in C++.
hello world"

	Deeply confused now. Anyone coming for help?

Best Regards,


        chucking at sjtu.org

More information about the llvm-dev mailing list