Fix boehm-gc and increase gcj default thread stack size. Makes gjc work

well enough to bootstrap devel/jdk/1.6. okay pascal@ jasper@
This commit is contained in:
kurt 2012-10-17 19:58:21 +00:00
parent 24ceb2f529
commit e6d0f75aab
7 changed files with 104 additions and 57 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.38 2012/10/07 20:09:44 landry Exp $
# $OpenBSD: Makefile,v 1.39 2012/10/17 19:58:21 kurt Exp $
ONLY_FOR_ARCHS = amd64 i386 powerpc sparc sparc64
DPB_PROPERTIES = parallel
@ -24,7 +24,7 @@ REVISION-main = 12
REVISION-c++ = 12
REVISION-estdc = 10
REVISION-f95 = 12
REVISION-java = 12
REVISION-java = 13
REVISION-objc = 12
REVISION-ada = 12
REVISION-go = 12

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-boehm-gc_dyn_load_c,v 1.1.1.1 2011/11/14 13:00:57 pascal Exp $
--- boehm-gc/dyn_load.c.orig Sat Nov 12 09:53:59 2011
+++ boehm-gc/dyn_load.c Sat Nov 12 10:28:04 2011
$OpenBSD: patch-boehm-gc_dyn_load_c,v 1.2 2012/10/17 19:58:21 kurt Exp $
--- boehm-gc/dyn_load.c.orig Mon Nov 29 09:58:16 2010
+++ boehm-gc/dyn_load.c Wed Oct 10 09:15:24 2012
@@ -60,6 +60,7 @@
!defined(HPUX) && !(defined(LINUX) && defined(__ELF__)) && \
!defined(RS6000) && !defined(SCO_ELF) && !defined(DGUX) && \
@ -37,12 +37,14 @@ $OpenBSD: patch-boehm-gc_dyn_load_c,v 1.1.1.1 2011/11/14 13:00:57 pascal Exp $
(defined(NETBSD) && defined(__ELF__)) || defined(HURD)
@@ -492,7 +494,7 @@ GC_bool GC_register_main_static_data()
/* This doesn't necessarily work in all cases, e.g. with preloaded
* dynamic libraries. */
@@ -409,6 +411,10 @@ GC_bool GC_register_main_static_data()
# if (defined(FREEBSD) && __FreeBSD__ >= 7)
/* On the FreeBSD system, any target system at major version 7 shall */
/* have dl_iterate_phdr; therefore, we need not make it weak as above. */
+#define HAVE_DL_ITERATE_PHDR
+#endif
+
+#if defined(OPENBSD)
#define HAVE_DL_ITERATE_PHDR
#endif
-#if defined(NETBSD)
+#if defined(NETBSD) || defined(OPENBSD)
# include <sys/exec_elf.h>
/* for compatibility with 1.4.x */
# ifndef DT_DEBUG

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-boehm-gc_include_private_gcconfig_h,v 1.3 2012/02/28 20:00:16 pascal Exp $
--- boehm-gc/include/private/gcconfig.h.orig Sun Mar 21 20:34:19 2010
+++ boehm-gc/include/private/gcconfig.h Mon Feb 20 22:09:03 2012
$OpenBSD: patch-boehm-gc_include_private_gcconfig_h,v 1.4 2012/10/17 19:58:21 kurt Exp $
--- boehm-gc/include/private/gcconfig.h.orig Sun Mar 21 15:34:19 2010
+++ boehm-gc/include/private/gcconfig.h Tue Oct 9 21:12:42 2012
@@ -62,7 +62,7 @@
/* Determine the machine type: */
# if defined(__arm__) || defined(__thumb__)
@ -109,8 +109,8 @@ $OpenBSD: patch-boehm-gc_include_private_gcconfig_h,v 1.3 2012/02/28 20:00:16 pa
+# ifdef OPENBSD
+# define OS_TYPE "OPENBSD"
+# define ALIGNMENT 4
+# define SIG_SUSPEND SIGUSR1
+# define SIG_THR_RESTART SIGUSR2
+# define SIG_SUSPEND SIGXFSZ
+# define SIG_THR_RESTART SIGXCPU
+# ifndef GC_OPENBSD_THREADS
+# include <sys/param.h>
+# include <uvm/uvm_extern.h>
@ -134,8 +134,8 @@ $OpenBSD: patch-boehm-gc_include_private_gcconfig_h,v 1.3 2012/02/28 20:00:16 pa
-# define STACKBOTTOM ((ptr_t) 0xf8000000)
- extern int etext[];
-# define DATASTART ((ptr_t)(etext))
+# define SIG_SUSPEND SIGUSR1
+# define SIG_THR_RESTART SIGUSR2
+# define SIG_SUSPEND SIGXFSZ
+# define SIG_THR_RESTART SIGXCPU
+# ifndef GC_OPENBSD_THREADS
+# include <sys/param.h>
+# include <uvm/uvm_extern.h>
@ -155,8 +155,8 @@ $OpenBSD: patch-boehm-gc_include_private_gcconfig_h,v 1.3 2012/02/28 20:00:16 pa
# endif
# ifdef OPENBSD
# define OS_TYPE "OPENBSD"
+# define SIG_SUSPEND SIGUSR1
+# define SIG_THR_RESTART SIGUSR2
+# define SIG_SUSPEND SIGXFSZ
+# define SIG_THR_RESTART SIGXCPU
+# ifndef GC_OPENBSD_THREADS
+# include <sys/param.h>
+# include <uvm/uvm_extern.h>
@ -172,6 +172,15 @@ $OpenBSD: patch-boehm-gc_include_private_gcconfig_h,v 1.3 2012/02/28 20:00:16 pa
# endif
# ifdef FREEBSD
# define OS_TYPE "FREEBSD"
@@ -1285,7 +1329,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[];
@@ -1471,6 +1515,24 @@
# define STACKBOTTOM ((ptr_t) 0x7ffff000)
# endif /* _ELF_ */
@ -179,8 +188,8 @@ $OpenBSD: patch-boehm-gc_include_private_gcconfig_h,v 1.3 2012/02/28 20:00:16 pa
+# ifdef OPENBSD
+# define OS_TYPE "OPENBSD"
+# define ALIGNMENT 4
+# define SIG_SUSPEND SIGUSR1
+# define SIG_THR_RESTART SIGUSR2
+# define SIG_SUSPEND SIGXFSZ
+# define SIG_THR_RESTART SIGXCPU
+# ifndef GC_OPENBSD_THREADS
+# include <sys/param.h>
+# include <uvm/uvm_extern.h>
@ -212,8 +221,8 @@ $OpenBSD: patch-boehm-gc_include_private_gcconfig_h,v 1.3 2012/02/28 20:00:16 pa
# endif /* LINUX */
+# ifdef OPENBSD
+# define OS_TYPE "OPENBSD"
+# define SIG_SUSPEND SIGUSR1
+# define SIG_THR_RESTART SIGUSR2
+# define SIG_SUSPEND SIGXFSZ
+# define SIG_THR_RESTART SIGXCPU
+# ifndef GC_OPENBSD_THREADS
+# include <sys/param.h>
+# include <uvm/uvm_extern.h>
@ -244,8 +253,8 @@ $OpenBSD: patch-boehm-gc_include_private_gcconfig_h,v 1.3 2012/02/28 20:00:16 pa
-# define DATASTART ((ptr_t) 0x140000000)
-# endif
+# define ELF_CLASS ELFCLASS64
+# define SIG_SUSPEND SIGUSR1
+# define SIG_THR_RESTART SIGUSR2
+# define SIG_SUSPEND SIGXFSZ
+# define SIG_THR_RESTART SIGXCPU
+# ifndef GC_OPENBSD_THREADS
+# include <sys/param.h>
+# include <uvm/uvm_extern.h>
@ -276,8 +285,8 @@ $OpenBSD: patch-boehm-gc_include_private_gcconfig_h,v 1.3 2012/02/28 20:00:16 pa
+# ifdef OPENBSD
+# define ALIGNMENT 4
+# define OS_TYPE "OPENBSD"
+# define SIG_SUSPEND SIGUSR1
+# define SIG_THR_RESTART SIGUSR2
+# define SIG_SUSPEND SIGXFSZ
+# define SIG_THR_RESTART SIGXCPU
+# ifndef GC_OPENBSD_THREADS
+# include <sys/param.h>
+# include <uvm/uvm_extern.h>
@ -300,8 +309,8 @@ $OpenBSD: patch-boehm-gc_include_private_gcconfig_h,v 1.3 2012/02/28 20:00:16 pa
# endif
+# ifdef OPENBSD
+# define OS_TYPE "OPENBSD"
+# define SIG_SUSPEND SIGUSR1
+# define SIG_THR_RESTART SIGUSR2
+# define SIG_SUSPEND SIGXFSZ
+# define SIG_THR_RESTART SIGXCPU
+# ifndef GC_OPENBSD_THREADS
+# include <sys/param.h>
+# include <uvm/uvm_extern.h>
@ -326,8 +335,8 @@ $OpenBSD: patch-boehm-gc_include_private_gcconfig_h,v 1.3 2012/02/28 20:00:16 pa
+# ifdef OPENBSD
+# define OS_TYPE "OPENBSD"
+# define ELF_CLASS ELFCLASS64
+# define SIG_SUSPEND SIGUSR1
+# define SIG_THR_RESTART SIGUSR2
+# define SIG_SUSPEND SIGXFSZ
+# define SIG_THR_RESTART SIGXCPU
+# ifndef GC_OPENBSD_THREADS
+# include <sys/param.h>
+# include <uvm/uvm_extern.h>

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-boehm-gc_misc_c,v 1.1 2012/10/17 19:58:21 kurt Exp $
--- boehm-gc/misc.c.orig Thu Sep 14 14:06:04 2006
+++ boehm-gc/misc.c Tue Oct 9 16:37:36 2012
@@ -660,7 +660,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(GC_PTHREADS) || defined(GC_SOLARIS_THREADS) \

