<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.10.3">
</HEAD>
<BODY>
On Tue, 2007-16-01 at 02:50 +0000, Reid Spencer wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">> The build instructions provided tell me to build llvm-gcc first from</FONT>
<FONT COLOR="#000000">> the source.  </FONT>
<FONT COLOR="#000000">> The source for that tells me to build llvm first from the source.  I'm</FONT>
<FONT COLOR="#000000">> not sure where to go from this point.</FONT>
</PRE>
</BLOCKQUOTE>
<PRE>

</PRE>
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">You should build llvm first, then llvm-gcc.</FONT>
</PRE>
</BLOCKQUOTE>
<BR>
When I build LLVM first, however, I get told that it can't find llvm-gcc and that it therefore won't build properly.  And, true to form, when I ignore the warning from ./configure and proceed anyway it chokes.<BR>
<BR>
Configure output (elided):<BR>
<BLOCKQUOTE>
    <TT>config.status: creating Makefile.common</TT><BR>
    <TT>config.status: executing setup commands</TT><BR>
    <TT>config.status: executing Makefile commands</TT><BR>
    <TT>config.status: executing lib/Makefile commands</TT><BR>
    <TT>config.status: executing lib/sample/Makefile commands</TT><BR>
    <TT>config.status: executing tools/Makefile commands</TT><BR>
    <TT>config.status: executing tools/sample/Makefile commands</TT><BR>
    <TT>configure: WARNING: ***** llvm-gcc/llvm-g++ was not found, or does not appear to be</TT><BR>
    <TT>configure: WARNING: ***** working. Please make sure you have llvm-gcc and llvm-g++ in</TT><BR>
    <TT>configure: WARNING: ***** your path before configuring LLVM. The runtime libraries</TT><BR>
    <TT>configure: WARNING: ***** (llvm/runtime) will not be built but you should be able to</TT><BR>
    <TT>configure: WARNING: ***** build the llvm tools.</TT><BR>
