Trouble building gcc-3.2.2/glibc-2.3.2 for cross powerpc-linux

Dan Kegel dank@kegel.com
Tue May 27 17:59:00 GMT 2003


Peter Barada wrote:
> I've been pounding my head on the glass tube trying to build
> gcc-3.2.2/glibc-2.3.2 for powerpc-linux on my x86 linux machine. ...
> unfortunatley I can't give it any headers until after glibc installs
> them, but glibc needs a cross compiler.  The classic catch-22....

Peter,
I just ran into the problem you describe.  I have been updating
Bill Gatliff's scripts to support newer toolchains.  Yesterday
I tried glibc-2.3.2 (had been using glibc-2.2.5).  To my horror,
it refused to configure without having a cross gcc.  Since you
have to configure and install-headers for glibc before you can
compile the cross gcc, this is indeed a catch-22.  I suspect we
can fool the configure by the following ruse:

     # glibc-2.3.x requires a cross-compiler even here, so shoot it in the head
     # FIXME need to file a bug report against glibc for this
     mkdir fake-cross
     ln -s `which gcc` fake-cross/${TARGET}-gcc
     PATH=`pwd`/fake-cross:$PATH \
         ${GLIBC_DIR}/configure --host=$TARGET --prefix=/usr \
         --enable-add-ons=linuxthreads --with-headers=${PREFIX}/${TARGET}/include

     PATH=`pwd`/fake-cross:$PATH \
         make cross-compiling=yes install_root=${PREFIX}/${TARGET} prefix="" install-headers

You only do this when building the headers, of course.  For
the real glibc build, you use the real cross-compiler.

I verified this gets us past configure, but haven't finished
a build yet.  Knock on wood.

When I realized what was going on, I did a google search for
"gcc catch-22", and sure enough, up popped your message!
Sorry for my unhelpful reply earlier.
- Dan

-- 
Dan Kegel
http://www.kegel.com
http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com



More information about the crossgcc mailing list