Problems building a cross compiler...

Andrew McCall andrew.mccall@gmail.com
Fri Jul 22 10:50:00 GMT 2005


Hi Ian,

Thanks for the help with my cross compile problems!

On 21 Jul 2005 09:56:16 -0700, Ian Lance Taylor <ian@airs.com> wrote:
> Andrew McCall <andrew.mccall@gmail.com> writes:
> 
> > However, when I run make, I eventually get the following error:
> >
> > ../../gcc/libgcc2.c:41: stdlib.h: No such file or directory
> > ../../gcc/libgcc2.c:42: unistd.h: No such file or directory
> > make[3]: *** [libgcc2.a] Error 1
> > make[3]: Leaving directory
> > `/home/mccall/haiku/src/gcc-2.95.3-haiku/gcc-obj/gcc'
> > make[2]: *** [stmp-multilib-sub] Error 2
> > make[2]: Leaving directory
> > `/home/mccall/haiku/src/gcc-2.95.3-haiku/gcc-obj/gcc'
> > make[1]: *** [stmp-multilib] Error 1
> > make[1]: Leaving directory
> > `/home/mccall/haiku/src/gcc-2.95.3-haiku/gcc-obj/gcc'
> > make: *** [all-gcc] Error 2

[Snip]

> > Can anyone suggest what the problem is?  Is it something to do with me
> > needing headers from BeOS/Haiku to build a cross compiler?
> 
> Yes, that is exactly what it is.
> 
> 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.

You can see the layout here:

http://svn.berlios.de/viewcvs/haiku/haiku/trunk/headers/

I have tried using:

--with-sysroot=../../../haiku/headers
--with-sysroot=../../../haiku/headers/os
--with-sysroot=../../../haiku/headers/posix

But all of these fail with the same error.

-- 
Thanks,

Andrew McCall
andrew.mccall@gmail.com



More information about the Gcc-help mailing list