This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
PATCH: Allow gcc/gthr* to be compiled by C++ as well as C
- To: libstdc++ at gcc dot gnu dot org
- Subject: PATCH: Allow gcc/gthr* to be compiled by C++ as well as C
- From: Loren James Rittle <rittle at latour dot rsch dot comm dot mot dot com>
- Date: Wed, 30 May 2001 08:45:56 -0500 (CDT)
- CC: gcc-patches at gcc dot gnu dot org
- Reply-to: rittle at labs dot mot dot com
Both libstdc++-v3/libsupc++/eh_alloc.cc and [...]/eh_globals.cc were
written to compile against the gcc/gthr.h abstraction layer, but the
configuration was hosed at some point and it now always maps to the
gcc/gthr-single.h configuration even if --enable-threads was provided
while configuring libstdc++-v3. The upshot is that C++ EH is broken
in light of multi-threading. This is a regression from 2.95.X on at
least some platforms.
Only the gcc/gthr-posix.h change has been fully bootstrapped on
multiple architectures. Changes to other files are identical in form.
David originally caught this problem and provided a patch for
gthr-posix.h bundled in other work. Approval for mainline and 3.0
branch is sought since the patch to actually fix libsupc++/eh_*.cc is
up next and requires this trivial patch.
2001-05-30 Loren J. Rittle <ljrittle@acm.org>
John David Anglin <dave@hiauly1.hia.nrc.ca>
* gthr-posix.h (__gthread_active_ptr): Cast function pointer
to target type to allow ISO C++ compiler to accept it.
* gthr-dce.h (__gthread_active_ptr): Likewise.
* gthr-solaris.h (__gthread_active_ptr): Likewise.
Index: gcc/gthr-dce.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/gthr-dce.h,v
retrieving revision 1.10
diff -c -r1.10 gthr-dce.h
*** gthr-dce.h 2001/05/26 01:31:34 1.10
--- gthr-dce.h 2001/05/30 11:14:11
***************
*** 79,85 ****
#pragma weak pthread_yield
#endif
! static void *__gthread_active_ptr = &pthread_create;
static inline int
__gthread_active_p (void)
--- 79,85 ----
#pragma weak pthread_yield
#endif
! static void *__gthread_active_ptr = (void *) &pthread_create;
static inline int
__gthread_active_p (void)
Index: gcc/gthr-posix.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/gthr-posix.h,v
retrieving revision 1.13
diff -c -r1.13 gthr-posix.h
*** gthr-posix.h 2001/05/26 01:31:34 1.13
--- gthr-posix.h 2001/05/30 11:14:11
***************
*** 75,81 ****
#pragma weak pthread_setschedparam
#endif
! static void *__gthread_active_ptr = &pthread_create;
static inline int
__gthread_active_p (void)
--- 75,81 ----
#pragma weak pthread_setschedparam
#endif
! static void *__gthread_active_ptr = (void *) &pthread_create;
static inline int
__gthread_active_p (void)
Index: gcc/gthr-solaris.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/gthr-solaris.h,v
retrieving revision 1.8
diff -c -r1.8 gthr-solaris.h
*** gthr-solaris.h 2001/05/26 01:31:34 1.8
--- gthr-solaris.h 2001/05/30 11:14:11
***************
*** 81,87 ****
/* This will not actually work in Solaris 2.5, since libc contains
dummy symbols of all thr_* routines. */
! static void *__gthread_active_ptr = &thr_create;
static inline int
__gthread_active_p (void)
--- 81,87 ----
/* This will not actually work in Solaris 2.5, since libc contains
dummy symbols of all thr_* routines. */
! static void *__gthread_active_ptr = (void *) &thr_create;
static inline int
__gthread_active_p (void)