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 nd? 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, Chuck chucking at sjtu.org 2006-05-14
Chris Lattner
2006-May-14 20:33 UTC
[LLVMdev] Release 1.6 LLVM-Cfrontend build error on cygwin
On Sun, 14 May 2006, JinTao wrote:> Deeply confused now. Anyone coming for help?I don't really know anything about the cygwin port, but can you try LLVM 1.7? 1.6 is quite old by now... -Chris -- http://nondot.org/sabre/ http://llvm.org/
Chuck
2006-May-16 14:03 UTC
[LLVMdev] Re: Release 1.6 LLVM-Cfrontend build error on cygwin
Chris Lattner <sabre <at> nondot.org> writes:> > On Sun, 14 May 2006, JinTao wrote: > > Deeply confused now. Anyone coming for help? > > I don't really know anything about the cygwin port, but can you try LLVM > 1.7? 1.6 is quite old by now... > > -Chris >I tried 1.7 version llvm, but the result is even worse, I cannot build llvm now. ----------------------------------------------------------- make[2]: Entering directory `/cygdrive/d/Project/LLVM/llvm-1.7/build/tools/llc' llvm[2]: Compiling llc.cpp for Release build llvm[2]: Linking Release executable llc (without symbols) collect2: ld terminated with signal 11 [Segmentation fault], core dumped /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld: BFD 2.16.91 20050610 assertion fail /netrel/src/binutils-20050610-1/bfd/cofflink.c:1926 make[2]: *** [/cygdrive/d/Project/LLVM/llvm-1.7/build/Release/bin/llc.exe] Error 1 make[2]: Leaving directory `/cygdrive/d/Project/LLVM/llvm-1.7/build/tools/llc' make[1]: *** [llc/.makeall] Error 2 make[1]: Leaving directory `/cygdrive/d/Project/LLVM/llvm-1.7/build/tools' make: *** [all] Error 1 ----------------------------------------------- I shall skip llc and have another try. Cygwin build is so slow on my machine. Also, I tried building LLVM on redhat 9, but have problem even running configure. So I want to know your working setting there.
Anton Korobeynikov
2006-May-16 17:39 UTC
[LLVMdev] Re: Release 1.6 LLVM-Cfrontend build error on cygwin
Hello, Chuck. You wrote Tuesday, May 16, 2006, 6:03:14 PM: C> /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld: BFD C> 2.16.91 C> 20050610 assertion fail C> /netrel/src/binutils-20050610-1/bfd/cofflink.c:1926 C> make[2]: *** This is a bug in binutils also seen in mingw32 build. :( I've sent bug report to binutils bugzilla this weekend. Hope, this will be fixed sometimes. As for me, CVS checkout of 8 of May was compiled without any problems (latest CVS snapshot triggers an assertion). -- With best regards, Anton mailto:asl at math.spbu.ru Tuesday, May 16, 2006 9:37:34 PM Faculty of Mathematics & Mechanics, Saint-Petersburg State University
Anton Korobeynikov
2006-May-16 18:47 UTC
[LLVMdev] Re: Release 1.6 LLVM-Cfrontend build error on cygwin
Hello, Chuck. You wrote Tuesday, May 16, 2006, 6:03:14 PM: C> /netrel/src/binutils-20050610-1/bfd/cofflink.c:1926 C> make[2]: *** I've tracked this assertion some more deep. The problem is in LLVMSelectionDAG.o file. If I run the next lines, I've got and assertion: ld -r -o LLVMSelectionDAG.o ScheduleDAGList.o ScheduleDAGRRList.o ld -o llc LLVMSelectionDAG.o If I remove one of the SheduleDAG* files from the full list of objects, LLVMSelectionDAG.o is built from, the assertion is not longer triggered. Any ideas, why? I think, there is duplicate symbols somewhere, but I'm not sure. -- With best regards, Anton mailto:asl at math.spbu.ru Tuesday, May 16, 2006 10:43:52 PM Faculty of Mathematics & Mechanics, Saint-Petersburg State University
Reid Spencer
2006-May-16 19:13 UTC
[LLVMdev] Re: Release 1.6 LLVM-Cfrontend build error on cygwin
What does the assertion say? On Tue, 2006-05-16 at 22:47 +0400, Anton Korobeynikov wrote:> Hello, Chuck. > > You wrote Tuesday, May 16, 2006, 6:03:14 PM: > > C> /netrel/src/binutils-20050610-1/bfd/cofflink.c:1926 > C> make[2]: *** > I've tracked this assertion some more deep. The problem is in > LLVMSelectionDAG.o file. > > If I run the next lines, I've got and assertion: > ld -r -o LLVMSelectionDAG.o ScheduleDAGList.o ScheduleDAGRRList.o > ld -o llc LLVMSelectionDAG.o > > If I remove one of the SheduleDAG* files from the full list of objects, > LLVMSelectionDAG.o is built from, the assertion is not longer > triggered. > > Any ideas, why? I think, there is duplicate symbols somewhere, but I'm > not sure. >-------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20060516/90340531/attachment.sig>
Anton Korobeynikov
2006-May-16 19:26 UTC
[LLVMdev] Re: Release 1.6 LLVM-Cfrontend build error on cygwin
Hello, Reid. You wrote Tuesday, May 16, 2006, 11:13:19 PM: RS> What does the assertion say? The same text, as in the original e-mail: <=cut=> /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld: BFD 2.16.91 20050610 assertion fail /netrel/src/binutils-20050610-1/bfd/cofflink.c:1926 <=cut=> This assertions is in big function named: bfd_boolean _bfd_coff_link_input_bfd (struct coff_final_link_info *finfo, bfd *input_bfd) The text around assertion: h = NULL; if (*indexp < 0) { h = *sym_hash; /* The m68k-motorola-sysv assembler will sometimes generate two symbols with the same name, but only one will have aux entries. */ BFD_ASSERT (isymp->n_numaux == 0 || h->numaux == isymp->n_numaux); } -- With best regards, Anton mailto:asl at math.spbu.ru Tuesday, May 16, 2006 11:23:43 PM Faculty of Mathematics & Mechanics, Saint-Petersburg State University
Anton Korobeynikov
2006-May-18 15:25 UTC
[LLVMdev] Re: Release 1.6 LLVM-Cfrontend build error on cygwin
Hello, Chuck. You wrote Tuesday, May 16, 2006, 6:03:14 PM: C> I shall skip llc and have another try. The cheap workaround is to use .a files instead of relinked .o. If you want, I can send patch. -- With best regards, Anton mailto:asl at math.spbu.ru Thursday, May 18, 2006 7:22:54 PM Faculty of Mathematics & Mechanics, Saint-Petersburg State University
Possibly Parallel Threads
- [LLVMdev] Release 1.6 LLVM-Cfrontend build error on cygwin
- [LLVMdev] Re: Release 1.6 LLVM-Cfrontend build error on cygwin
- [LLVMdev] Re: Release 1.6 LLVM-Cfrontend build error on cygwin
- [LLVMdev] Re: Release 1.6 LLVM-Cfrontend build error on cygwin
- [LLVMdev] Building llvm and cfrontend under cygwin