pkgsrc/lang/gcc48/patches/patch-boehm-gc_pthread__support.c
ryoon b730789521 Update to 4.8.3
* Convert gcc48 to simple meta-pkg
* Potentially fix non-NetBSD packaging
* Fix gcc48-libs/gcc48-cc++ build under OpenBSD/amd64 5.5
* Enable graphite option, from wip/gcc48snapshot via Xiyue Deng
* Tweak nls option

Changelog:
GCC 4.8.3

   This is the [35]list of problem reports (PRs) from GCC's bug tracking
   system that are known to be fixed in the 4.8.3 release. This list might
   not be complete (that is, it is possible that some PRs that have been
   fixed are not listed here).

   Support for the new powerpc64le-linux platform has been added. It
   defaults to generating code that conforms to the ELFV2
2014-05-31 13:06:25 +00:00

44 lines
1.4 KiB
C

$NetBSD: patch-boehm-gc_pthread__support.c,v 1.1 2014/05/31 13:06:25 ryoon Exp $
--- boehm-gc/pthread_support.c.orig 2012-11-04 22:56:02.000000000 +0000
+++ boehm-gc/pthread_support.c
@@ -118,6 +118,10 @@
# include <fcntl.h>
# include <signal.h>
+#if defined(GC_OPENBSD_THREADS)
+# include <pthread_np.h>
+#endif
+
#if defined(GC_DARWIN_THREADS)
# include "private/darwin_semaphore.h"
#else
@@ -884,7 +888,8 @@ void GC_thr_init()
GC_nprocs = pthread_num_processors_np();
# endif
# if defined(GC_OSF1_THREADS) || defined(GC_AIX_THREADS) \
- || defined(GC_SOLARIS_PTHREADS) || defined(GC_GNU_THREADS)
+ || defined(GC_SOLARIS_PTHREADS) || defined(GC_GNU_THREADS) \
+ || defined(GC_OPENBSD_THREADS)
GC_nprocs = sysconf(_SC_NPROCESSORS_ONLN);
if (GC_nprocs <= 0) GC_nprocs = 1;
# endif
@@ -970,7 +975,6 @@ void GC_init_parallel()
int WRAP_FUNC(pthread_sigmask)(int how, const sigset_t *set, sigset_t *oset)
{
sigset_t fudged_set;
-
if (set != NULL && (how == SIG_BLOCK || how == SIG_SETMASK)) {
fudged_set = *set;
sigdelset(&fudged_set, SIG_SUSPEND);
@@ -1156,6 +1160,10 @@ GC_PTR GC_get_thread_stack_base()
return stack_addr;
# endif
+# elif defined(GC_OPENBSD_THREADS)
+ stack_t stack;
+ pthread_stackseg_np(pthread_self(), &stack);
+ return stack.ss_sp;
# else
# ifdef DEBUG_THREADS
GC_printf0("Can not determine stack base for attached thread");