PPC->i386 cross-gcc

Jeff Elkins jeffelkins@earthlink.net
Wed Mar 12 09:22:00 GMT 2003

OK, I've gotten not much feedback, whch is depressing, but I'll try again.

My goal: build a cross-gcc for ppc->i386

The steps below work fine on a i386 box, but fail when I try to duplicate
them on a ppc iMac.

# configure/build binutils

cd binutils-

./configure --prefix=/home/jeff/crosscomp --target=i386-linux

make install

mkdir /home/crosscomp/include
cd /home/crosscomp/include
cp -ai /usr/include/* .
rm -rf asm
rm -rf linux
cp -ai /usr/src/linux/include/i386-asm asm
cp -ai /usr/src/linux/include/linux .

# configure/build bootstrap gcc

export TPATH=$PATH
export PATH=/home/jeff/crosscomp/bin:$PATH
cd gcc-3.2.2

./configure --prefix=/home/jeff/crosscomp \
--host=powerpc-linux --target=i386-linux \
--with-headers=/home/jeff/crosscomp/include \
--disable-shared --disable-nls --enable-languages=c

make install
export PATH=$TPATH

export AR=/home/jeff/crosscomp/i386-linux/bin/ar
export CC=/home/jeff/crosscomp/i386-linux/bin/gcc
export RANLIB=/home/jeff/crosscomp/i386-linux/bin/ranlib

#configure/build glibc

mkdir /home/jeff/build-glibc
cd /home/jeff/build-glibc

/home/jeff/glibc-2.3.1/configure --prefix=/home/jeff/crosscomp \
--host=i386-linux --build=powerpc-linux --enable-add-ons \
--with-headers=/home/jeff/crosscomp/include \
--with-libs=/home/jeff/crosscomp/lib --enable-shared --disable-nls \

make install

export AR=
export CC=
export RANLIB=

# configure/build full gcc

export PATH=/home/jeff/crosscomp/bin:$PATH
sudo rm -rf gcc-3.2.2
tar xvfz crosssrc/gcc-3.2.2.tar.gz
cd gcc-3.2.2

./configure  --host=powerpc-linux \
--build=powerpc-linux  --target=i386-linux \
--prefix=/home/jeff/crosscomp \
--with-headers=/home/jeff/crosscomp/include \
--with-libs=/home/jeff/crosscomp/lib --enable-shared --disable-nls \
--enable-add-ons --enable-threads=posix --enable-languages=c,c++

make install

This final step (which works on a i386 box) fails on the ppc

> ==============
> In file included from /home/jeff/i386/include/math.h:362,
>  from /home/jeff/gcc-3.2.2/i386-linux/libstdc++-v3/include/cmath:51,
> from
> 1, from /home/jeff/gcc-3.2.2/i386-linux/libstdc++-v3/include/locale:46,
> from
>  /home/jeff/gcc-3.2.2/i386-linux/libstdc++-v3/include/bits/ostream.tcc:37,
>  from /home/jeff/gcc-3.2.2/i386-linux/libstdc++-v3/include/ostream:275,
>  from /home/jeff/gcc-3.2.2/i386-linux/libstdc++-v3/include/bitset:58, from
>  bitset.cc:43:
> /home/jeff/i386/include/bits/mathinline.h: In function `double
>  log1p(double)': /home/jeff/i386/include/bits/mathinline.h:539: `logl'
>  undeclared (first use this function)
> /home/jeff/i386/include/bits/mathinline.h:539: (Each undeclared identifier
> is
>    reported only once for each function it appears in.)
> make[3]: *** [bitset.lo] Error 1
> make[2]: *** [all-recursive] Error 1
> make[1]: *** [all-recursive-am] Error 2
> make: *** [all-target-libstdc++-v3] Error 2

More information about the Gcc-help mailing list