This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR bootstrap/9330: -pthread required to include <pthread.h>
- From: Jim Wilson <wilson at tuliptree dot org>
- To: Roger Sayle <roger at eyesopen dot com>
- Cc: libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org, java-patches at gcc dot gnu dot org
- Date: Sun, 29 Jun 2003 23:19:09 -0700
- Subject: Re: [PATCH] PR bootstrap/9330: -pthread required to include <pthread.h>
- References: <Pine.LNX.4.44.0306260910250.24703-100000@www.eyesopen.com>
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