Re: Errors cross compiling gcc 4.1.1 for i686-linux-pc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Klaus Nji wrote:

> /tmp/gcc-4.1.1/gcc/gthr-posix.h:43:21: error: pthread.h: No such file or directory
> /tmp/gcc-4.1.1/gcc/gthr-posix.h:44:20: error: unistd.h: No such file or directory

It looks like you don't have the target C library headers installed, or
they're in the wrong place.  This is required when building gcc because
gcc itself does not include a libc and it requires the headers when
building libgcc and the other target libraries like libstdc++.  You
normally point gcc to them using --with-headers or --with-sysroot et
cetera.

The easiest route is to get the C library headers from an existing
distro, in particular the same one (or one very similar to) that you
intend to eventually run your program on.  I.e. get them from the
libc-devel deb/rpm package.

It is also possible if there is no existing system to bootstrap gcc and
the libc together, but it's a lot more work.  You end up building a
stripped down C-only gcc, then using that to configure parts of the
libc, then using those headers to rebuild a full gcc, then using that to
actually build libc.  This is the method that the crosstool script uses
and if you want to go that route it's much easier just to run crosstool
and let it do everything.

Brian

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux