This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Threads vs hpux10
- From: law at redhat dot com
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 30 Nov 2001 12:54:09 -0700
- Subject: Threads vs hpux10
- Reply-to: law at redhat dot com
Due to the lack of weak symbol support it is necessary to build different
versions of libgcc and other target libraries for single and multi-threaded
uses.
A while back the PA target files were twiddled to build multilibs for
single and multi-threaded use. However, those changes did not work as
expected because the single-threaded libraries still had references to
pthread routines via gthr-dce.h.
This change removes the references to pthread routines in the single
threaded library by having gthr-dce.h include gthr-single.h when threads
are not enabled.
This allows users on hpux10 systems with thread packages installed to build
single threaded programs without having to link in the thread library.
It has (of course) been bootstrapped on hpux10.20 and regression tested.
* gthr-dce.h: If _DCE_THREADS is not defined, then just include
gthr-single.
Index: gthr-dce.h
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/gthr-dce.h,v
retrieving revision 1.13
diff -c -3 -p -r1.13 gthr-dce.h
*** gthr-dce.h 2001/09/13 13:15:58 1.13
--- gthr-dce.h 2001/11/30 19:43:36
*************** Software Foundation, 59 Temple Place - S
*** 29,34 ****
--- 29,40 ----
#ifndef GCC_GTHR_DCE_H
#define GCC_GTHR_DCE_H
+ /* If _DCE_THREADS is not defined, then we're building the single
+ threaded version of the libraries and do not want to reference
+ anything related to pthreads or dce. */
+ #ifndef _DCE_THREADS
+ #include "gthr-single.h"
+ #else
/* DCE threads interface.
DCE threads are based on POSIX threads draft 4, and many things
have changed since then. */
*************** __gthread_mutex_unlock (__gthread_mutex_
*** 487,490 ****
--- 493,497 ----
#undef UNUSED
+ #endif
#endif /* ! GCC_GTHR_DCE_H */