View File

@ -1,17 +1,16 @@
$OpenBSD: patch-boehm-gc_os_dep_c,v 1.3 2012/02/28 20:00:16 pascal Exp $
--- boehm-gc/os_dep.c.orig Tue Feb 21 00:39:27 2012
+++ boehm-gc/os_dep.c Tue Feb 21 00:40:19 2012
@@ -385,14 +385,94 @@ static void *tiny_sbrk(ptrdiff_t increment)
$OpenBSD: patch-boehm-gc_os_dep_c,v 1.4 2012/10/17 19:58:21 kurt Exp $
--- boehm-gc/os_dep.c.orig Sun Mar 21 15:34:19 2010
+++ boehm-gc/os_dep.c Tue Oct 9 16:05:42 2012
@@ -380,7 +380,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()
{
- extern ptr_t GC_find_limit();
+ extern ptr_t GC_find_limit_openbsd();
extern char **environ;
/* This may need to be environ, without the underscore, for */
/* some versions. */
- GC_data_start = GC_find_limit((ptr_t)&environ, FALSE);
+ GC_data_start = GC_find_limit_openbsd((ptr_t)&environ, FALSE);
@@ -393,6 +393,86 @@ static void *tiny_sbrk(ptrdiff_t increment)
}
#endif

View File

