This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]