This is the mail archive of the crossgcc@sources.redhat.com 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


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 cross-compile
without spending months hacking various scripts.

To get around this, I would like to use my cross compiler to build a native
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 Makefile
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 is:
CC=${CROSS}gcc AR=${CROSS}ar RANLIB=${CROSS}ranlib CFLAGS="-mcpu=750 -D__PPC750__" \
  ./configure --prefix=/ --host=ppc-unknown-linux --build=pentium-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 nifty
hack that will let you build *and run* your programs on your build machine;
it notices when you try to run a foreign executable, and remotes it to the
target machine transparantly.  Quite slick.  See http://www.dodes.org/dodes/
for an introduction, and http://www.m17n.org/linux-sh/ml/linux-sh/2003-07/msg00019.html

- 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


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