Problems building a cross compiler...

Ian Lance Taylor ian@airs.com
Fri Jul 22 16:48:00 GMT 2005


Andrew McCall <andrew.mccall@gmail.com> writes:

> > The simplest approach is to copy all the header files and libraries
> > onto the cross-host, using the same directory layout under some
> > directory DIR, and then configure --with-sysroot=DIR.
> 
> I have been trying to get this working since you suggested it.
> 
> I have the headers, but they come in multiple folders like this:
> 
> headers/cpp
> headers/gnu
> headres/libs
> headers/os
> headers/posix
> headers/private
> headers/tools
> 
> In os I have the normal "Be" headers, such as Be.h, Appkit.h etc. etc.
> in posix I have the posix headers like alloca.h, assert.h and
> stdlib.h.

By the default gcc expects to see a Unix style file system layout,
with /lib, /usr/include, /usr/lib, etc.  The header files would
normally be found in SYSROOT/usr/include, and, e.g., stdlib.h would be
found in SYSROOT/usr/include/stdlib.h.

You could shuffle your header files around to meet Unix expectations.
Or you could sort out INCLUDE_DEFAULTS for the particular case of
CROSS_COMPILER and TARGET_SYSTEM_ROOT.  See cppdefault.c.  I see an
instance of INCLUDE_DEFAULT in config/i386/beos-elf.h, although the
directories there do not appear to match the directories you listed
above.

I'm afraid that you have an unusual scenario, and you are going to
have to learn how gcc handles include file searching.

Ian



More information about the Gcc-help mailing list