[lfs-support] Cross compiler for powerpc (LFS 7.1)

Ken Moffat zarniwhoop at ntlworld.com
Wed Mar 28 09:31:15 PDT 2012

On Wed, Mar 28, 2012 at 04:59:57PM +0530, Ratnaraj Mirgal wrote:
> Hi All,
> I'm trying to build a cross compiler for powerpc below are the version
> details,
> host=build=i686-pc-linux-gnu
> target=powerpc-home-linux-gnu
> binutils-2.22  gcc-4.6.2  glibc-2.14.1  gmp-5.0.4  linux-2.6.34  mpc-0.9
> mpfr-3.1.0
> (soft links created for gmp, mpc and mpfr in gcc)
 Cross-compiling is *hard*, and it's *not* what LFS is about.
Those of us who have built LFS on ppc in the past (generally, on
macs) always built on the hardware, from an existing linux system.

 What you appear to be trying to do is more like cross-lfs or

> 4. glibc configure,
> ../glibc-2.14.1/configure --build=i686-pc-linux-gnu
> --host=powerpc-home-linux-gnu --with-pkgversion=ratnaraj
> --prefix=/home/ratnaraj/cross/objdir/ppc_cross
> --with-sysroot=/home/ratnaraj/cross/objdir/ppc_cross/powerpc-home-linux-gnu/sysroot
> --disable-profile libc_cv_forced_unwind=yes libc_cv_c_cleanup=yes
> --enable-add-ons --enable-kernel=2.6.34
> /home/ratnaraj/cross/objdir/elf/ld.so -lgcc
> /home/ratnaraj/cross/objdir/libc_pic.os: In function `__GI___assert_fail':
> /home/ratnaraj/cross/glibc-2.14.1/assert/assert.c:105: undefined reference
> to `__GI___dcgettext'

 Maybe this is a problem specific to ppc (perhaps, specific to
these versions of the toolchain), or maybe it can't find the kernel
headers.  Actually, I *think* (at cross-lfs) we had to disable
gettext when doing real cross-compiles, but I don't remember which
configure switch does that.  Maybe --disable-nls ?

 The big problems with cross-compiling is that every architecture,
or sub-architecture, is different and from time to time some of them
will need unique fixes.  I can remember from when I was contributing
to cross-lfs that changes tested on one of the more common
architectures, or toolchain upgrades, often broke some of the
less-used architectures.

 If your ppc is a desktop machine (i.e. an old mac), building from
an existing linux system using steps based on LFS can probably be
made to work.  Alternatively, use cross-lfs (that way, you can build
the initial cross-compile system on i686, and then boot that to
build the final system.  If it is one of the newer embedded ppc
machines, try the clfs-embedded book.  In either case, ppc is now
very much a minority interest, so you will probably find that what
is in those books may need modification to work on your hardware.

das eine Mal als Tragödie, das andere Mal als Farce

More information about the lfs-support mailing list