[PATCH] PR bootstrap/9330: -pthread required to include <pthread.h>

Jim Wilson wilson@tuliptree.org
Mon Jun 30 06:18:00 GMT 2003


Roger Sayle wrote:
>  The fix below follows the netbsd/openbsd solution
> of using a tmake_file fragment to define TARGET_LIBGCC2_CFLAGS to be
> "-pthread".

This looks like the right solution here.

> The next failure came when building libstdc++.  Although Ben Kosnik
> has mentioned as recently as yesterday that the -pthread option may be
> required to build some libstdc++ files, I was unable to find where
> this mechanism is specified/used.

I don't see one either.

> My work around to handle this case
> was to add
> #ifndef _REENTRANT
> #define _REENTRANT 1
> #endif
> to gthr-posix.h,

This is a very common convention, so this does seem safe to me.  It 
would be better if we could get libstdc++ compiled with the right flags 
though.

> I hope
> this is a resonable location, there didn't appear to be a THREADCFLAGS
> option.

I think you should create one.  It shouldn't be hard.  Just pattern it 
after the existing THREAD* variables.

Jim



More information about the Libstdc++ mailing list