[PATCH] posix gthreads additions for c++0x thread library
Paolo Carlini
paolo.carlini@oracle.com
Mon Aug 18 21:21:00 GMT 2008
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.
More information about the Gcc-patches
mailing list