@ -1,7 +1,18 @@
$OpenBSD: patch-boehm-gc_pthread_support_c,v 1.2 2012/05/07 10:34:33 pascal Exp $
$OpenBSD: patch-boehm-gc_pthread_support_c,v 1.3 2012/10/17 19:58:21 kurt Exp $
--- boehm-gc/pthread_support.c.orig Fri Dec 10 05:09:10 2010
+++ boehm-gc/pthread_support.c Tue May 1 03:40:41 2012
@@ -884,7 +884,7 @@ void GC_thr_init()
+++ boehm-gc/pthread_support.c Wed Oct 10 08:41:07 2012
@@ -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,7 @@ void GC_thr_init()
GC_nprocs = pthread_num_processors_np();
# endif
# if defined(GC_OSF1_THREADS) || defined(GC_AIX_THREADS) \
@ -10,12 +21,14 @@ $OpenBSD: patch-boehm-gc_pthread_support_c,v 1.2 2012/05/07 10:34:33 pascal Exp
GC_nprocs = sysconf(_SC_NPROCESSORS_ONLN);
if (GC_nprocs <= 0) GC_nprocs = 1;
# endif
@@ -966,7 +966,7 @@ void GC_init_parallel()
}
@@ -1156,6 +1160,10 @@ GC_PTR GC_get_thread_stack_base()
return stack_addr;
# endif
-#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;
+# 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");

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-libjava_prims_cc,v 1.1 2012/10/17 19:58:21 kurt Exp $
--- libjava/prims.cc.orig Tue Oct 9 14:44:51 2012
+++ libjava/prims.cc Tue Oct 9 14:45:14 2012
@@ -1143,7 +1143,7 @@ namespace gcj
bool verifyClasses = true;
// Thread stack size specified by the -Xss runtime argument.
- size_t stack_size = 0;
+ size_t stack_size = 768*1024;
// Start time of the VM
jlong startTime = 0;