- update and use OpenBSD threads in boehm-gc, from myself and kurt@. gcj-dbtool

still doesn't work.
- update gcc4.port.mk for gcc 4.6: always use libestdc++
This commit is contained in:
pascal 2011-11-22 21:46:39 +00:00
parent 25f003cf8a
commit 362ff059e3
12 changed files with 144 additions and 61 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: gcc4.port.mk,v 1.3 2011/11/19 22:19:53 pascal Exp $
# $OpenBSD: gcc4.port.mk,v 1.4 2011/11/22 21:46:39 pascal Exp $
MODGCC4_ARCHS ?=
MODGCC4_LANGS ?=
@ -32,22 +32,17 @@ COMPILER_VERSION ?= gcc2
_MODGCC4_LINKS =
.if ${_MODGCC4_ARCH_USES:L} == "yes"
. if ${MODGCC4_LANGS:L:Mc} && ${COMPILER_VERSION:L:Ngcc4*}
. if ${MODGCC4_LANGS:L:Mc}
BUILD_DEPENDS += lang/gcc/4.6>=4.6,<4.7
_MODGCC4_LINKS += egcc gcc egcc cc
. endif
. if ${MODGCC4_LANGS:L:Mc++}
. if ${COMPILER_VERSION:L:Mgcc4*}
MODGCC4STDCPP = stdc++
WANTLIB += stdc++>=53.0
. else
BUILD_DEPENDS += lang/gcc/4.6,-c++>=4.6,<4.7
MODGCC4STDCPP = estdc++
LIB_DEPENDS += lang/gcc/4.6,-estdc>=4.6,<4.7
WANTLIB += estdc++>=12
_MODGCC4_LINKS += eg++ g++ eg++ c++
. endif
. endif
. if ${MODGCC4_LANGS:L:Mfortran}

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-boehm-gc_Makefile_in,v 1.1.1.1 2011/11/14 13:00:57 pascal Exp $
--- boehm-gc/Makefile.in.orig Sat Nov 12 10:20:15 2011
+++ boehm-gc/Makefile.in Sat Nov 12 10:23:12 2011
$OpenBSD: patch-boehm-gc_Makefile_in,v 1.2 2011/11/22 21:46:39 pascal Exp $
--- boehm-gc/Makefile.in.orig Wed Oct 26 11:30:24 2011
+++ boehm-gc/Makefile.in Tue Nov 22 14:06:34 2011
@@ -64,6 +64,7 @@ CONFIG_CLEAN_VPATH_FILES =
LTLIBRARIES = $(noinst_LTLIBRARIES)
am__DEPENDENCIES_1 =
@ -18,16 +18,13 @@ $OpenBSD: patch-boehm-gc_Makefile_in,v 1.1.1.1 2011/11/14 13:00:57 pascal Exp $
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
@@ -287,8 +290,11 @@ AUTOMAKE_OPTIONS = cygnus subdir-objects
@@ -287,8 +290,8 @@ AUTOMAKE_OPTIONS = cygnus subdir-objects
ACLOCAL_AMFLAGS = -I .. -I ../config
SUBDIRS = include
noinst_LTLIBRARIES = libgcjgc.la libgcjgc_convenience.la
-@POWERPC_DARWIN_FALSE@asm_libgcjgc_sources =
@POWERPC_DARWIN_TRUE@asm_libgcjgc_sources = powerpc_darwin_mach_dep.s
+@OPENBSD_THREADS_TRUE@asm_libgcjgc_sources = openbsd_stop_world.c.s
+libgcjgc_la_SOURCES = allchblk.c alloc.c blacklst.c checksums.c dbg_mlc.c \
+dyn_load.c finalize.c gc_dlopen.c gcj_mlc.c headers.c \
+malloc.c mallocx.c mark.c mark_rts.c misc.c new_hblk.c \
libgcjgc_la_SOURCES = allchblk.c alloc.c blacklst.c checksums.c dbg_mlc.c \
dyn_load.c finalize.c gc_dlopen.c gcj_mlc.c headers.c \
malloc.c mallocx.c mark.c mark_rts.c misc.c new_hblk.c \

View File

