This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: cross compiling thoughts
- From: Jim Wilson <wilson at specifixinc dot com>
- To: Axel Scheepers <axel at axel dot truedestiny dot net>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 09 Dec 2003 21:30:14 -0800
- Subject: Re: cross compiling thoughts
- References: <3FD345E8.2030900@axel.truedestiny.net>
Axel Scheepers wrote:
The above procedure produces a nice set of cross compiling tools to
build c and c++ sources. But... I was wondering if this was the right
way to do it; This time I could easily get the needed includes and libs
from the freebsd target host, but what if I wanted to use a platform
which I didn't have access too?
There is a good reference on cross compilers builds at
http://www.kegel.com/crosstool
It mostly concerns building linux crosses.
If you already have libraries and header files, then you can tell gcc to
use them. The old scheme is to use --with-headers=/--with-libs= options
to point to the targets headers and libraries. The new scheme is to use
--with-sys-root= which points to a file system root for the target.
This allows support for targets with headers/libraries in multiple
directories.
If you don't already have libraries and header files, then you have to
build them in parallel with gcc somehow. This can be a bit complicated
for glibc. The kegel.com site has info on a good way to do it. For
other targets, like freebsd, you would have to work up a similar procedure.
I did some googling, and it seems there is also a 'newlib'. Is this
compatible with glibc? e.g. Can I cross build files for a host which
only has glibc? Never had a look at it, I should.
newlib was designed for embedded targets which have no library of their
own. It is unlikely that you would want to use newlib for any unix like
OS. newlib does build fairly easily in parallel with gcc.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com