Preparing toolchain on a Pentium III Redhat 7.0

Alan Modra amodra at bigpond.net.au
Wed Apr 16 11:59:38 EST 2003


On Tue, Apr 15, 2003 at 03:15:15PM -0500, Guy M. Streeter wrote:
>  I'm fairly sure that the toolchain instructions on linucppc64.org are
> instructions for building the toolchain on a ppc system. I expect that a
> considerable amount of additional work would be necessary to create a
> cross-build ppc64 toolchain on an x86 system.

It's really no more difficult.  You're cross-compiling in both cases.
The thing that makes things difficult is that the instructions on
the web-site aren't exactly comprehensive enough..

>  Additionally, parts of the kernel build process depend on a native
> 32bit ppc compiler. If you want to build the kernel for ppc64 on an x86
> system, you will need to create a 32bit ppc cross-build toolchain, and
> modify parts of the kernel Makefiles to invoke it where the 32bit ppc
> compiler is expected.

True.

>  It will be far easier to build the ppc64 kernel on a ppc system.

I regularly build on x86, and once the toolchains are built there's no
difference.

> > On Tue, 2003-04-15 at 16:54, VAKKALANKA RAO Sridhar wrote:
> > > In the url http://penguinppc64.org/toolchain.shtml, the configuration parameters for "binutils" for the first pass state "--target=powerpc-linux". Should this not be "--target=powerpc64-linux" instead?

No, you're building ppc32 and ppc64 capable binutils.

> > > When I execute "config.guess" on the Pentium III Redhat 7.0, I receive the output "i686-pc-linux-gnu". So, when I set up the configuration parameters for the cross-build, should I replace every occurence of "powerpc-linux" (displayed in the url) to "i686-pc-linux-gnu" and at the same time keep every occurence of "powerpc64-linux" the same?

No.

> > > Is it possible to cross build the PPC64 kernel and toolchain even though the Pentium III is a 32 bit machine?

Yes.  On my x86 box, I use the following configure lines

/src/binutils-current/configure --prefix=/usr/local \
 --build=i586-linux --host=i586-linux --target=powerpc-linux \
 --enable-targets=powerpc64-linux --disable-nls

/src/gcc-ppc64-33/configure --prefix=/usr/local \
 --build=i686-linux --host=i686-linux --target=powerpc64-linux \
 --disable-nls --with-headers=/usr/local/powerpc64-linux/include \
 --enable-languages=c,c++,f77

/src/libc-current/configure --prefix=/usr/local/powerpc64-linux \
 --build=i686-linux --host=powerpc64-linux --target=powerpc64-linux \
 --with-headers=/src/linux-2.5.67-ppc/include --without-cvs --enable-add-ons \
 --enable-shared --disable-sanity-checks

These are suitable once you already have a toolchain installed.  It's
a little more difficult getting the very first toolchain built!  For
instance, the first gcc build needs to --disable-shared --disable-threads
--enable-languages=c and you don't have headers.  In fact, even with
these options, lack of headers will cause a failure in the build of
libgcc, but it's possible to hack around that by disabling the code
that needs the missing headers.  Or you can cheat and use headers
from some other arch (x86 even) given that the first gcc only needs to
be able to build the kernel and glibc.

--
Alan Modra
IBM OzLabs - Linux Technology Centre

** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc64-dev mailing list