@ -1,7 +1,16 @@
$OpenBSD: patch-boehm-gc_configure,v 1.1.1.1 2011/11/14 13:00:57 pascal Exp $
--- boehm-gc/configure.orig Sat Nov 12 09:45:26 2011
+++ boehm-gc/configure Sat Nov 12 09:53:37 2011
@@ -14855,6 +14855,12 @@ $as_echo "#define _REENTRANT 1" >>confdefs.h
$OpenBSD: patch-boehm-gc_configure,v 1.2 2011/11/22 21:46:39 pascal Exp $
--- boehm-gc/configure.orig Wed Oct 26 11:30:24 2011
+++ boehm-gc/configure Sun Nov 20 19:15:55 2011
@@ -615,6 +615,8 @@ CPLUSPLUS_TRUE
target_all
EXTRA_TEST_LIBS
extra_ldflags_libgc
+OPENBSD_THREADS_TRUE
+OPENBSD_THREADS_FALSE
POWERPC_DARWIN_FALSE
POWERPC_DARWIN_TRUE
THREADLIBS
@@ -14855,6 +14857,12 @@ $as_echo "#define _REENTRANT 1" >>confdefs.h
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"Only HP-UX 11 POSIX threads are supported.\"" >&5
$as_echo "$as_me: WARNING: \"Only HP-UX 11 POSIX threads are supported.\"" >&2;}
;;
@ -14,7 +23,7 @@ $OpenBSD: patch-boehm-gc_configure,v 1.1.1.1 2011/11/14 13:00:57 pascal Exp $
*-*-kfreebsd*-gnu)
$as_echo "#define GC_FREEBSD_THREADS 1" >>confdefs.h
@@ -14995,6 +15001,13 @@ else
@@ -14995,6 +15003,13 @@ else
POWERPC_DARWIN_FALSE=
fi
@ -28,7 +37,7 @@ $OpenBSD: patch-boehm-gc_configure,v 1.1.1.1 2011/11/14 13:00:57 pascal Exp $
# Darwin needs a few extra special tests to deal with variation in the
# system headers.
@@ -15294,6 +15307,9 @@ $as_echo "#define DATASTART_IS_ETEXT 1" >>confdefs.h
@@ -15294,6 +15309,9 @@ $as_echo "#define DATASTART_IS_ETEXT 1" >>confdefs.h
;;
sparc-*-netbsd*)
machdep="sparc_netbsd_mach_dep.lo"

View File

