[LLVMdev] OK, how does this work?

Michael T. Richter ttmrichter at gmail.com
Mon Jan 15 21:13:41 PST 2007


On Tue, 2007-16-01 at 02:50 +0000, Reid Spencer wrote:

> > The build instructions provided tell me to build llvm-gcc first from
> > the source.  
> > The source for that tells me to build llvm first from the source.  I'm
> > not sure where to go from this point.



> You should build llvm first, then llvm-gcc.


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.

Configure output (elided):

        config.status: creating Makefile.common
        config.status: executing setup commands
        config.status: executing Makefile commands
        config.status: executing lib/Makefile commands
        config.status: executing lib/sample/Makefile commands
        config.status: executing tools/Makefile commands
        config.status: executing tools/sample/Makefile commands
        configure: WARNING: ***** llvm-gcc/llvm-g++ was not found, or
        does not appear to be
        configure: WARNING: ***** working. Please make sure you have
        llvm-gcc and llvm-g++ in
        configure: WARNING: ***** your path before configuring LLVM. The
        runtime libraries
        configure: WARNING: ***** (llvm/runtime) will not be built but
        you should be able to
        configure: WARNING: ***** build the llvm tools.


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:


        /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
        /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
        /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)
        make[2]: *** [libgcc/static/_muldi3.o] Error 1
        make[2]: Leaving directory `/home/michael/Development/obj/gcc'
        make[1]: *** [libgcc.a] Error 2
        make[1]: Leaving directory `/home/michael/Development/obj/gcc'
        make: *** [all-gcc] Error 2
        

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.)


> > What's the next step?  How do I actually do a bootstrap?



> There are two versions of llvm-gcc, v3 and v4, for the 1.9 release.
> We're dropping support for llvm-gcc3 in 2.0 so I urge you to use
> llvm-gcc4. However, llvm-gcc4 doesn't yet support C++ exception handling
> so you may need llvm-gcc3.  In all other respects, llvm-gcc4 is the
> superior product.


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
++.


> For llvm-gcc4, the basic flow is:
>    1. Build llvm
>    2. Build llvm-gcc



This is the one I was trying with the results you can see above when
building LLVM without an llvm-gcc.


> This should be covered in the GettingStarted.html document:
>    http://llvm.org/docs/GettingStarted.html


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.

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!  ;)  For my next
number I will prove that P=NP and destroy the whole field of public key
cryptography!  :D

-- 
Michael T. Richter
Email: ttmrichter at gmail.com, mtr1966 at hotpop.com
MSN: ttmrichter at hotmail.com, mtr1966 at hotmail.com; YIM:
michael_richter_1966; AIM: YanJiahua1966; ICQ: 241960658; Jabber:
mtr1966 at jabber.cn

"I would not flinch from sacrificing a million lives for India's
liberty!" --Mahatma Gandhi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20070116/ff8ecc7d/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smiley-1.png
Type: image/png
Size: 798 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20070116/ff8ecc7d/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smiley-4.png
Type: image/png
Size: 822 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20070116/ff8ecc7d/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20070116/ff8ecc7d/attachment.sig>


More information about the llvm-dev mailing list