On Thursday 30 May 2013 1:28:38 pm Stuart Henderson wrote:
> On 2013/05/30 09:10, Kurt Miller wrote:
> > On Friday 22 March 2013 10:03:14 pm Kurt Miller wrote:
> > > On 03/22/13 08:35, Stuart Henderson wrote:
> > > > On 2013/03/21 22:01, Kurt Miller wrote:
> > > >> I stalled on submitting them with upstream. I ran into a snafu.
> > > >> However, I
> > > >> do have an update for boehm-gc that can be tested. There's one i386
> > > >> machine in my cluster that doesn't behave which is one of the reasons
> > > >> I haven't moved this forward yet. It is on my todo list which I'm
> > > >> chipping
> > > >> away at little by little.
> > > >
> > > > Regression tests all pass on macppc, i386, amd64, and I've tried w3m
> > > > a bit on these 3 arches (w3m has had problems in the past even though
> > > > regression tests were all OK); no problems noted there.
> > > >
> > > > It would be good if someone could do similar tests on other arch,
> > > > in particular hppa if it hasn't already been tested.
> > > >
> > >
> > > Thanks Stuart. I sent the diff before I reviewed the old patches and
> > > I removed two patches that should stay:
> > >
> > > patch-bdw-gc_pc_in
> > > patch-doc_gc_man
> > >
> > > Well actually the gc man patch needs to be updated since it refers to
> > > header file that no longer exists. I'll send a new revision when I
> > > get back from a short family vacation.
> >
> > [redirecting from tech@]
> >
> > The only difference in this update from the one I posted back in March
> > is that I kept patch-bdw-gc_pc_in which includes -pthread in Libs. The
> > man page diff is not needed anymore since gc_cpp.h is gone and there's
> > nothing special about OpenBSD's port that needs to be called out, IMO.
>
> No problems seen so far on i386/amd64/sparc64/macppc.
>
> Here's a diff relative to yours to add c++ support, which is no longer
> enabled by default, unbreaking graphics/asymptote. (SHARED_LIBS lines
> pasted directly from shared_libs.log).
>
> I've also moved PFRAG.shared-main into PLIST-main now that pkg_create
> can handle this.
>
Great. Thank you. I incorporated your changes plus I noted that the w3m
change highlighted the need for a major bump to libgc.so due to the API
change to GC_set_warn_proc(). Here's the latest version:
Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/boehm-gc/Makefile,v
retrieving revision 1.49
diff -u -p -r1.49 Makefile
--- Makefile 21 Mar 2013 08:45:14 -0000 1.49
+++ Makefile 30 May 2013 19:17:29 -0000
@@ -3,16 +3,17 @@
COMMENT-main= garbage collection and memory leak detection for C and C++
COMMENT-atomic= access to hardware provided atomic memory operations
-VERSION= 7.0
+VERSION= 7.2d
DISTNAME= gc-${VERSION}
-PKGNAME-atomic= libatomic_ops-1.2
+PKGNAME-atomic= libatomic_ops-${VERSION}
PKGNAME-main= boehm-gc-${VERSION}
-REVISION= 7
+WRKDIST= ${WRKDIR}/gc-7.2
MULTI_PACKAGES= -main -atomic
-SHARED_LIBS += gc 3.0 # .1.2
-SHARED_LIBS += cord 2.3 # .1.3
+SHARED_LIBS += gc 4.0 # .1.3
+SHARED_LIBS += gccpp 0.0 # .1.3
+SHARED_LIBS += cord 2.3 # .1.3
CATEGORIES= devel
@@ -27,7 +28,7 @@ NOT_FOR_ARCHS= m68k m88k vax mips64 mips
PERMIT_PACKAGE_CDROM= Yes
-WANTLIB += pthread
+WANTLIB-main += pthread
MAKE_ENV= CP="cp" \
INSTALL_DATA="${INSTALL_DATA}" \
@@ -35,10 +36,11 @@ MAKE_ENV= CP="cp" \
USE_GROFF = Yes
-AUTOCONF_VERSION= 2.61
+AUTOCONF_VERSION= 2.68
CONFIGURE_STYLE= autoconf no-autoheader
CONFIGURE_ARGS= ${CONFIGURE_SHARED} \
+ --enable-cplusplus \
--enable-threads=pthreads
pre-configure:
Index: distinfo
===================================================================
RCS file: /cvs/ports/devel/boehm-gc/distinfo,v
retrieving revision 1.7
diff -u -p -r1.7 distinfo
--- distinfo 14 Jul 2007 22:16:16 -0000 1.7
+++ distinfo 30 May 2013 19:17:29 -0000
@@ -1,5 +1,2 @@
-MD5 (gc-7.0.tar.gz) = NkXM9fMuuyfZmyew0p6cOA==
-RMD160 (gc-7.0.tar.gz) = SRLiWQ3YISvr7rHjJQZ2LKMdAIg=
-SHA1 (gc-7.0.tar.gz) = ZX2EtwKlcvilENLChXim26rT/tI=
-SHA256 (gc-7.0.tar.gz) = 0grG6Tm4J3BDS3bk99wYpAmdUH609CpdOtdGJQwBHls=
-SIZE (gc-7.0.tar.gz) = 1072682
+SHA256 (gc-7.2d.tar.gz) = 2f4K6GUNQ3RqSL+zlMqwGjGfOAnO4Z+OvRaqmFtRHF4=
+SIZE (gc-7.2d.tar.gz) = 1263064
Index: patches/patch-configure_ac
===================================================================
RCS file: patches/patch-configure_ac
diff -N patches/patch-configure_ac
--- patches/patch-configure_ac 22 Feb 2012 12:31:42 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,25 +0,0 @@
-$OpenBSD: patch-configure_ac,v 1.2 2012/02/22 12:31:42 kurt Exp $
---- configure.ac.orig Sat Jun 30 11:40:15 2007
-+++ configure.ac Sun Feb 19 12:57:00 2012
-@@ -113,6 +113,11 @@ case "$THREADS" in
- *-*-hpux10*)
- AC_MSG_WARN("Only HP-UX 11 POSIX threads are supported.")
- ;;
-+ *-*-openbsd*)
-+ AC_DEFINE(GC_OPENBSD_THREADS)
-+ THREADDLLIBS=-pthread
-+ INCLUDES="$INCLUDES -pthread"
-+ ;;
- *-*-freebsd*)
- AC_MSG_WARN("FreeBSD does not yet fully support threads with Boehm GC.")
- AC_DEFINE(GC_FREEBSD_THREADS)
-@@ -394,6 +399,9 @@ case "$host" in
- ;;
- sparc-*-netbsd*)
- machdep="mach_dep.lo sparc_netbsd_mach_dep.lo"
-+ ;;
-+ sparc*-*-openbsd*)
-+ machdep="mach_dep.lo sparc_mach_dep.lo"
- ;;
- sparc-sun-solaris2.3)
- machdep="mach_dep.lo sparc_mach_dep.lo"
Index: patches/patch-doc_gc_man
===================================================================
RCS file: patches/patch-doc_gc_man
diff -N patches/patch-doc_gc_man
--- patches/patch-doc_gc_man 1 Apr 2008 17:41:13 -0000 1.5
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,58 +0,0 @@
-$OpenBSD: patch-doc_gc_man,v 1.5 2008/04/01 17:41:13 kurt Exp $
---- doc/gc.man.orig Mon Oct 10 18:33:34 2005
-+++ doc/gc.man Wed Feb 6 19:33:58 2008
-@@ -1,4 +1,4 @@
--.TH GC_MALLOC 1L "2 October 2003"
-+.TH GC_MALLOC 3 "2 October 2003"
- .SH NAME
- GC_malloc, GC_malloc_atomic, GC_free, GC_realloc, GC_enable_incremental,
GC_register_finalizer, GC_malloc_ignore_off_page,
GC_malloc_atomic_ignore_off_page, GC_set_warn_proc \- Garbage collecting malloc
replacement
- .SH SYNOPSIS
-@@ -81,6 +81,48 @@ GC_enable_incremental.
- This may temporarily write protect pages in the heap. See the README file
for more information on how this interacts with system calls that write to the
heap.
- .LP
- Other facilities not discussed here include limited facilities to support
incremental collection on machines without appropriate VM support, provisions
for providing more explicit object layout information to the garbage collector,
more direct support for ``weak'' pointers, support for ``abortable'' garbage
collections during idle time, etc.
-+.LP
-+.SH "PORT INFORMATION"
-+.LP
-+In this (OpenBSD package) installation,
-+.I gc.h
-+and
-+.I gc_cpp.h
-+will be found in
-+.I /usr/local/include ,
-+and the libraries in
-+.I /usr/local/lib.
-+.LP
-+These libraries have been compiled as drop-in replacements
-+for malloc and free (which is to say, all malloc
-+calls will allocate garbage-collectable data).
-+There is no need to include "gc.h" in your C files unless you want
-+access to the debugging (and other) functions defined there,
-+or unless you want to explicitly use
-+.I GC_malloc_uncollectable
-+for some allocations.
-+Just link against them whenever you want either garbage
-+collection or leak detection.
-+.LP
-+The C++ header file, "gc_cpp.h",
-+.I is
-+necessary for C++ programs, to obtain the appropriate
-+definitions of the
-+.I new
-+and
-+.I delete
-+operators.
-+The comments in both of these header files presently
-+provide far better documentation
-+for the package than this man page;
-+look there for more information.
-+.LP
-+Both libraries are compiled without (explicit) support
-+for the experimental
-+.I gc
-+extension of
-+.I g++.
-+This may or may not make a difference.
- .LP
- .SH "SEE ALSO"
- The README and gc.h files in the distribution. More detailed definitions of
the functions exported by the collector are given there. (The above list is
not complete.)
Index: patches/patch-dyn_load_c
===================================================================
RCS file: /cvs/ports/devel/boehm-gc/patches/patch-dyn_load_c,v
retrieving revision 1.6
diff -u -p -r1.6 patch-dyn_load_c
--- patches/patch-dyn_load_c 1 Apr 2008 17:41:13 -0000 1.6
+++ patches/patch-dyn_load_c 30 May 2013 19:17:29 -0000
@@ -1,48 +1,25 @@
-$OpenBSD: patch-dyn_load_c,v 1.6 2008/04/01 17:41:13 kurt Exp $
---- dyn_load.c.orig Thu Jun 28 17:36:03 2007
-+++ dyn_load.c Thu Mar 20 18:09:28 2008
-@@ -63,6 +63,7 @@ static int (*GC_has_static_roots)(const char *, void *
- !defined(HPUX) && !(defined(LINUX) && defined(__ELF__)) && \
- !defined(AIX) && !defined(SCO_ELF) && !defined(DGUX) && \
- !(defined(FREEBSD) && defined(__ELF__)) && \
-+ !(defined(OPENBSD) && (defined(__ELF__) || defined(M68K))) && \
- !(defined(NETBSD) && defined(__ELF__)) && !defined(HURD) && \
- !defined(DARWIN) && !defined(CYGWIN32)
- --> We only know how to find data segments of dynamic libraries for the
-@@ -84,9 +85,9 @@ static int (*GC_has_static_roots)(const char *, void *
-
- #if defined(LINUX) && defined(__ELF__) || defined(SCO_ELF) || \
- (defined(FREEBSD) && defined(__ELF__)) || defined(DGUX) || \
-+ (defined(OPENBSD) && defined(__ELF__)) || \
- (defined(NETBSD) && defined(__ELF__)) || defined(HURD)
- # include <stddef.h>
--# include <elf.h>
- # include <link.h>
+$OpenBSD$
+--- dyn_load.c.orig Thu Aug 9 16:25:13 2012
++++ dyn_load.c Tue Mar 19 19:39:39 2013
+@@ -83,12 +83,20 @@ STATIC GC_has_static_roots_func GC_has_static_roots =
+ # define ELFSIZE ARCH_ELFSIZE
#endif
-@@ -99,7 +100,7 @@ static int (*GC_has_static_roots)(const char *, void *
- # else
- # define ElfW(type) Elf64_##type
- # endif
--# elif defined(NETBSD)
-+# elif defined(NETBSD) || defined(OPENBSD)
- # if ELFSIZE == 32
- # define ElfW(type) Elf32_##type
- # else
-@@ -216,6 +217,7 @@ void GC_register_dynamic_libraries()
-
- #if defined(LINUX) && defined(__ELF__) || defined(SCO_ELF) || \
- (defined(FREEBSD) && defined(__ELF__)) || defined(DGUX) || \
-+ (defined(OPENBSD) && defined(__ELF__)) || \
- (defined(NETBSD) && defined(__ELF__)) || defined(HURD)
-
-
-@@ -414,7 +416,7 @@ GC_bool GC_register_main_static_data()
- /* This doesn't necessarily work in all cases, e.g. with preloaded
- * dynamic libraries. */
-
--#if defined(NETBSD)
-+#if defined(NETBSD) || defined(OPENBSD)
- # include <sys/exec_elf.h>
- /* for compatibility with 1.4.x */
- # ifndef DT_DEBUG
++#if defined(OPENBSD)
++# include <sys/param.h>
++# include <dlfcn.h>
++# if OpenBSD >= 200519
++# define HAVE_DL_ITERATE_PHDR
++# endif
++#endif
++
+ #if defined(SCO_ELF) || defined(DGUX) || defined(HURD) \
+ || (defined(__ELF__) && (defined(LINUX) || defined(FREEBSD) \
+ || defined(NETBSD) || defined(OPENBSD)))
+ # include <stddef.h>
+ # if !defined(OPENBSD) && !defined(PLATFORM_ANDROID)
+- /* FIXME: Why we exclude it for OpenBSD? */
++ /* OpenBSD doesn't have elf.h. link.h below is sufficent */
+ /* Exclude Android because linker.h below includes its own version. */
+ # include <elf.h>
+ # endif
Index: patches/patch-include_gc_config_macros_h
===================================================================
RCS file: patches/patch-include_gc_config_macros_h
diff -N patches/patch-include_gc_config_macros_h
--- patches/patch-include_gc_config_macros_h 14 Jul 2007 22:16:17 -0000
1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,23 +0,0 @@
-$OpenBSD: patch-include_gc_config_macros_h,v 1.1 2007/07/14 22:16:17 kili Exp $
---- include/gc_config_macros.h.orig Mon Jul 2 14:21:33 2007
-+++ include/gc_config_macros.h Thu Jul 12 09:56:42 2007
-@@ -65,7 +65,7 @@
- defined(GC_DGUX386_THREADS) || defined(GC_DARWIN_THREADS) || \
- defined(GC_AIX_THREADS) || defined(GC_NETBSD_THREADS) || \
- (defined(GC_WIN32_THREADS) && defined(__CYGWIN32__)) || \
-- defined(GC_GNU_THREADS)
-+ defined(GC_GNU_THREADS) || defined(GC_OPENBSD_THREADS)
- # define GC_PTHREADS
- # endif
-
-@@ -100,6 +100,10 @@
- # endif
- # if defined(__APPLE__) && defined(__MACH__)
- # define GC_DARWIN_THREADS
-+# define GC_PTHREADS
-+# endif
-+# if !defined(GC_PTHREADS) && defined(__OpenBSD__)
-+# define GC_OPENBSD_THREADS
- # define GC_PTHREADS
- # endif
- # if !defined(GC_PTHREADS) && (defined(__FreeBSD__) || defined(__DragonFly__))
Index: patches/patch-include_private_gc_priv_h
===================================================================
RCS file: patches/patch-include_private_gc_priv_h
diff -N patches/patch-include_private_gc_priv_h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-include_private_gc_priv_h 30 May 2013 19:17:29 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+--- include/private/gc_priv.h.orig Thu Aug 9 16:25:13 2012
++++ include/private/gc_priv.h Tue Mar 19 19:39:39 2013
+@@ -2209,7 +2209,11 @@ GC_INNER ptr_t GC_store_debug_info(ptr_t p, word sz, c
+ /* Linuxthreads itself uses SIGUSR1 and SIGUSR2. */
+ # define SIG_SUSPEND SIGPWR
+ # endif
+-# elif !defined(GC_OPENBSD_THREADS) && !defined(GC_DARWIN_THREADS)
++# elif defined(GC_OPENBSD_THREADS)
++# if OpenBSD >= 201211
++# define SIG_SUSPEND SIGXFSZ
++# endif
++# elif !defined(GC_DARWIN_THREADS)
+ # if defined(_SIGRTMIN)
+ # define SIG_SUSPEND _SIGRTMIN + 6
+ # else
Index: patches/patch-include_private_gcconfig_h
===================================================================
RCS file: /cvs/ports/devel/boehm-gc/patches/patch-include_private_gcconfig_h,v
retrieving revision 1.17
diff -u -p -r1.17 patch-include_private_gcconfig_h
--- patches/patch-include_private_gcconfig_h 24 Mar 2012 21:21:18 -0000
1.17
+++ patches/patch-include_private_gcconfig_h 30 May 2013 19:17:29 -0000
@@ -1,334 +1,140 @@
---- include/private/gcconfig.h.orig Thu Jun 28 20:00:09 2007
-+++ include/private/gcconfig.h Fri Mar 16 17:43:45 2012
-@@ -64,7 +64,7 @@
- /* Determine the machine type: */
- # if defined(__arm__) || defined(__thumb__)
- # define ARM32
--# if !defined(LINUX) && !defined(NETBSD)
-+# if !defined(LINUX) && !defined(NETBSD) && !defined(OPENBSD)
- # define NOSYS
- # define mach_type_known
- # endif
-@@ -75,14 +75,18 @@
- # if defined(hp9000s300)
- # error M68K based HP machines no longer supported.
- # endif
--# if defined(OPENBSD) && defined(m68k)
--# define M68K
--# define mach_type_known
--# endif
- # if defined(OPENBSD) && defined(__sparc__)
- # define SPARC
- # define mach_type_known
- # endif
-+# if defined(OPENBSD) && defined(__arm__)
-+# define ARM32
-+# define mach_type_known
-+# endif
-+# if defined(OPENBSD) && defined(__sh__)
-+# define SH
-+# define mach_type_known
-+# endif
- # if defined(NETBSD) && (defined(m68k) || defined(__m68k__))
- # define M68K
- # define mach_type_known
-@@ -99,7 +103,7 @@
- # define SH
- # define mach_type_known
- # endif
--# if defined(vax)
-+# if defined(vax) || defined(__vax__)
- # define VAX
- # ifdef ultrix
- # define ULTRIX
-@@ -117,7 +121,7 @@
- # if defined(nec_ews) || defined(_nec_ews)
- # define EWS4800
- # endif
--# if !defined(LINUX) && !defined(EWS4800) && !defined(NETBSD)
-+# if !defined(LINUX) && !defined(EWS4800) && !defined(NETBSD) &&
!defined(OPENBSD)
- # if defined(ultrix) || defined(__ultrix)
- # define ULTRIX
- # else
-@@ -198,7 +202,7 @@
- # if defined(_PA_RISC1_0) || defined(_PA_RISC1_1) || defined(_PA_RISC2_0) \
- || defined(hppa) || defined(__hppa__)
- # define HP_PA
--# if !defined(LINUX) && !defined(HPUX)
-+# if !defined(LINUX) && !defined(HPUX) && !defined(OPENBSD)
- # define HPUX
- # endif
- # define mach_type_known
-@@ -219,6 +223,10 @@
- # define I386
- # define mach_type_known
- # endif
-+# if defined(OPENBSD) && defined(__amd64__)
-+# define X86_64
-+# define mach_type_known
-+# endif
- # if defined(LINUX) && defined(__x86_64__)
- # define X86_64
- # define mach_type_known
-@@ -290,6 +298,11 @@
- # define MACOS
- # define mach_type_known
- # endif
-+# if defined(__OpenBSD__) && (defined(__powerpc__))
-+# define POWERPC
-+# define OPENBSD
-+# define mach_type_known
-+# endif
- # if defined(macosx) || (defined(__APPLE__) && defined(__MACH__))
- # define DARWIN
- # if defined(__ppc__) || defined(__ppc64__)
-@@ -645,17 +658,6 @@
- # ifdef M68K
- # define MACH_TYPE "M68K"
- # define ALIGNMENT 2
--# ifdef OPENBSD
--# define OS_TYPE "OPENBSD"
--# define HEURISTIC2
--# ifdef __ELF__
--# define DATASTART GC_data_start
--# define DYNAMIC_LOADING
--# else
-- extern char etext[];
--# define DATASTART ((ptr_t)(etext))
--# endif
--# endif
- # ifdef NETBSD
- # define OS_TYPE "NETBSD"
- # define HEURISTIC2
-@@ -788,6 +790,22 @@
- should be looked into some more */
- # define NO_PTHREAD_TRYLOCK
- # endif
-+# ifdef OPENBSD
-+# define OS_TYPE "OPENBSD"
-+# define ALIGNMENT 4
-+# define SIG_SUSPEND SIGXFSZ
-+# define SIG_THR_RESTART SIGXCPU
-+# ifndef GC_OPENBSD_THREADS
-+# include <sys/param.h>
-+# include <uvm/uvm_extern.h>
-+# define STACKBOTTOM USRSTACK
+$OpenBSD$
+--- include/private/gcconfig.h.orig Thu Aug 9 16:25:13 2012
++++ include/private/gcconfig.h Tue Mar 19 19:39:39 2013
+@@ -842,10 +842,11 @@
+ # ifdef OPENBSD
+ # define OS_TYPE "OPENBSD"
+ # define ALIGNMENT 4
+-# ifdef GC_OPENBSD_THREADS
+-# define UTHREAD_SP_OFFSET 268
+-# else
+-# include <sys/param.h>
++# include <sys/param.h>
++# if defined(GC_OPENBSD_THREADS) && OpenBSD < 201211
++# define UTHREAD_SP_OFFSET 268
+# endif
-+ extern int __data_start[];
-+# define DATASTART ((ptr_t)(__data_start))
-+ extern char _end[];
-+# define DATAEND ((ptr_t)(&_end))
-+# define DYNAMIC_LOADING
-+# endif
- # ifdef FREEBSD
- # define ALIGNMENT 4
- # define OS_TYPE "FREEBSD"
-@@ -955,9 +973,18 @@
++# ifndef GC_OPENBSD_THREADS
+ # include <uvm/uvm_extern.h>
+ # define STACKBOTTOM USRSTACK
+ # endif
+@@ -1044,10 +1045,11 @@
# endif
# ifdef OPENBSD
# define OS_TYPE "OPENBSD"
--# define STACKBOTTOM ((ptr_t) 0xf8000000)
-- extern int etext[];
--# define DATASTART ((ptr_t)(etext))
-+# define SIG_SUSPEND SIGXFSZ
-+# define SIG_THR_RESTART SIGXCPU
-+# ifndef GC_OPENBSD_THREADS
-+# include <sys/param.h>
-+# include <uvm/uvm_extern.h>
-+# define STACKBOTTOM USRSTACK
+-# ifdef GC_OPENBSD_THREADS
+-# define UTHREAD_SP_OFFSET 232
+-# else
+-# include <sys/param.h>
++# include <sys/param.h>
++# if defined(GC_OPENBSD_THREADS) && OpenBSD < 201211
++# define UTHREAD_SP_OFFSET 232
+# endif
-+ extern int __data_start[];
-+# define DATASTART ((ptr_t)(__data_start))
-+ extern char _end[];
-+# define DATAEND ((ptr_t)(&_end))
-+# define DYNAMIC_LOADING
- # endif
- # ifdef NETBSD
- # define OS_TYPE "NETBSD"
-@@ -1203,6 +1230,18 @@
++# ifndef GC_OPENBSD_THREADS
+ # include <uvm/uvm_extern.h>
+ # define STACKBOTTOM USRSTACK
+ # endif
+@@ -1321,10 +1323,11 @@
# endif
# ifdef OPENBSD
- # define OS_TYPE "OPENBSD"
-+# define SIG_SUSPEND SIGXFSZ
-+# define SIG_THR_RESTART SIGXCPU
-+# ifndef GC_OPENBSD_THREADS
+ # define OS_TYPE "OPENBSD"
+-# ifdef GC_OPENBSD_THREADS
+# include <sys/param.h>
-+# include <uvm/uvm_extern.h>
-+# define STACKBOTTOM USRSTACK
++# if defined(GC_OPENBSD_THREADS) && OpenBSD < 201211
+ # define UTHREAD_SP_OFFSET 176
+-# else
+-# include <sys/param.h>
++# endif
++# ifndef GC_OPENBSD_THREADS
+ # include <uvm/uvm_extern.h>
+ # define STACKBOTTOM USRSTACK
+ # endif
+@@ -1556,10 +1559,11 @@
+ # ifdef OPENBSD
+ # define OS_TYPE "OPENBSD"
+ # define ALIGNMENT 4
+-# ifdef GC_OPENBSD_THREADS
++# include <sys/param.h>
++# if defined(GC_OPENBSD_THREADS) && OpenBSD < 201211
+ # define UTHREAD_SP_OFFSET 808
+-# else
+-# include <sys/param.h>
+# endif
-+ extern int __data_start[];
-+# define DATASTART ((ptr_t)(__data_start))
-+ extern char _end[];
-+# define DATAEND ((ptr_t)(&_end))
-+# define DYNAMIC_LOADING
- # endif
- # ifdef FREEBSD
- # define OS_TYPE "FREEBSD"
-@@ -1238,7 +1277,7 @@
- # ifdef BSDI
- # define OS_TYPE "BSDI"
- # endif
--# if defined(OPENBSD) || defined(NETBSD) \
-+# if defined(NETBSD) \
- || defined(THREE86BSD) || defined(BSDI)
- # define HEURISTIC2
- extern char etext[];
-@@ -1403,6 +1442,22 @@
- # define STACKBOTTOM ((ptr_t) 0x7ffff000)
- # endif /* _ELF_ */
- # endif
-+# ifdef OPENBSD
-+# define OS_TYPE "OPENBSD"
-+# define ALIGNMENT 4
-+# define SIG_SUSPEND SIGXFSZ
-+# define SIG_THR_RESTART SIGXCPU
+# ifndef GC_OPENBSD_THREADS
-+# include <sys/param.h>
-+# include <uvm/uvm_extern.h>
-+# define STACKBOTTOM USRSTACK
-+# endif
-+ extern int _fdata[];
-+# define DATASTART ((ptr_t)(_fdata))
-+ extern char _end[];
-+# define DATAEND ((ptr_t)(&_end))
-+# define DYNAMIC_LOADING
-+# endif
- # if defined(NONSTOP)
- # define CPP_WORDSZ 32
- # define OS_TYPE "NONSTOP"
-@@ -1423,7 +1478,7 @@
- # define CPP_WORDSZ 32
+ # include <uvm/uvm_extern.h>
+ # define STACKBOTTOM USRSTACK
+ # endif
+@@ -1634,10 +1638,11 @@
+ # endif /* LINUX */
+ # ifdef OPENBSD
+ # define OS_TYPE "OPENBSD"
+-# ifdef GC_OPENBSD_THREADS
++# include <sys/param.h>
++# if defined(GC_OPENBSD_THREADS) && OpenBSD < 201211
+ # define UTHREAD_SP_OFFSET 520
+-# else
+-# include <sys/param.h>
++# endif
++# ifndef GC_OPENBSD_THREADS
+ # include <uvm/uvm_extern.h>
+ # define STACKBOTTOM USRSTACK
+ # endif
+@@ -1666,10 +1671,11 @@
+ # ifdef OPENBSD
+ # define OS_TYPE "OPENBSD"
+ # define ELF_CLASS ELFCLASS64
+-# ifdef GC_OPENBSD_THREADS
++# include <sys/param.h>
++# if defined(GC_OPENBSD_THREADS) && OpenBSD < 201211
+ # define UTHREAD_SP_OFFSET 816
+-# else
+-# include <sys/param.h>
++# endif
++# ifndef GC_OPENBSD_THREADS
+ # include <uvm/uvm_extern.h>
+ # define STACKBOTTOM USRSTACK
+ # endif
+@@ -1973,10 +1979,11 @@
+ # ifdef OPENBSD
# define ALIGNMENT 4
- # endif
--# if !defined(GC_HPUX_THREADS) && !defined(GC_LINUX_THREADS)
-+# if !defined(GC_HPUX_THREADS) && !defined(GC_LINUX_THREADS) &&
!defined(OPENBSD)
- # ifndef LINUX /* For now. */
- # define MPROTECT_VDB
+ # define OS_TYPE "OPENBSD"
+-# ifdef GC_OPENBSD_THREADS
++# include <sys/param.h>
++# if defined(GC_OPENBSD_THREADS) && OpenBSD < 201211
+ # define UTHREAD_SP_OFFSET 176
+-# else
+-# include <sys/param.h>
++# endif
++# ifndef GC_OPENBSD_THREADS
+ # include <uvm/uvm_extern.h>
+ # define STACKBOTTOM USRSTACK
# endif
-@@ -1472,6 +1527,21 @@
- extern int _end[];
- # define DATAEND (&_end)
- # endif /* LINUX */
-+# ifdef OPENBSD
-+# define OS_TYPE "OPENBSD"
-+# define SIG_SUSPEND SIGXFSZ
-+# define SIG_THR_RESTART SIGXCPU
-+# ifndef GC_OPENBSD_THREADS
-+# include <sys/param.h>
-+# include <uvm/uvm_extern.h>
-+# define STACKBOTTOM USRSTACK
-+# endif
-+ extern int __data_start[];
-+# define DATASTART ((ptr_t)(__data_start))
-+ extern char _end[];
-+# define DATAEND ((ptr_t)(&_end))
-+# define DYNAMIC_LOADING
-+# endif
- # endif /* HP_PA */
-
- # ifdef ALPHA
-@@ -1489,15 +1559,19 @@
+@@ -2032,10 +2039,11 @@
# endif
# ifdef OPENBSD
- # define OS_TYPE "OPENBSD"
--# define HEURISTIC2
--# ifdef __ELF__ /* since OpenBSD/Alpha 2.9 */
--# define DATASTART GC_data_start
--# define ELFCLASS32 32
--# define ELFCLASS64 64
--# define ELF_CLASS ELFCLASS64
--# else /* ECOFF, until OpenBSD/Alpha 2.7 */
--# define DATASTART ((ptr_t) 0x140000000)
--# endif
-+# define ELF_CLASS ELFCLASS64
-+# define SIG_SUSPEND SIGXFSZ
-+# define SIG_THR_RESTART SIGXCPU
-+# ifndef GC_OPENBSD_THREADS
-+# include <sys/param.h>
-+# include <uvm/uvm_extern.h>
-+# define STACKBOTTOM USRSTACK
-+# endif
-+ extern int __data_start[];
-+# define DATASTART ((ptr_t)(__data_start))
-+ extern char _end[];
-+# define DATAEND ((ptr_t)(&_end))
-+# define DYNAMIC_LOADING
- # endif
- # ifdef FREEBSD
- # define OS_TYPE "FREEBSD"
-@@ -1665,6 +1739,7 @@
- # ifdef CX_UX
- # define OS_TYPE "CX_UX"
- # define DATASTART ((((word)etext + 0x3fffff) & ~0x3fffff) + 0x10000)
-+# define STACKBOTTOM ((char*)0xf0000000) /* determined empirically */
- # endif
- # ifdef DGUX
- # define OS_TYPE "DGUX"
-@@ -1764,6 +1839,22 @@
- # define OS_TYPE "MSWINCE"
- # define DATAEND /* not needed */
- # endif
-+# ifdef OPENBSD
-+# define ALIGNMENT 4
-+# define OS_TYPE "OPENBSD"
-+# define SIG_SUSPEND SIGXFSZ
-+# define SIG_THR_RESTART SIGXCPU
-+# ifndef GC_OPENBSD_THREADS
-+# include <sys/param.h>
-+# include <uvm/uvm_extern.h>
-+# define STACKBOTTOM USRSTACK
-+# endif
-+ extern int __data_start[];
-+# define DATASTART ((ptr_t)(__data_start))
-+ extern char _end[];
-+# define DATAEND ((ptr_t)(&_end))
-+# define DYNAMIC_LOADING
-+# endif
- # ifdef NOSYS
- /* __data_start is usually defined in the target linker script. */
- extern int __data_start[];
-@@ -1807,6 +1898,21 @@
- # define DATASTART GC_data_start
- # define DYNAMIC_LOADING
- # endif
-+# ifdef OPENBSD
-+# define OS_TYPE "OPENBSD"
-+# define SIG_SUSPEND SIGXFSZ
-+# define SIG_THR_RESTART SIGXCPU
-+# ifndef GC_OPENBSD_THREADS
-+# include <sys/param.h>
-+# include <uvm/uvm_extern.h>
-+# define STACKBOTTOM USRSTACK
-+# endif
-+ extern int __data_start[];
-+# define DATASTART ((ptr_t)(__data_start))
-+ extern char _end[];
-+# define DATAEND ((ptr_t)(&_end))
-+# define DYNAMIC_LOADING
-+# endif
- # endif
-
- # ifdef SH4
-@@ -1838,6 +1944,22 @@
- # define CPP_WORDSZ 64
- # ifndef HBLKSIZE
- # define HBLKSIZE 4096
-+# endif
-+# ifdef OPENBSD
-+# define OS_TYPE "OPENBSD"
-+# define ELF_CLASS ELFCLASS64
-+# define SIG_SUSPEND SIGXFSZ
-+# define SIG_THR_RESTART SIGXCPU
-+# ifndef GC_OPENBSD_THREADS
-+# include <sys/param.h>
-+# include <uvm/uvm_extern.h>
-+# define STACKBOTTOM USRSTACK
-+# endif
-+ extern int __data_start[];
-+# define DATASTART ((ptr_t)(__data_start))
-+ extern char _end[];
-+# define DATAEND ((ptr_t)(&_end))
-+# define DYNAMIC_LOADING
- # endif
- # define CACHE_LINE_SIZE 64
- # ifdef LINUX
+ # define OS_TYPE "OPENBSD"
+-# ifdef GC_OPENBSD_THREADS
++# include <sys/param.h>
++# if defined(GC_OPENBSD_THREADS) && OpenBSD < 201211
+ # define UTHREAD_SP_OFFSET 332
+-# else
+-# include <sys/param.h>
++# endif
++# ifndef GC_OPENBSD_THREADS
+ # include <uvm/uvm_extern.h>
+ # define STACKBOTTOM USRSTACK
+ # endif
+@@ -2099,10 +2107,11 @@
+ # ifdef OPENBSD
+ # define OS_TYPE "OPENBSD"
+ # define ELF_CLASS ELFCLASS64
+-# ifdef GC_OPENBSD_THREADS
++# include <sys/param.h>
++# if defined(GC_OPENBSD_THREADS) && OpenBSD < 201211
+ # define UTHREAD_SP_OFFSET 400
+-# else
+-# include <sys/param.h>
++# endif
++# ifndef GC_OPENBSD_THREADS
+ # include <uvm/uvm_extern.h>
+ # define STACKBOTTOM USRSTACK
+ # endif
Index: patches/patch-include_private_pthread_stop_world_h
===================================================================
RCS file: patches/patch-include_private_pthread_stop_world_h
diff -N patches/patch-include_private_pthread_stop_world_h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-include_private_pthread_stop_world_h 30 May 2013 19:17:29
-0000
@@ -0,0 +1,27 @@
+$OpenBSD$
+--- include/private/pthread_stop_world.h.orig Thu Aug 9 16:25:13 2012
++++ include/private/pthread_stop_world.h Tue Mar 19 19:39:39 2013
+@@ -18,8 +18,22 @@
+ #ifndef GC_PTHREAD_STOP_WORLD_H
+ #define GC_PTHREAD_STOP_WORLD_H
+
++#if defined(GC_OPENBSD_THREADS)
++
++# include <sys/param.h>
++
++/*
++ * Beginning with the 5.2 release, OpenBSD has kernel supported threads.
++ * Only the userland thread model needs a non-standard approach.
++ */
++# if defined(OpenBSD) && OpenBSD < 201211
++# define GC_OPENBSD_UTHREADS 1
++# endif
++
++#endif /* GC_OPENBSD_THREADS */
++
+ struct thread_stop_info {
+-# ifndef GC_OPENBSD_THREADS
++# ifndef GC_OPENBSD_UTHREADS
+ word last_stop_count; /* GC_last_stop_count value when thread */
+ /* last successfully handled a suspend */
+ /* signal. */
Index: patches/patch-libatomic_ops-1_2_src_atomic_ops_h
===================================================================
RCS file: patches/patch-libatomic_ops-1_2_src_atomic_ops_h
diff -N patches/patch-libatomic_ops-1_2_src_atomic_ops_h
--- patches/patch-libatomic_ops-1_2_src_atomic_ops_h 1 Apr 2008 17:41:13
-0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,13 +0,0 @@
-$OpenBSD: patch-libatomic_ops-1_2_src_atomic_ops_h,v 1.1 2008/04/01 17:41:13
kurt Exp $
---- libatomic_ops-1.2/src/atomic_ops.h.orig Thu Jun 14 01:10:58 2007
-+++ libatomic_ops-1.2/src/atomic_ops.h Fri Mar 21 14:01:24 2008
-@@ -228,6 +228,9 @@
- # if defined(__cris__) || defined(CRIS)
- # include "atomic_ops/sysdeps/gcc/cris.h"
- # endif
-+# if defined(__mips__)
-+# include "atomic_ops/sysdeps/gcc/mips.h"
-+# endif
- #endif /* __GNUC__ && !AO_USE_PTHREAD_DEFS */
-
- #if defined(__INTEL_COMPILER) && !defined(AO_USE_PTHREAD_DEFS)
Index: patches/patch-libatomic_ops-1_2_src_atomic_ops_sysdeps_Makefile_am
===================================================================
RCS file: patches/patch-libatomic_ops-1_2_src_atomic_ops_sysdeps_Makefile_am
diff -N patches/patch-libatomic_ops-1_2_src_atomic_ops_sysdeps_Makefile_am
--- patches/patch-libatomic_ops-1_2_src_atomic_ops_sysdeps_Makefile_am 1 Apr
2008 17:41:13 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,11 +0,0 @@
-$OpenBSD: patch-libatomic_ops-1_2_src_atomic_ops_sysdeps_Makefile_am,v 1.1
2008/04/01 17:41:13 kurt Exp $
---- libatomic_ops-1.2/src/atomic_ops/sysdeps/Makefile.am.orig Tue Jun 5
18:06:20 2007
-+++ libatomic_ops-1.2/src/atomic_ops/sysdeps/Makefile.am Fri Mar 21
14:01:30 2008
-@@ -29,6 +29,7 @@ nobase_sysdep_HEADERS= generic_pthread.h \
- gcc/powerpc.h gcc/sparc.h \
- gcc/hppa.h gcc/m68k.h gcc/s390.h \
- gcc/ia64.h gcc/x86_64.h gcc/cris.h \
-+ gcc/mips.h \
- \
- icc/ia64.h \
- \
Index: patches/patch-libatomic_ops-1_2_src_atomic_ops_sysdeps_gcc_mips_h
===================================================================
RCS file: patches/patch-libatomic_ops-1_2_src_atomic_ops_sysdeps_gcc_mips_h
diff -N patches/patch-libatomic_ops-1_2_src_atomic_ops_sysdeps_gcc_mips_h
--- patches/patch-libatomic_ops-1_2_src_atomic_ops_sysdeps_gcc_mips_h 1 Apr
2008 17:41:13 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,93 +0,0 @@
-$OpenBSD: patch-libatomic_ops-1_2_src_atomic_ops_sysdeps_gcc_mips_h,v 1.1
2008/04/01 17:41:13 kurt Exp $
---- libatomic_ops-1.2/src/atomic_ops/sysdeps/gcc/mips.h.orig Fri Mar 21
14:01:24 2008
-+++ libatomic_ops-1.2/src/atomic_ops/sysdeps/gcc/mips.h Fri Mar 21
14:01:24 2008
-@@ -0,0 +1,89 @@
-+/*
-+ * Copyright (c) 2005 Thiemo Seufer <[email protected]>
-+ * Copyright (c) 2007 Zhang Le <[email protected]>
-+ *
-+ * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
-+ * OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
-+ *
-+ * Permission is hereby granted to use or copy this program
-+ * for any purpose, provided the above notices are retained on all copies.
-+ * Permission to modify the code and to distribute modified code is granted,
-+ * provided the above notices are retained, and a notice that the code was
-+ * modified is included with the above copyright notice.
-+ */
-+
-+#include "../all_aligned_atomic_load_store.h"
-+#include "../test_and_set_t_is_ao_t.h"
-+
-+/* Data dependence does not imply read ordering. */
-+#define AO_NO_DD_ORDERING
-+
-+AO_INLINE void
-+AO_nop_full()
-+{
-+ __asm__ __volatile__(
-+ " .set push \n"
-+ " .set mips3 \n"
-+ " .set noreorder \n"
-+ " .set nomacro \n"
-+ " sync \n"
-+ " .set pop "
-+ : : : "memory");
-+}
-+
-+#define AO_HAVE_nop_full
-+
-+AO_INLINE int
-+AO_compare_and_swap(volatile AO_t *addr, AO_t old, AO_t new_val)
-+{
-+ register int was_equal = 0;
-+ register int temp;
-+
-+ __asm__ __volatile__(
-+ " .set push \n"
-+ " .set mips3 \n"
-+ " .set noreorder \n"
-+ " .set nomacro \n"
-+ "1: ll %0, %1 \n"
-+ " bne %0, %4, 2f \n"
-+ " move %0, %3 \n"
-+ " sc %0, %1 \n"
-+ " .set pop \n"
-+ " beqz %0, 1b \n"
-+ " li %2, 1 \n"
-+ "2: "
-+ : "=&r" (temp), "+R" (*addr), "+r" (was_equal)
-+ : "r" (new_val), "r" (old)
-+ : "memory");
-+ return was_equal;
-+}
-+
-+#define AO_HAVE_compare_and_swap
-+
-+AO_INLINE AO_t
-+AO_fetch_and_add_full (volatile AO_t *p, AO_t incr)
-+{
-+ AO_t result, temp;
-+ __asm__ __volatile__(
-+ " .set push \n"
-+ " .set mips3 \n"
-+ " .set noreorder \n"
-+ " .set nomacro \n"
-+ "1: ll %1, %2 \n"
-+ " addu %0, %1, %3 \n"
-+ " sc %0, %2 \n"
-+ " beqz %0, 1b \n"
-+ " addu %0, %1, %3 \n"
-+ " sync \n"
-+ " .set pop \n"
-+ : "=&r" (result), "=&r" (temp), "=m" (*p)
-+ : "r" (incr), "m" (*p)
-+ : "memory");
-+ return result;
-+}
-+
-+#define AO_HAVE_fetch_and_add_full
-+
-+/*
-+ * FIXME: fetch_and_add_full implemented, any others?
-+ */
Index: patches/patch-mach_dep_c
===================================================================
RCS file: patches/patch-mach_dep_c
diff -N patches/patch-mach_dep_c
--- patches/patch-mach_dep_c 14 Jul 2007 22:16:17 -0000 1.4
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,21 +0,0 @@
-$OpenBSD: patch-mach_dep_c,v 1.4 2007/07/14 22:16:17 kili Exp $
---- mach_dep.c.orig Wed Jul 11 12:46:22 2007
-+++ mach_dep.c Wed Jul 11 12:58:50 2007
-@@ -159,7 +159,7 @@ void GC_push_regs()
- # undef HAVE_PUSH_REGS
- #endif
-
--#if !defined(HAVE_PUSH_REGS) && defined(UNIX_LIKE)
-+#if !defined(HAVE_PUSH_REGS) && defined(UNIX_LIKE) && !defined(OPENBSD)
- # include <ucontext.h>
- #endif
-
-@@ -174,7 +174,7 @@ void GC_with_callee_saves_pushed(void (*fn)(ptr_t, voi
-
- # if defined(HAVE_PUSH_REGS)
- GC_push_regs();
--# elif defined(UNIX_LIKE) && !defined(DARWIN) && !defined(ARM32)
-+# elif defined(UNIX_LIKE) && !defined(DARWIN) && !defined(ARM32) &&
!defined(OPENBSD)
- /* Older versions of Darwin seem to lack getcontext(). */
- /* ARM Linux often doesn't support a real getcontext(). */
- ucontext_t ctxt;
Index: patches/patch-misc_c
===================================================================
RCS file: patches/patch-misc_c
diff -N patches/patch-misc_c
--- patches/patch-misc_c 1 Apr 2008 17:41:13 -0000 1.7
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,11 +0,0 @@
---- misc.c.orig Thu Jun 28 14:14:55 2007
-+++ misc.c Fri Feb 8 09:43:48 2008
-@@ -629,7 +629,7 @@ void GC_init_inner()
- # if defined(SEARCH_FOR_DATA_START)
- GC_init_linux_data_start();
- # endif
--# if (defined(NETBSD) || defined(OPENBSD)) && defined(__ELF__)
-+# if defined(NETBSD) && defined(__ELF__)
- GC_init_netbsd_elf();
- # endif
- # if !defined(THREADS) || defined(GC_PTHREADS) || defined(GC_WIN32_THREADS)
\
Index: patches/patch-os_dep_c
===================================================================
RCS file: patches/patch-os_dep_c
diff -N patches/patch-os_dep_c
--- patches/patch-os_dep_c 22 Feb 2012 12:31:42 -0000 1.8
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,185 +0,0 @@
---- os_dep.c.orig Fri Jun 29 15:17:44 2007
-+++ os_dep.c Sun Feb 19 13:28:15 2012
-@@ -486,7 +486,7 @@ static void *tiny_sbrk(ptrdiff_t increment)
- #define sbrk tiny_sbrk
- # endif /* ECOS */
-
--#if (defined(NETBSD) || defined(OPENBSD)) && defined(__ELF__)
-+#if defined(NETBSD) && defined(__ELF__)
- ptr_t GC_data_start;
-
- void GC_init_netbsd_elf(void)
-@@ -499,6 +499,86 @@ static void *tiny_sbrk(ptrdiff_t increment)
- }
- #endif
-
-+#if defined(OPENBSD)
-+ static struct sigaction old_segv_act;
-+ sigjmp_buf GC_jmp_buf_openbsd;
-+
-+ /*ARGSUSED*/
-+ void GC_fault_handler_openbsd(int sig)
-+ {
-+ siglongjmp(GC_jmp_buf_openbsd, 1);
-+ }
-+
-+ /* Return the first nonaddressible location > p or bound */
-+ /* Requires allocation lock. */
-+ ptr_t GC_find_limit_openbsd(ptr_t p, ptr_t bound)
-+ {
-+ static volatile ptr_t result;
-+ /* Safer if static, since otherwise it may not be */
-+ /* preserved across the longjmp. Can safely be */
-+ /* static since it's only called with the */
-+ /* allocation lock held. */
-+ struct sigaction act;
-+ size_t pgsz = (size_t)sysconf(_SC_PAGESIZE);
-+
-+ GC_ASSERT(I_HOLD_LOCK());
-+
-+ act.sa_handler = GC_fault_handler_openbsd;
-+ sigemptyset(&act.sa_mask);
-+ act.sa_flags = SA_NODEFER | SA_RESTART;
-+ sigaction(SIGSEGV, &act, &old_segv_act);
-+
-+ if (sigsetjmp(GC_jmp_buf_openbsd, 1) == 0) {
-+ result = (ptr_t)(((word)(p)) & ~(pgsz-1));
-+ for (;;) {
-+ result += pgsz;
-+ if (result >= bound) {
-+ result = bound;
-+ break;
-+ }
-+ GC_noop1((word)(*result));
-+ }
-+ }
-+
-+ sigaction(SIGSEGV, &old_segv_act, 0);
-+
-+ return(result);
-+ }
-+
-+ /* Return first addressable location > p or bound */
-+ /* Requires allocation lock. */
-+ ptr_t GC_skip_hole_openbsd(ptr_t p, ptr_t bound)
-+ {
-+ static volatile ptr_t result;
-+ struct sigaction act;
-+ size_t pgsz = (size_t)sysconf(_SC_PAGESIZE);
-+ static volatile int firstpass;
-+
-+ GC_ASSERT(I_HOLD_LOCK());
-+
-+ act.sa_handler = GC_fault_handler_openbsd;
-+ sigemptyset(&act.sa_mask);
-+ act.sa_flags = SA_NODEFER | SA_RESTART;
-+ sigaction(SIGSEGV, &act, &old_segv_act);
-+
-+ firstpass = 1;
-+ result = (ptr_t)(((word)(p)) & ~(pgsz-1));
-+ if (sigsetjmp(GC_jmp_buf_openbsd, 1) != 0 || firstpass) {
-+ firstpass = 0;
-+ result += pgsz;
-+ if (result >= bound) {
-+ result = bound;
-+ } else
-+ GC_noop1((word)(*result));
-+ }
-+
-+ sigaction(SIGSEGV, &old_segv_act, 0);
-+
-+ return(result);
-+ }
-+#endif
-+
-+
- # ifdef OS2
-
- # include <stddef.h>
-@@ -1097,7 +1177,7 @@ ptr_t GC_get_main_stack_base(void)
-
- #if !defined(BEOS) && !defined(AMIGA) && !defined(MSWIN32) \
- && !defined(MSWINCE) && !defined(OS2) && !defined(NOSYS) &&
!defined(ECOS) \
-- && !defined(CYGWIN32)
-+ && !defined(CYGWIN32) && !defined(GC_OPENBSD_THREADS)
-
- ptr_t GC_get_main_stack_base(void)
- {
-@@ -1206,6 +1286,35 @@ int GC_get_stack_base(struct GC_stack_base *b)
-
- #endif /* GC_LINUX_THREADS */
-
-+#if defined(GC_OPENBSD_THREADS)
-+
-+/* Find the stack using pthread_stackseg_np() */
-+
-+# include <sys/signal.h>
-+# include <pthread.h>
-+# include <pthread_np.h>
-+
-+#define HAVE_GET_STACK_BASE
-+
-+int GC_get_stack_base(struct GC_stack_base *sb)
-+{
-+ stack_t stack;
-+ pthread_stackseg_np(pthread_self(), &stack);
-+ sb->mem_base = stack.ss_sp;
-+ return GC_SUCCESS;
-+}
-+
-+/* This is always called from the main thread. */
-+ptr_t GC_get_main_stack_base(void)
-+{
-+ struct GC_stack_base sb;
-+
-+ GC_get_stack_base(&sb);
-+ return (ptr_t)sb.mem_base;
-+}
-+
-+#endif /* GC_OPENBSD_THREADS */
-+
- #ifndef HAVE_GET_STACK_BASE
- /* Retrieve stack base. */
- /* Using the GC_find_limit version is risky. */
-@@ -1660,8 +1769,33 @@ ptr_t GC_FreeBSDGetDataStart(size_t max_page_size, ptr
-
- #else /* !OS2 && !Windows && !AMIGA */
-
-+#if defined(OPENBSD)
-+
-+/*
-+ * Depending on arch alignment there can be multiple holes
-+ * between DATASTART & DATAEND. Scan from DATASTART - DATAEND
-+ * and register each region.
-+ */
- void GC_register_data_segments(void)
- {
-+ ptr_t region_start, region_end;
-+
-+ region_start = DATASTART;
-+
-+ for(;;) {
-+ region_end = GC_find_limit_openbsd(region_start, DATAEND);
-+ GC_add_roots_inner(region_start, region_end, FALSE);
-+ if (region_end < DATAEND)
-+ region_start = GC_skip_hole_openbsd(region_end, DATAEND);
-+ else
-+ break;
-+ }
-+}
-+
-+# else /* !OS2 && !Windows && !AMIGA && !OPENBSD */
-+
-+void GC_register_data_segments(void)
-+{
- # if !defined(PCR) && !defined(MACOS)
- # if defined(REDIRECT_MALLOC) && defined(GC_SOLARIS_THREADS)
- /* As of Solaris 2.3, the Solaris threads implementation */
-@@ -1717,6 +1851,7 @@ void GC_register_data_segments(void)
- /* change.
*/
- }
-
-+# endif /* ! OPENBSD */
- # endif /* ! AMIGA */
- # endif /* ! MSWIN32 && ! MSWINCE*/
- # endif /* ! OS2 */
Index: patches/patch-pthread_stop_world_c
===================================================================
RCS file: patches/patch-pthread_stop_world_c
diff -N patches/patch-pthread_stop_world_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-pthread_stop_world_c 30 May 2013 19:17:29 -0000
@@ -0,0 +1,120 @@
+$OpenBSD$
+--- pthread_stop_world.c.orig Thu Aug 9 16:25:13 2012
++++ pthread_stop_world.c Tue Mar 19 19:41:04 2013
+@@ -35,7 +35,7 @@ GC_INNER __thread GC_thread GC_nacl_gc_thread_self = N
+ int GC_nacl_thread_parked[MAX_NACL_GC_THREADS];
+ int GC_nacl_thread_used[MAX_NACL_GC_THREADS];
+
+-#elif !defined(GC_OPENBSD_THREADS)
++#elif !defined(GC_OPENBSD_UTHREADS)
+
+ #include <signal.h>
+ #include <semaphore.h>
+@@ -298,7 +298,7 @@ STATIC void GC_restart_handler(int sig)
+ # endif
+ }
+
+-#endif /* !GC_OPENBSD_THREADS && !NACL */
++#endif /* !GC_OPENBSD_UTHREADS && !NACL */
+
+ #ifdef IA64
+ # define IF_IA64(x) x
+@@ -422,7 +422,7 @@ STATIC int GC_suspend_all(void)
+
+ # ifndef NACL
+ GC_thread p;
+-# ifndef GC_OPENBSD_THREADS
++# ifndef GC_OPENBSD_UTHREADS
+ int result;
+ # endif
+ pthread_t self = pthread_self();
+@@ -436,7 +436,7 @@ STATIC int GC_suspend_all(void)
+ if (!THREAD_EQUAL(p -> id, self)) {
+ if (p -> flags & FINISHED) continue;
+ if (p -> thread_blocked) /* Will wait */ continue;
+-# ifndef GC_OPENBSD_THREADS
++# ifndef GC_OPENBSD_UTHREADS
+ if (p -> stop_info.last_stop_count == GC_stop_count) continue;
+ n_live_threads++;
+ # endif
+@@ -445,7 +445,7 @@ STATIC int GC_suspend_all(void)
+ (unsigned)(p -> id));
+ # endif
+
+-# ifdef GC_OPENBSD_THREADS
++# ifdef GC_OPENBSD_UTHREADS
+ {
+ stack_t stack;
+ if (pthread_suspend_np(p -> id) != 0)
+@@ -523,7 +523,7 @@ STATIC int GC_suspend_all(void)
+
+ GC_INNER void GC_stop_world(void)
+ {
+-# if !defined(GC_OPENBSD_THREADS) && !defined(NACL)
++# if !defined(GC_OPENBSD_UTHREADS) && !defined(NACL)
+ int i;
+ int n_live_threads;
+ int code;
+@@ -545,7 +545,7 @@ GC_INNER void GC_stop_world(void)
+ }
+ # endif /* PARALLEL_MARK */
+
+-# if defined(GC_OPENBSD_THREADS) || defined(NACL)
++# if defined(GC_OPENBSD_UTHREADS) || defined(NACL)
+ (void)GC_suspend_all();
+ # else
+ AO_store(&GC_stop_count, GC_stop_count+1);
+@@ -735,7 +735,7 @@ GC_INNER void GC_start_world(void)
+ pthread_t self = pthread_self();
+ register int i;
+ register GC_thread p;
+-# ifndef GC_OPENBSD_THREADS
++# ifndef GC_OPENBSD_UTHREADS
+ register int n_live_threads = 0;
+ register int result;
+ # endif
+@@ -747,7 +747,7 @@ GC_INNER void GC_start_world(void)
+ GC_log_printf("World starting\n");
+ # endif
+
+-# ifndef GC_OPENBSD_THREADS
++# ifndef GC_OPENBSD_UTHREADS
+ AO_store(&GC_world_is_stopped, FALSE);
+ # endif
+ for (i = 0; i < THREAD_TABLE_SZ; i++) {
+@@ -755,7 +755,7 @@ GC_INNER void GC_start_world(void)
+ if (!THREAD_EQUAL(p -> id, self)) {
+ if (p -> flags & FINISHED) continue;
+ if (p -> thread_blocked) continue;
+-# ifndef GC_OPENBSD_THREADS
++# ifndef GC_OPENBSD_UTHREADS
+ n_live_threads++;
+ # endif
+ # ifdef DEBUG_THREADS
+@@ -763,7 +763,7 @@ GC_INNER void GC_start_world(void)
+ (unsigned)(p -> id));
+ # endif
+
+-# ifdef GC_OPENBSD_THREADS
++# ifdef GC_OPENBSD_UTHREADS
+ if (pthread_resume_np(p -> id) != 0)
+ ABORT("pthread_resume_np failed");
+ # else
+@@ -810,7 +810,7 @@ GC_INNER void GC_start_world(void)
+
+ GC_INNER void GC_stop_init(void)
+ {
+-# if !defined(GC_OPENBSD_THREADS) && !defined(NACL)
++# if !defined(GC_OPENBSD_UTHREADS) && !defined(NACL)
+ struct sigaction act;
+
+ if (sem_init(&GC_suspend_ack_sem, GC_SEM_INIT_PSHARED, 0) != 0)
+@@ -873,7 +873,7 @@ GC_INNER void GC_stop_init(void)
+ if (GC_print_stats && GC_retry_signals) {
+ GC_log_printf("Will retry suspend signal if necessary\n");
+ }
+-# endif /* !GC_OPENBSD_THREADS && !NACL */
++# endif /* !GC_OPENBSD_UTHREADS && !NACL */
+ }
+
+ #endif
Index: patches/patch-pthread_support_c
===================================================================
RCS file: patches/patch-pthread_support_c
diff -N patches/patch-pthread_support_c
--- patches/patch-pthread_support_c 30 Apr 2012 15:33:16 -0000 1.3
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,43 +0,0 @@
-$OpenBSD: patch-pthread_support_c,v 1.3 2012/04/30 15:33:16 kurt Exp $
---- pthread_support.c.orig Tue May 15 01:24:46 2007
-+++ pthread_support.c Tue Mar 6 10:24:21 2012
-@@ -763,7 +763,7 @@ void GC_thr_init(void)
- GC_nprocs = pthread_num_processors_np();
- # endif
- # if defined(GC_OSF1_THREADS) || defined(GC_AIX_THREADS) \
-- || defined(GC_SOLARIS_THREADS)
-+ || defined(GC_SOLARIS_THREADS) || defined(GC_OPENBSD_THREADS)
- GC_nprocs = sysconf(_SC_NPROCESSORS_ONLN);
- if (GC_nprocs <= 0) GC_nprocs = 1;
- # endif
-@@ -848,7 +848,7 @@ void GC_init_parallel(void)
- }
-
-
--#if !defined(GC_DARWIN_THREADS)
-+#if !defined(GC_DARWIN_THREADS) && !defined(GC_OPENBSD_THREADS)
- int WRAP_FUNC(pthread_sigmask)(int how, const sigset_t *set, sigset_t *oset)
- {
- sigset_t fudged_set;
-@@ -1103,6 +1103,12 @@ void * GC_start_routine(void * arg)
- GC_enable();
- # endif
- return GC_inner_start_routine(&sb, arg);
-+# elif defined(GC_OPENBSD_THREADS)
-+ /* On OpenBSD GC_get_stack_base() doesn't cause any allocations */
-+ struct GC_stack_base sb;
-+ if (GC_get_stack_base(&sb) != GC_SUCCESS)
-+ ABORT("Failed to get thread stack base.");
-+ return GC_inner_start_routine(&sb, arg);
- # else
- return GC_call_with_stack_base(GC_inner_start_routine, arg);
- # endif
-@@ -1297,7 +1303,7 @@ void GC_generic_lock(pthread_mutex_t * lock)
- /* as STL alloc.h. This isn't really the right way to do this. */
- /* but until the POSIX scheduling mess gets straightened out ... */
-
--volatile AO_TS_t GC_allocate_lock = 0;
-+volatile AO_TS_t GC_allocate_lock = AO_TS_INITIALIZER;
-
-
- void GC_lock(void)
Index: patches/patch-tests_test_c
===================================================================
RCS file: patches/patch-tests_test_c
diff -N patches/patch-tests_test_c
--- patches/patch-tests_test_c 14 Jul 2007 22:16:17 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,13 +0,0 @@
-$OpenBSD: patch-tests_test_c,v 1.1 2007/07/14 22:16:17 kili Exp $
---- tests/test.c.orig Mon Jun 18 18:18:01 2007
-+++ tests/test.c Thu Jul 12 11:19:28 2007
-@@ -1579,7 +1579,8 @@ int main()
-
- pthread_attr_init(&attr);
- # if defined(GC_IRIX_THREADS) || defined(GC_FREEBSD_THREADS) \
-- || defined(GC_DARWIN_THREADS) || defined(GC_AIX_THREADS)
-+ || defined(GC_DARWIN_THREADS) || defined(GC_AIX_THREADS) \
-+ || defined(GC_OPENBSD_THREADS)
- pthread_attr_setstacksize(&attr, 1000000);
- # endif
- n_tests = 0;
Index: patches/patch-threadlibs_c
===================================================================
RCS file: patches/patch-threadlibs_c
diff -N patches/patch-threadlibs_c
--- patches/patch-threadlibs_c 14 Jul 2007 22:16:17 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,13 +0,0 @@
-$OpenBSD: patch-threadlibs_c,v 1.1 2007/07/14 22:16:17 kili Exp $
---- threadlibs.c.orig Thu Jul 12 08:56:01 2007
-+++ threadlibs.c Thu Jul 12 08:58:02 2007
-@@ -18,6 +18,9 @@ int main()
- # endif
- printf("-lpthread\n");
- # endif
-+# if defined(GC_OPENBSD_THREADS)
-+ printf("-pthread\n");
-+# endif
- # if defined(GC_FREEBSD_THREADS)
- # ifdef GC_USE_DLOPEN_WRAP
- printf("-ldl ");
Index: pkg/PFRAG.shared-main
===================================================================
RCS file: pkg/PFRAG.shared-main
diff -N pkg/PFRAG.shared-main
--- pkg/PFRAG.shared-main 1 Jul 2008 09:43:19 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,3 +0,0 @@
-@comment $OpenBSD: PFRAG.shared-main,v 1.1 2008/07/01 09:43:19 landry Exp $
-@lib lib/libcord.so.${LIBcord_VERSION}
-@lib lib/libgc.so.${LIBgc_VERSION}
Index: pkg/PLIST-atomic
===================================================================
RCS file: /cvs/ports/devel/boehm-gc/pkg/PLIST-atomic,v
retrieving revision 1.1
diff -u -p -r1.1 PLIST-atomic
--- pkg/PLIST-atomic 1 Jul 2008 09:43:19 -0000 1.1
+++ pkg/PLIST-atomic 30 May 2013 19:17:29 -0000
@@ -11,6 +11,8 @@ include/atomic_ops/sysdeps/all_acquire_r
include/atomic_ops/sysdeps/all_aligned_atomic_load_store.h
include/atomic_ops/sysdeps/all_atomic_load_store.h
include/atomic_ops/sysdeps/ao_t_is_int.h
+include/atomic_ops/sysdeps/armcc/
+include/atomic_ops/sysdeps/armcc/arm_v6.h
include/atomic_ops/sysdeps/atomic_load_store.h
include/atomic_ops/sysdeps/char_acquire_release_volatile.h
include/atomic_ops/sysdeps/char_atomic_load_store.h
@@ -18,12 +20,16 @@ include/atomic_ops/sysdeps/emul_cas.h
include/atomic_ops/sysdeps/gcc/
include/atomic_ops/sysdeps/gcc/alpha.h
include/atomic_ops/sysdeps/gcc/arm.h
+include/atomic_ops/sysdeps/gcc/avr32.h
include/atomic_ops/sysdeps/gcc/cris.h
+include/atomic_ops/sysdeps/gcc/hexagon.h
include/atomic_ops/sysdeps/gcc/hppa.h
include/atomic_ops/sysdeps/gcc/ia64.h
include/atomic_ops/sysdeps/gcc/m68k.h
+include/atomic_ops/sysdeps/gcc/mips.h
include/atomic_ops/sysdeps/gcc/powerpc.h
include/atomic_ops/sysdeps/gcc/s390.h
+include/atomic_ops/sysdeps/gcc/sh.h
include/atomic_ops/sysdeps/gcc/sparc.h
include/atomic_ops/sysdeps/gcc/x86.h
include/atomic_ops/sysdeps/gcc/x86_64.h
@@ -39,6 +45,8 @@ include/atomic_ops/sysdeps/int_acquire_r
include/atomic_ops/sysdeps/int_aligned_atomic_load_store.h
include/atomic_ops/sysdeps/int_atomic_load_store.h
include/atomic_ops/sysdeps/msftc/
+include/atomic_ops/sysdeps/msftc/arm.h
+include/atomic_ops/sysdeps/msftc/common32_defs.h
include/atomic_ops/sysdeps/msftc/x86.h
include/atomic_ops/sysdeps/msftc/x86_64.h
include/atomic_ops/sysdeps/ordered.h
@@ -50,12 +58,16 @@ include/atomic_ops/sysdeps/short_atomic_
include/atomic_ops/sysdeps/standard_ao_double_t.h
include/atomic_ops/sysdeps/sunc/
include/atomic_ops/sysdeps/sunc/sparc.h
+include/atomic_ops/sysdeps/sunc/x86.h
+include/atomic_ops/sysdeps/sunc/x86_64.h
include/atomic_ops/sysdeps/test_and_set_t_is_ao_t.h
include/atomic_ops/sysdeps/test_and_set_t_is_char.h
include/atomic_ops_malloc.h
include/atomic_ops_stack.h
lib/libatomic_ops.a
lib/libatomic_ops_gpl.a
+lib/pkgconfig/
+lib/pkgconfig/atomic_ops.pc
share/libatomic_ops/
share/libatomic_ops/COPYING
share/libatomic_ops/LICENSING.txt
Index: pkg/PLIST-main
===================================================================
RCS file: /cvs/ports/devel/boehm-gc/pkg/PLIST-main,v
retrieving revision 1.1
diff -u -p -r1.1 PLIST-main
--- pkg/PLIST-main 1 Jul 2008 09:43:19 -0000 1.1
+++ pkg/PLIST-main 30 May 2013 19:17:29 -0000
@@ -1,7 +1,8 @@
@comment $OpenBSD: PLIST-main,v 1.1 2008/07/01 09:43:19 landry Exp $
@pkgpath devel/boehm-gc
-%%SHARED%%
include/gc/
+include/gc.h
+include/gc/cord.h
include/gc/gc.h
include/gc/gc_allocator.h
include/gc/gc_amiga_redirects.h
@@ -14,13 +15,20 @@ include/gc/gc_mark.h
include/gc/gc_pthread_redirects.h
include/gc/gc_tiny_fl.h
include/gc/gc_typed.h
+include/gc/gc_version.h
include/gc/leak_detector.h
include/gc/new_gc_alloc.h
include/gc/weakpointer.h
+include/gc_cpp.h
lib/libcord.a
lib/libcord.la
+@lib lib/libcord.so.${LIBcord_VERSION}
lib/libgc.a
lib/libgc.la
+@lib lib/libgc.so.${LIBgc_VERSION}
+lib/libgccpp.a
+lib/libgccpp.la
+@lib lib/libgccpp.so.${LIBgccpp_VERSION}
lib/pkgconfig/
lib/pkgconfig/bdw-gc.pc
@man man/man3/GC_enable_incremental.3
@@ -43,6 +51,7 @@ share/gc/README.amiga
share/gc/README.arm.cross
share/gc/README.autoconf
share/gc/README.changes
+share/gc/README.cmake
share/gc/README.contributors
share/gc/README.cords
share/gc/README.darwin