@ -1,14 +1,23 @@
$OpenBSD: patch-boehm-gc_include_gc_config_macros_h,v 1.1.1.1 2011/11/14 13:00:57 pascal Exp $
--- boehm-gc/include/gc_config_macros.h.orig Sat Nov 12 09:56:59 2011
+++ boehm-gc/include/gc_config_macros.h Sat Nov 12 09:57:55 2011
@@ -55,6 +55,10 @@
# define GC_FREEBSD_THREADS
$OpenBSD: patch-boehm-gc_include_gc_config_macros_h,v 1.2 2011/11/22 21:46:39 pascal Exp $
--- boehm-gc/include/gc_config_macros.h.orig Mon Jul 2 16:56:58 2007
+++ boehm-gc/include/gc_config_macros.h Sun Nov 20 23:20:59 2011
@@ -20,7 +20,7 @@
defined(GC_IRIX_THREADS) || defined(GC_LINUX_THREADS) || \
defined(GC_HPUX_THREADS) || defined(GC_OSF1_THREADS) || \
defined(GC_DGUX386_THREADS) || defined(GC_DARWIN_THREADS) || \
- defined(GC_AIX_THREADS) || \
+ defined(GC_AIX_THREADS) || defined(GC_OPENBSD_THREADS) || \
(defined(GC_WIN32_THREADS) && defined(__CYGWIN32__))
# define GC_PTHREADS
# endif
+# if !defined(GC_PTHREADS) && defined(__OpenBSD__)
+# define GC_FREEBSD_THREADS
@@ -53,6 +53,10 @@
# endif
# if !defined(GC_PTHREADS) && defined(__FreeBSD__)
# define GC_FREEBSD_THREADS
+# define GC_PTHREADS
+# endif
# if defined(DGUX) && (defined(i386) || defined(__i386__))
# define GC_DGUX386_THREADS
+# if !defined(GC_PTHREADS) && defined(__OpenBSD__)
+# define GC_OPENBSD_THREADS
# define GC_PTHREADS
# endif
# if defined(DGUX) && (defined(i386) || defined(__i386__))

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-boehm-gc_include_gc_pthread_redirects_h,v 1.1.1.1 2011/11/14 13:00:57 pascal Exp $
--- boehm-gc/include/gc_pthread_redirects.h.orig Sat Nov 12 09:59:52 2011
+++ boehm-gc/include/gc_pthread_redirects.h Sat Nov 12 10:01:19 2011
$OpenBSD: patch-boehm-gc_include_gc_pthread_redirects_h,v 1.2 2011/11/22 21:46:39 pascal Exp $
--- boehm-gc/include/gc_pthread_redirects.h.orig Tue Aug 22 00:07:30 2006
+++ boehm-gc/include/gc_pthread_redirects.h Tue Nov 22 14:08:19 2011
@@ -52,7 +52,7 @@
int GC_pthread_create(pthread_t *new_thread,
const pthread_attr_t *attr,
@ -10,12 +10,16 @@ $OpenBSD: patch-boehm-gc_include_gc_pthread_redirects_h,v 1.1.1.1 2011/11/14 13:
int GC_pthread_sigmask(int how, const sigset_t *set, sigset_t *oset);
#endif
int GC_pthread_join(pthread_t thread, void **retval);
@@ -72,7 +72,7 @@
@@ -72,8 +72,11 @@
# define pthread_join GC_pthread_join
# define pthread_detach GC_pthread_detach
-#ifndef GC_DARWIN_THREADS
+#if !defined(GC_DARWIN_THREADS) && !defined(GC_OPENBSD_THREADS)
# define pthread_sigmask GC_pthread_sigmask
+#endif
+
+#ifndef GC_DARWIN_THREADS
# define dlopen GC_dlopen
#endif

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-boehm-gc_include_private_gcconfig_h,v 1.1.1.1 2011/11/14 13:00:57 pascal Exp $
--- boehm-gc/include/private/gcconfig.h.orig Sat Nov 12 10:01:29 2011
+++ boehm-gc/include/private/gcconfig.h Sat Nov 12 10:17:43 2011
$OpenBSD: patch-boehm-gc_include_private_gcconfig_h,v 1.2 2011/11/22 21:46:39 pascal Exp $
--- boehm-gc/include/private/gcconfig.h.orig Sun Mar 21 20:34:19 2010
+++ boehm-gc/include/private/gcconfig.h Tue Nov 22 14:11:11 2011
@@ -62,7 +62,7 @@
/* Determine the machine type: */
# if defined(__arm__) || defined(__thumb__)
@ -197,6 +197,15 @@ $OpenBSD: patch-boehm-gc_include_private_gcconfig_h,v 1.1.1.1 2011/11/14 13:00:5
# endif
# ifdef RS6000
@@ -1518,7 +1580,7 @@
# define ALIGNMENT 4
# define ALIGN_DOUBLE
# 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
# endif
@@ -1570,6 +1632,23 @@
extern int _end[];
# define DATAEND (&_end)
@ -252,7 +261,15 @@ $OpenBSD: patch-boehm-gc_include_private_gcconfig_h,v 1.1.1.1 2011/11/14 13:00:5
# endif
# ifdef FREEBSD
# define OS_TYPE "FREEBSD"
@@ -1892,6 +1977,24 @@
@@ -1782,6 +1867,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"
@@ -1892,6 +1978,24 @@
# define OS_TYPE "MSWINCE"
# define DATAEND /* not needed */
# endif
@ -277,7 +294,7 @@ $OpenBSD: patch-boehm-gc_include_private_gcconfig_h,v 1.1.1.1 2011/11/14 13:00:5
# ifdef NOSYS
/* __data_start is usually defined in the target linker script. */
extern int __data_start[];
@@ -1939,6 +2042,23 @@
@@ -1939,6 +2043,23 @@
# define USE_GENERIC_PUSH_REGS
# define DYNAMIC_LOADING
# endif
@ -301,7 +318,7 @@ $OpenBSD: patch-boehm-gc_include_private_gcconfig_h,v 1.1.1.1 2011/11/14 13:00:5
# endif
# ifdef SH4
@@ -1971,6 +2091,24 @@
@@ -1971,6 +2092,24 @@
# define CPP_WORDSZ 64
# ifndef HBLKSIZE
# define HBLKSIZE 4096

View File

@ -1,12 +1,12 @@
$OpenBSD: patch-boehm-gc_mach_dep_c,v 1.1.1.1 2011/11/14 13:00:57 pascal Exp $
--- boehm-gc/mach_dep.c.orig Sat Nov 12 10:28:43 2011
+++ boehm-gc/mach_dep.c Sat Nov 12 10:29:37 2011
$OpenBSD: patch-boehm-gc_mach_dep_c,v 1.2 2011/11/22 21:46:39 pascal Exp $
--- boehm-gc/mach_dep.c.orig Wed Jan 25 04:03:14 2006
+++ boehm-gc/mach_dep.c Tue Nov 22 14:12:40 2011
@@ -27,7 +27,7 @@
# endif
# endif
-#if defined(RS6000) || defined(POWERPC)
+#if defined(RS6000) || defined(POWERPC) && !defined(OPENBSD)
+#if (defined(RS6000) || defined(POWERPC)) && !defined(OPENBSD)
# include <ucontext.h>
#endif
@ -15,7 +15,7 @@ $OpenBSD: patch-boehm-gc_mach_dep_c,v 1.1.1.1 2011/11/14 13:00:57 pascal Exp $
__builtin_unwind_init();
# else /* !HAVE_BUILTIN_UNWIND_INIT */
-# if defined(RS6000) || defined(POWERPC)
+# if defined(RS6000) || defined(POWERPC) && !defined(OPENBSD)
+# if (defined(RS6000) || defined(POWERPC)) && !defined(OPENBSD)
/* FIXME: RS6000 means AIX. */
/* This should probably be used in all Posix/non-gcc */
/* settings. We defer that change to minimize risk. */

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-boehm-gc_openbsd_stop_world_c,v 1.1.1.1 2011/11/14 13:00:57 pascal Exp $
--- boehm-gc/openbsd_stop_world.c.orig Thu Mar 12 15:07:24 2009
+++ boehm-gc/openbsd_stop_world.c Thu Mar 12 18:07:50 2009
@@ -0,0 +1,184 @@
$OpenBSD: patch-boehm-gc_openbsd_stop_world_c,v 1.2 2011/11/22 21:46:39 pascal Exp $
--- boehm-gc/openbsd_stop_world.c.orig Sun Nov 20 19:18:24 2011
+++ boehm-gc/openbsd_stop_world.c Mon Nov 21 01:15:08 2011
@@ -0,0 +1,193 @@
+#include "private/pthread_support.h"
+
+/* derived from pthread_stop_world.c */
@ -185,4 +185,13 @@ $OpenBSD: patch-boehm-gc_openbsd_stop_world_c,v 1.1.1.1 2011/11/14 13:00:57 pasc
+ ABORT("pthread_resume_np failed");
+}
+
+int GC_is_thread_suspended(pthread_t thread) {
+ GC_thread t = GC_lookup_thread(thread);
+ if (t == NULL)
+ ABORT("querying suspension state of unknown thread");
+
+ return (t -> flags & SUSPENDED);
+}
+
+
+#endif

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-libgo_configure,v 1.1 2011/11/19 22:19:53 pascal Exp $
$OpenBSD: patch-libgo_configure,v 1.2 2011/11/22 21:46:39 pascal Exp $
--- libgo/configure.orig Mon Feb 21 05:17:20 2011
+++ libgo/configure Sat Nov 19 23:07:23 2011
+++ libgo/configure Tue Nov 22 18:27:42 2011
@@ -644,6 +644,8 @@ LIBGO_IS_LINUX_FALSE
LIBGO_IS_LINUX_TRUE
LIBGO_IS_FREEBSD_FALSE
@ -26,18 +26,44 @@ $OpenBSD: patch-libgo_configure,v 1.1 2011/11/19 22:19:53 pascal Exp $
*-*-linux*) is_linux=yes; GOOS=linux ;;
*-*-rtems*) is_rtems=yes; GOOS=rtems ;;
*-*-solaris2*) is_solaris=yes; GOOS=solaris ;;
@@ -13238,6 +13242,14 @@ fi
else
LIBGO_IS_FREEBSD_TRUE='#'
@@ -13240,6 +13244,14 @@ else
LIBGO_IS_FREEBSD_FALSE=
+fi
+
fi
+ if test $is_openbsd = yes; then
+ LIBGO_IS_OPENBSD_TRUE=
+ LIBGO_IS_OPENBSD_FALSE='#'
+else
+ LIBGO_IS_OPENBSD_TRUE='#'
+ LIBGO_IS_OPENBSD_FALSE=
+fi
+
if test $is_linux = yes; then
LIBGO_IS_LINUX_TRUE=
LIBGO_IS_LINUX_FALSE='#'
@@ -13706,13 +13718,13 @@ fi
PTHREAD_LIBS=
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5
-$as_echo_n "checking for pthread_create in -lpthread... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -pthread" >&5
+$as_echo_n "checking for pthread_create in -pthread... " >&6; }
if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpthread $LIBS"
+LIBS="-pthread $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -13743,7 +13755,7 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5
$as_echo "$ac_cv_lib_pthread_pthread_create" >&6; }
if test "x$ac_cv_lib_pthread_pthread_create" = x""yes; then :
- PTHREAD_LIBS=-lpthread
+ PTHREAD_LIBS=-pthread
fi
if test $is_linux = yes; then

