pthread.h: No such file or directory

Kai Ruottu karuottu@mbnet.fi
Wed Sep 6 12:05:00 GMT 2006


Iwan Koenig wrote :

> I'm trying to compile the gcc-4.1.1 for the target
> powerpc-linux.
> Thus it run i so:
> ../configure --target=powerpc-linux --prefix=/usr      
>                                           
> --without-headers
The Linux/PPC target has headers in its C library, "glibc",
so why this?

>  --with-newlib
 Linux doesn't use newlib, it uses glibc...
>                        
>           --enable-languages=c                        
>     --disable-threads
 You can build all the languages you need immediately, you
needing "only C" sounds weird...

> And it gives me following error:
> In file included from ./gthr-default.h:1,
>                  from ../../gcc-4.1.1/gcc/gthr.h:114,
>                  from
> .../../gcc-4.1.1/gcc/unwind-dw2.c:42:
> .../../gcc-4.1.1/gcc/gthr-posix.h:43:21: error:
> pthread.h: No such file or directory
> .../../gcc-4.1.1/gcc/gthr-posix.h:44:20: error:
> unistd.h: No such file or directory
>   

 Before starting to build GCC the target binutils (built by yourself)
and the target C library (copied from the target system) should be
already there!

 Although you "final" target would be your "totally own Linux/PPC",
not Fedora 5/PPC, Ubuntu/PPC etc., nothing should disable you to
use the glibc taken from Fedora, Ubuntu, SuSE etc. Linux/PPC distros
and use it temporalily when "bootstraping" the GCC.  When it is done,
you can build your "totally own" glibc from sources with it !

 With that "nothing" (but pure bullshit!) I mean the current weird
"code red" ("bullying") practices...  All the stupid newbies are put to
do stupid things only because they really will do these things when
not knowing that they aren't sane at all...  Something like that the
son of the managing director of the company will be sent to walk
around the factory to search for "a left-hand file-glove" and every
one asked sends him forwards to someone else until he finally
understands that he is doing something which others are laughing
at...

 In a nutshell:  For your GCC build to succeed you will require the
prebuilt target binutils and (a suitable) prebuilt target C library
being installed before starting the GCC configure and build...  Your
only problems are then how to get these and where to put them.
But just as the case is with the native GCC build, where to put the
native binutils and the native C library, used during the GCC build,
are not in any way related to the GCC build itself, they are put
somewhere already and GCC finds them, the case with a cross-GCC
is that one should already know where a cross-GCC requires its
target binutils and target C library, and then put them there. If not
knowing, one simply asks and then someone who knows tells that!




More information about the Gcc-help mailing list