</BLOCKQUOTE>
<BR>
Despite the warning a make seems to work and a make install seems to put things into sane places.  So I run a configure, then a make in the gcc4 source directory.  It builds fine until I get this:<BR>
<BR>
<BLOCKQUOTE>
    <TT>/home/michael/Development/obj/gcc/xgcc -B/home/michael/Development/obj/gcc/ -B/usr/local/i686-pc-linux-gnu/bin/ -B/usr/local/i686-pc-linux-gnu/lib/ -isystem /usr/local/i686-pc-linux-gnu/include -isystem /usr/local/i686-pc-linux-gnu/sys-include -O2  -DIN_GCC    -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include  -fPIC -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED  -shared -nodefaultlibs -Wl,--soname=libgcc_s.so.1 -Wl,--version-script=libgcc/./libgcc.map -o ./libgcc_s.so.1.tmp  libgcc/./_muldi3_s.o libgcc/./_negdi2_s.o libgcc/./_lshrdi3_s.o libgcc/./_ashldi3_s.o libgcc/./_ashrdi3_s.o libgcc/./_cmpdi2_s.o libgcc/./_ucmpdi2_s.o libgcc/./_floatdidf_s.o libgcc/./_floatdisf_s.o libgcc/./_fixunsdfsi_s.o libgcc/./_fixunssfsi_s.o libgcc/./_fixunsdfdi_s.o libgcc/./_fixdfdi_s.o libgcc/./_fixunssfdi_s.o libgcc/./_fixsfdi_s.o libgcc/./_fixxfdi_s.o libgcc/./_fixunsxfdi_s.o libgcc/./_floatdixf_s.o libgcc/./_fixunsxfsi_s.o libgcc/./_fixtfdi_s.o libgcc/./_fixunstfdi_s.o libgcc/./_floatditf_s.o libgcc/./_clear_cache_s.o libgcc/./_enable_execute_stack_s.o libgcc/./_trampoline_s.o libgcc/./__main_s.o libgcc/./_absvsi2_s.o libgcc/./_absvdi2_s.o libgcc/./_addvsi3_s.o libgcc/./_addvdi3_s.o libgcc/./_subvsi3_s.o libgcc/./_subvdi3_s.o libgcc/./_mulvsi3_s.o libgcc/./_mulvdi3_s.o libgcc/./_negvsi2_s.o libgcc/./_negvdi2_s.o libgcc/./_ctors_s.o libgcc/./_ffssi2_s.o libgcc/./_ffsdi2_s.o libgcc/./_clz_s.o libgcc/./_clzsi2_s.o libgcc/./_clzdi2_s.o libgcc/./_ctzsi2_s.o libgcc/./_ctzdi2_s.o libgcc/./_popcount_tab_s.o libgcc/./_popcountsi2_s.o libgcc/./_popcountdi2_s.o libgcc/./_paritysi2_s.o libgcc/./_paritydi2_s.o libgcc/./_powisf2_s.o libgcc/./_powidf2_s.o libgcc/./_powixf2_s.o libgcc/./_powitf2_s.o libgcc/./_mulsc3_s.o libgcc/./_muldc3_s.o libgcc/./_mulxc3_s.o libgcc/./_multc3_s.o libgcc/./_divsc3_s.o libgcc/./_divdc3_s.o libgcc/./_divxc3_s.o libgcc/./_divtc3_s.o libgcc/./_divdi3_s.o libgcc/./_moddi3_s.o libgcc/./_udivdi3_s.o libgcc/./_umoddi3_s.o libgcc/./_udiv_w_sdiv_s.o libgcc/./_udivmoddi4_s.o libgcc/./unwind-dw2_s.o libgcc/./unwind-dw2-fde-glibc_s.o libgcc/./unwind-sjlj_s.o libgcc/./gthr-gnat_s.o libgcc/./unwind-c_s.o -lc && rm -f ./libgcc_s.so && if [ -f ./libgcc_s.so.1 ]; then mv -f ./libgcc_s.so.1 ./libgcc_s.so.1.backup; else true; fi && mv ./libgcc_s.so.1.tmp ./libgcc_s.so.1 && ln -s libgcc_s.so.1 ./libgcc_s.so</TT><BR>
    <TT>/home/michael/Development/obj/gcc/xgcc -B/home/michael/Development/obj/gcc/ -B/usr/local/i686-pc-linux-gnu/bin/ -B/usr/local/i686-pc-linux-gnu/lib/ -isystem /usr/local/i686-pc-linux-gnu/include -isystem /usr/local/i686-pc-linux-gnu/sys-include -O2  -DIN_GCC    -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include  -fPIC -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED  -I. -I. -I../../llvm-gcc4-1.9.source/gcc -I../../llvm-gcc4-1.9.source/gcc/. -I../../llvm-gcc4-1.9.source/gcc/../include -I../../llvm-gcc4-1.9.source/gcc/../libcpp/include  -I/home/michael/Development/llvm-1.9/include -I/home/michael/Development/llvm-1.9//include -static -fno-pic -DL_muldi3 -fvisibility=hidden -DHIDE_EXPORTS -c ../../llvm-gcc4-1.9.source/gcc/libgcc2.c -o libgcc/static/_muldi3.o</TT><BR>
    <TT>/home/michael/Development/obj/gcc/xgcc: /home/michael/Development/obj/gcc/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib/libstdc++.so.6)</TT><BR>
    <TT>make[2]: *** [libgcc/static/_muldi3.o] Error 1</TT><BR>
    <TT>make[2]: Leaving directory `/home/michael/Development/obj/gcc'</TT><BR>
    <TT>make[1]: *** [libgcc.a] Error 2</TT><BR>
    <TT>make[1]: Leaving directory `/home/michael/Development/obj/gcc'</TT><BR>
    <TT>make: *** [all-gcc] Error 2</TT><BR>
    <BR>
