This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] posix gthreads additions for c++0x thread library
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: Chris Fairles <chris dot fairles at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, libstdc++ <libstdc++ at gcc dot gnu dot org>, Mark Mitchell <mark at codesourcery dot com>
- Date: Mon, 18 Aug 2008 23:15:54 +0200
- Subject: Re: [PATCH] posix gthreads additions for c++0x thread library
- References: <fac6bb500808181334g20d7f748r471bd6825979a337@mail.gmail.com>
Hi
So just focusing on posix platform in these patches.
gthr-posix-patch.txt includes the necessary changes to gthr-posix.h
and gthr-posix.c. I moved some of the objc-only definitions so they
are no longer objc-only (to avoid dup defs). The objc folk will have
to take a look at this to make sure its ok
(--enable-languages=c,c++,objc on x86_64 bootstraps fine for what its
worth).
Thanks a lot Chris. Given the August, 31st, deadline I think it's of the
utmost importance to sort out the compiler bits as soon as possible.
The second patch is the libstdc++-v3 configury bits that basically
tests for the required __gthread*_t types and functions using
AC_TRY_LINK. This was slightly difficult because gthr-default hasn't
been set up yet so I had to add -D_PTHREADS to CXXFLAGS (conditionally
on posix thread model) so that gthr.h picks gthr-posix.h and I also
had to add -DSUPPORTS_WEAK -DGTHREAD_USE_WEAK so that it linked (not
100% sure why however). I thought adding -pthreads to CXXFLAGS or
LDFLAGS would pull in the posix library for linking (if available) but
it didn't work.
I see. Given the current plan of minimizing the configury divergences
between native and crosses, It seems to me that we should do our best to
avoid completely AC_TRY_LINK tests, or use GCC_TRY_COMPILE_OR_LINK.
This is a bit tricky, it seems, better figure out the gthread bits first
and then move from there. By the way, isn't there something to be
learned from the existing [GLIBCXX_ENABLE_THREADS] test acinclude.m4? It
appears to exactly look up gthr-default.h and when it runs, normally (I
mean, for example, x86_64-linux native) gthr-default.h *is* set up, and
HAVE_GTHR_DEFAULT is defined.
Paolo.
Paolo.