This is the mail archive of the mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: building a native toolchain using a cross-compiler

I have been starting to get somewhere with building native tools using my
cross-compiler, but I have run into some problems and haven't yet been able
to work out what I'm doing wrong.

So far I've cross-compiled binutils-2.14 and also have glibc2.2.1 installed
on my target (I did this whilst building my cross-compiler).  Make-3.80
hasn't been a problem either.

Whilst gcc-2.95.3 seems to compile without problems, the installation is
These are the commands I'm using:

mkdir build-gcc && cd build-gcc
../gcc-2.95.3/configure --host=powerpc-linux
--prefix=/home/test/datastorage-module/rootfs --enable-languages=c,c++ 2>&1
| tee configure-log

make all
make install

All seems to go well however when I try and compile a simple helloworld.c
program on my traget I get:
gcc: installation problem, cannot exec `cpp0': No such file or directory

Any help with this would be greatly appreciated.



-----Original Message-----
From: Dan Kegel
To: Fisher Alex
Cc: ''
Sent: 01/08/03 17:11
Subject: Re: building a native toolchain using a cross-compiler

Fisher Alex wrote:
> I've sucessfully built a cross-compiler toolchain from an i686-linux
host to
> a powerpc-linux target.
> Not everything I need to compile for my target is going to
> without spending months hacking various scripts.
> To get around this, I would like to use my cross compiler to build a
> toolchain for my target...

You're probably headed down the right road, and it sounds like Bill
gave you the info you need.  One of these days I'm going to add
a native compiler to the output of my crosstool build script.

But in defence of cross-compiling third party packages:

Most modern autoconf-based programs will cross-compile without too much
of a fuss.
You just have to look around to see what the magic incantation is.
This requires more understanding of autoconf/automake than most people
care to acquire, but once you have it, the time to deal with any
particular package drops to about an hour start to finish.
This is complicated enough that you have to write a shell script or
to hold the arcane commands, and it's only worth it if you need to make
a repeatable build process for your whole system.

For instance, for ntp, for my platform, the incantation to configure it
CC=${CROSS}gcc AR=${CROSS}ar RANLIB=${CROSS}ranlib CFLAGS="-mcpu=750
-D__PPC750__" \
   ./configure --prefix=/ --host=ppc-unknown-linux
After that, to install, you do
   make install DESTDIR=/path/to/your/staging/directory

There is one other alternative: the DODES project has put together a
hack that will let you build *and run* your programs on your build
it notices when you try to run a foreign executable, and remotes it to
target machine transparantly.  Quite slick.  See
for an introduction, and

- Dan

Dan Kegel
This email and any attachments are confidential to the intended recipient
and may also be privileged. If you are not the intended recipient please
delete it from your system and notify Thales Underwater Systems on +44 1963
370 551. You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.

Want more information?  See the CrossGCC FAQ,
Want to unsubscribe? Send a note to

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]