</BLOCKQUOTE>
This is where I'm stuck, now.  It's looking for some kind of library made by gcc's build that obviously failed somewhere earlier in the millions of lines of messages spewed out by GCC's build system.  Given the profusion of -I and such statements pointing into the llvm source code, I'm pretty sure it's something in the llvm build that's failed on me.  (Of course after poring over these millions of lines of code I could be missing something really obvious, so I'm not sure here at all.)<BR>
<BR>
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">> What's the next step?  How do I actually do a bootstrap?</FONT>
</PRE>
</BLOCKQUOTE>
<BR>
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">There are two versions of llvm-gcc, v3 and v4, for the 1.9 release.</FONT>
<FONT COLOR="#000000">We're dropping support for llvm-gcc3 in 2.0 so I urge you to use</FONT>
<FONT COLOR="#000000">llvm-gcc4. However, llvm-gcc4 doesn't yet support C++ exception handling</FONT>
<FONT COLOR="#000000">so you may need llvm-gcc3.  In all other respects, llvm-gcc4 is the</FONT>
<FONT COLOR="#000000">superior product.</FONT>
</PRE>
</BLOCKQUOTE>
<BR>
I'll be building both, but probably using 4 most often because most of what I'd be using it for is C code anyway.  I can wait for 2.0 to get C++.<BR>
<BR>
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">For llvm-gcc4, the basic flow is:</FONT>
<FONT COLOR="#000000">   1. Build llvm</FONT>
<FONT COLOR="#000000">   2. Build llvm-gcc</FONT>
</PRE>
</BLOCKQUOTE>
<PRE>

</PRE>
This is the one I was trying with the results you can see above when building LLVM without an llvm-gcc.<BR>
<BR>
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">This should be covered in the GettingStarted.html document:</FONT>
<FONT COLOR="#000000">   <A HREF="http://llvm.org/docs/GettingStarted.html">http://llvm.org/docs/GettingStarted.html</A></FONT>
</PRE>
</BLOCKQUOTE>
<BR>
This would be the source that has conflicting dependencies.  GettingStarted tells you you need an llvm-gcc to build llvm.  But the pointer to bootstrapping llvm-gcc says you need a functioning llvm.<BR>
<BR>
Man!  I'm only just figuring out how large my self-assigned project of making a GHC that uses LLVM as a back-end really is!  <IMG SRC="cid:1168919126.22303.15.camel@localhost.localdomain" ALIGN="middle" ALT=";)" BORDER="0">  For my next number I will prove that P=NP and destroy the whole field of public key cryptography!  <IMG SRC="cid:1168918766.22303.12.camel@localhost.localdomain" ALIGN="middle" ALT=":D" BORDER="0"><BR>
<BR>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
-- <BR>
<B>Michael T. Richter</B><BR>
<I><FONT SIZE="2">Email:</FONT></I><FONT SIZE="2"> ttmrichter@gmail.com, mtr1966@hotpop.com</FONT><BR>
<I><FONT SIZE="2">MSN:</FONT></I><FONT SIZE="2"> ttmrichter@hotmail.com, mtr1966@hotmail.com; </FONT><I><FONT SIZE="2">YIM:</FONT></I><FONT SIZE="2"> michael_richter_1966; </FONT><I><FONT SIZE="2">AIM:</FONT></I><FONT SIZE="2"> YanJiahua1966; </FONT><I><FONT SIZE="2">ICQ:</FONT></I><FONT SIZE="2"> 241960658; </FONT><I><FONT SIZE="2">Jabber:</FONT></I><FONT SIZE="2"> mtr1966@jabber.cn</FONT><BR>
<BR>
<I><FONT SIZE="1">"I would not flinch from sacrificing a million lives for India's liberty!"</FONT></I><FONT SIZE="1"> </FONT><B><FONT SIZE="1">--Mahatma Gandhi</FONT></B>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>