View File

@ -1,4 +1,4 @@
@comment $OpenBSD: PFRAG.PIC-go,v 1.1 2011/11/19 22:19:53 pascal Exp $
@comment $OpenBSD: PFRAG.PIC-go,v 1.2 2011/11/22 21:46:39 pascal Exp $
lib/fpic/go/
lib/fpic/go/${V}/
lib/fpic/go/${V}/${CONFIG}/
@ -148,5 +148,5 @@ lib/fpic/go/${V}/${CONFIG}/websocket.gox
lib/fpic/go/${V}/${CONFIG}/xml.gox
lib/fpic/libgo.a
lib/fpic/libgo.la
@lib lib/fpic/libgo.so.${LIBgo_VERSION}
@comment @lib lib/fpic/libgo.so.${LIBgo_VERSION}
lib/fpic/libgobegin.a

View File

@ -1 +1,18 @@
@comment $OpenBSD: PFRAG.PIC-java,v 1.1.1.1 2011/11/14 13:00:56 pascal Exp $
@comment $OpenBSD: PFRAG.PIC-java,v 1.2 2011/11/22 21:46:39 pascal Exp $
lib/fpic/gcj-${V}-12/
@comment lib/fpic/gcj-${V}-12/classmap.db
lib/fpic/gcj-${V}-12/libjvm.a
lib/fpic/gcj-${V}-12/libjvm.la
@comment lib/fpic/gcj-${V}-12/libjvm.so
lib/fpic/libgcj-tools.a
lib/fpic/libgcj-tools.la
@comment @lib lib/fpic/libgcj-tools.so.${LIBgcj-tools_VERSION}
lib/fpic/libgcj.a
lib/fpic/libgcj.la
@comment @lib lib/fpic/libgcj.so.${LIBgcj_VERSION}
lib/fpic/libgij.a
lib/fpic/libgij.la
@comment @lib lib/fpic/libgij.so.${LIBgij_VERSION}
@comment lib/fpic/logging.properties
@comment lib/fpic/security/
@comment lib/fpic/security/classpath.security

View File

@ -1,5 +1,5 @@
@comment $OpenBSD: PFRAG.shared-java,v 1.2 2011/11/19 22:19:53 pascal Exp $
lib/gcj-${V}-12/libjvm.so
@comment $OpenBSD: PFRAG.shared-java,v 1.3 2011/11/22 21:46:39 pascal Exp $
lib/${FULLPKGNAME}-12/libjvm.so
@lib lib/libgcj-tools.so.${LIBgcj-tools_VERSION}
@lib lib/libgcj.so.${LIBgcj_VERSION}
@lib lib/libgij.so.${LIBgij_VERSION}