aboutsummaryrefslogtreecommitdiffstats
path: root/java/cacao/files
diff options
context:
space:
mode:
authorarved <arved@FreeBSD.org>2007-02-05 04:20:12 +0800
committerarved <arved@FreeBSD.org>2007-02-05 04:20:12 +0800
commit00751d4bdec91e8c58a761bfaee27f0887aac0ad (patch)
tree9606f3cb7808a0e88869e9197c2464c4841f5a7f /java/cacao/files
parent6194127f0c13a4d73e4a8be0d8ad3e7cd1274068 (diff)
downloadfreebsd-ports-gnome-00751d4bdec91e8c58a761bfaee27f0887aac0ad.tar.gz
freebsd-ports-gnome-00751d4bdec91e8c58a761bfaee27f0887aac0ad.tar.zst
freebsd-ports-gnome-00751d4bdec91e8c58a761bfaee27f0887aac0ad.zip
Add the cacao JVM
Diffstat (limited to 'java/cacao/files')
-rw-r--r--java/cacao/files/patch-boehm-gc-dbg_ml.c82
-rw-r--r--java/cacao/files/patch-boehm-gc-dyn_load.c15
-rw-r--r--java/cacao/files/patch-boehm-gc-include-gc.h10
-rw-r--r--java/cacao/files/patch-boehm-gc-include-private-gcconfig.h88
-rw-r--r--java/cacao/files/patch-boehm-gc-os_dep.c29
-rw-r--r--java/cacao/files/patch-configure11
-rw-r--r--java/cacao/files/patch-src-Makefile.in18
-rw-r--r--java/cacao/files/patch-src-vm-jit-x86_64-md.c71
8 files changed, 324 insertions, 0 deletions
diff --git a/java/cacao/files/patch-boehm-gc-dbg_ml.c b/java/cacao/files/patch-boehm-gc-dbg_ml.c
new file mode 100644
index 000000000000..af6de67db9ce
--- /dev/null
+++ b/java/cacao/files/patch-boehm-gc-dbg_ml.c
@@ -0,0 +1,82 @@
+--- src/boehm-gc/dbg_mlc.c.orig Tue May 13 16:59:49 2003
++++ src/boehm-gc/dbg_mlc.c Wed May 12 20:13:19 2004
+@@ -414,6 +414,23 @@
+ GC_register_displacement((word)sizeof(oh) + offset);
+ }
+
++#if defined(__FreeBSD__)
++#include <dlfcn.h>
++static void GC_caller_func_offset(ad, symp, offp)
++const GC_word ad;
++const char **symp;
++int *offp;
++{
++ Dl_info caller;
++ if (dladdr((const void *)ad, &caller) && caller.dli_sname != NULL) {
++ *symp = caller.dli_sname;
++ *offp = (const char *)ad - (const char *)caller.dli_saddr;
++ }
++}
++#else
++#define GC_caller_func(ad, symp, offp)
++#endif
++
+ # ifdef __STDC__
+ GC_PTR GC_debug_malloc(size_t lb, GC_EXTRA_PARAMS)
+ # else
+@@ -428,6 +445,13 @@
+ {
+ GC_PTR result = GC_malloc(lb + DEBUG_BYTES);
+
++#ifdef GC_ADD_CALLER
++ if (s == NULL) {
++ GC_caller_func_offset(ra, &s, &i);
++ if (s == NULL)
++ s = "unknown";
++ }
++#endif
+ if (result == 0) {
+ GC_err_printf1("GC_debug_malloc(%ld) returning NIL (",
+ (unsigned long) lb);
+@@ -789,6 +813,13 @@
+ register size_t old_sz;
+ register hdr * hhdr;
+
++#ifdef GC_ADD_CALLER
++ if (s == NULL) {
++ GC_caller_func_offset(ra, &s, &i);
++ if (s == NULL)
++ s = "unknown";
++ }
++#endif
+ if (p == 0) return(GC_debug_malloc(lb, OPT_RA s, i));
+ if (base == 0) {
+ GC_err_printf1(
+@@ -1094,7 +1125,11 @@
+ }
+
+ #ifdef GC_ADD_CALLER
+-# define RA GC_RETURN_ADDR,
++# ifdef GC_RETURN_ADDR_PARENT
++# define RA GC_RETURN_ADDR_PARENT,
++# else
++# define RA GC_RETURN_ADDR,
++# endif
+ #else
+ # define RA
+ #endif
+@@ -1102,12 +1137,12 @@
+ GC_PTR GC_debug_malloc_replacement(lb)
+ size_t lb;
+ {
+- return GC_debug_malloc(lb, RA "unknown", 0);
++ return GC_debug_malloc(lb, RA NULL, 0);
+ }
+
+ GC_PTR GC_debug_realloc_replacement(p, lb)
+ GC_PTR p;
+ size_t lb;
+ {
+- return GC_debug_realloc(p, lb, RA "unknown", 0);
++ return GC_debug_realloc(p, lb, RA NULL, 0);
+ }
diff --git a/java/cacao/files/patch-boehm-gc-dyn_load.c b/java/cacao/files/patch-boehm-gc-dyn_load.c
new file mode 100644
index 000000000000..963504ca9809
--- /dev/null
+++ b/java/cacao/files/patch-boehm-gc-dyn_load.c
@@ -0,0 +1,15 @@
+--- src/boehm-gc/dyn_load.c.orig Thu May 6 08:03:06 2004
++++ src/boehm-gc/dyn_load.c Sun Oct 31 01:53:01 2004
+@@ -97,6 +97,12 @@
+ # else
+ # define ElfW(type) Elf64_##type
+ # endif
++# elif defined(__FreeBSD__)
++# if __ELF_WORD_SIZE == 32
++# define ElfW(type) Elf32_##type
++# else
++# define ElfW(type) Elf64_##type
++# endif
+ # else
+ # if !defined(ELF_CLASS) || ELF_CLASS == ELFCLASS32
+ # define ElfW(type) Elf32_##type
diff --git a/java/cacao/files/patch-boehm-gc-include-gc.h b/java/cacao/files/patch-boehm-gc-include-gc.h
new file mode 100644
index 000000000000..af60c7729324
--- /dev/null
+++ b/java/cacao/files/patch-boehm-gc-include-gc.h
@@ -0,0 +1,10 @@
+--- src/boehm-gc/include/gc.h.orig Wed Jun 4 17:07:33 2003
++++ src/boehm-gc/include/gc.h Wed May 12 20:03:22 2004
+@@ -487,6 +487,7 @@
+ /* gcc knows how to retrieve return address, but we don't know */
+ /* how to generate call stacks. */
+ # define GC_RETURN_ADDR (GC_word)__builtin_return_address(0)
++# define GC_RETURN_ADDR_PARENT (GC_word)__builtin_return_address(1)
+ # else
+ /* Just pass 0 for gcc compatibility. */
+ # define GC_RETURN_ADDR 0
diff --git a/java/cacao/files/patch-boehm-gc-include-private-gcconfig.h b/java/cacao/files/patch-boehm-gc-include-private-gcconfig.h
new file mode 100644
index 000000000000..44e757247e14
--- /dev/null
+++ b/java/cacao/files/patch-boehm-gc-include-private-gcconfig.h
@@ -0,0 +1,88 @@
+--- src/boehm-gc/include/private/gcconfig.h.rorig Sat Oct 15 16:40:25 2005
++++ src/boehm-gc/include/private/gcconfig.h Sat Oct 15 16:42:43 2005
+@@ -62,7 +62,7 @@
+ /* Determine the machine type: */
+ # if defined(__arm__) || defined(__thumb__)
+ # define ARM32
+-# if !defined(LINUX) && !defined(NETBSD)
++# if !defined(LINUX) && !defined(NETBSD) && !defined(FREEBSD)
+ # define NOSYS
+ # define mach_type_known
+ # endif
+@@ -334,10 +334,22 @@
+ # define X86_64
+ # define mach_type_known
+ # endif
++# if defined(__FreeBSD__) && defined(__amd64__)
++# define X86_64
++# define mach_type_known
++# endif
+ # if defined(FREEBSD) && defined(__sparc__)
+ # define SPARC
+ # define mach_type_known
+-#endif
++# endif
++# if defined(FREEBSD) && defined(__powerpc__)
++# define POWERPC
++# define mach_type_known
++# endif
++# if defined(FREEBSD) && defined(__arm__)
++# define ARM32
++# define mach_type_known
++# endif
+ # if defined(bsdi) && (defined(i386) || defined(__i386__))
+ # define I386
+ # define BSDI
+@@ -845,6 +857,16 @@
+ # define DATASTART GC_data_start
+ # define DYNAMIC_LOADING
+ # endif
++# ifdef FREEBSD
++# define ALIGNMENT 4
++# define OS_TYPE "FREEBSD"
++# ifdef __ELF__
++# define DYNAMIC_LOADING
++# endif
++# define HEURISTIC2
++ extern char etext[];
++# define SEARCH_FOR_DATA_START
++# endif
+ # ifdef NOSYS
+ # define ALIGNMENT 4
+ # define OS_TYPE "NOSYS"
+@@ -1807,6 +1829,17 @@
+ # endif
+ # define USE_GENERIC_PUSH_REGS
+ # endif
++# ifdef FREEBSD
++# define ALIGNMENT 4
++# define OS_TYPE "FREEBSD"
++# ifdef __ELF__
++# define DYNAMIC_LOADING
++# endif
++# define HEURISTIC2
++ extern char etext[];
++# define SEARCH_FOR_DATA_START
++# endif
++
+ # ifdef LINUX
+ # define OS_TYPE "LINUX"
+ # define LINUX_STACKBOTTOM
+@@ -1957,6 +1990,17 @@
+ # ifdef __ELF__
+ # define DYNAMIC_LOADING
+ # endif
++# define HEURISTIC2
++ extern char etext[];
++# define SEARCH_FOR_DATA_START
++# endif
++# ifdef FREEBSD
++# define OS_TYPE "FREEBSD"
++# define SIG_SUSPEND SIGUSR1
++# define SIG_THR_RESTART SIGUSR2
++# ifdef __ELF__
++# define DYNAMIC_LOADING
++# endif
+ # define HEURISTIC2
+ extern char etext[];
+ # define SEARCH_FOR_DATA_START
diff --git a/java/cacao/files/patch-boehm-gc-os_dep.c b/java/cacao/files/patch-boehm-gc-os_dep.c
new file mode 100644
index 000000000000..b9de5e8d3e07
--- /dev/null
+++ b/java/cacao/files/patch-boehm-gc-os_dep.c
@@ -0,0 +1,29 @@
+--- src/boehm-gc/os_dep.c.orig Thu May 19 20:48:49 2005
++++ src/boehm-gc/os_dep.c Fri Jun 17 21:28:07 2005
+@@ -699,7 +699,7 @@
+ || defined(HURD) || defined(NETBSD)
+ static struct sigaction old_segv_act;
+ # if defined(IRIX5) || defined(HPUX) \
+- || defined(HURD) || defined(NETBSD)
++ || defined(HURD) || defined(NETBSD) || defined(FREEBSD)
+ static struct sigaction old_bus_act;
+ # endif
+ # else
+@@ -714,7 +714,7 @@
+ # endif
+ {
+ # if defined(SUNOS5SIGS) || defined(IRIX5) \
+- || defined(OSF1) || defined(HURD) || defined(NETBSD)
++ || defined(OSF1) || defined(HURD) || defined(NETBSD) || defined(FREEBSD)
+ struct sigaction act;
+
+ act.sa_handler = h;
+@@ -736,7 +736,7 @@
+ # else
+ (void) sigaction(SIGSEGV, &act, &old_segv_act);
+ # if defined(IRIX5) \
+- || defined(HPUX) || defined(HURD) || defined(NETBSD)
++ || defined(HPUX) || defined(HURD) || defined(NETBSD) || defined(FREEBSD)
+ /* Under Irix 5.x or HP/UX, we may get SIGBUS. */
+ /* Pthreads doesn't exist under Irix 5.x, so we */
+ /* don't have to worry in the threads case. */
diff --git a/java/cacao/files/patch-configure b/java/cacao/files/patch-configure
new file mode 100644
index 000000000000..813d8e010b3c
--- /dev/null
+++ b/java/cacao/files/patch-configure
@@ -0,0 +1,11 @@
+--- configure.orig Sun Feb 4 14:38:16 2007
++++ configure Sun Feb 4 15:30:30 2007
+@@ -2662,7 +2661,7 @@
+ ARCH_CFLAGS="-mcpu=v9 -m64 -D__SPARC_64__"
+ ;;
+
+-x86_64 )
++x86_64 | amd64 )
+ ARCH_DIR="x86_64"
+ ARCH_CFLAGS="-D__X86_64__"
+ ;;
diff --git a/java/cacao/files/patch-src-Makefile.in b/java/cacao/files/patch-src-Makefile.in
new file mode 100644
index 000000000000..1d73af70b2cc
--- /dev/null
+++ b/java/cacao/files/patch-src-Makefile.in
@@ -0,0 +1,18 @@
+--- src/Makefile.in.orig Sun Feb 4 20:06:59 2007
++++ src/Makefile.in Sun Feb 4 20:07:09 2007
+@@ -243,7 +243,6 @@
+ cacaoh \
+ native \
+ cacao \
+- scripts
+
+ @DISABLE_GC_FALSE@BOEHM = boehm-gc
+ @DISABLE_GC_TRUE@BOEHM =
+@@ -260,7 +259,6 @@
+ cacaoh \
+ native \
+ cacao \
+- scripts
+
+ all: all-recursive
+
diff --git a/java/cacao/files/patch-src-vm-jit-x86_64-md.c b/java/cacao/files/patch-src-vm-jit-x86_64-md.c
new file mode 100644
index 000000000000..e2e01941c4c4
--- /dev/null
+++ b/java/cacao/files/patch-src-vm-jit-x86_64-md.c
@@ -0,0 +1,71 @@
+--- src/vm/jit/x86_64/md.c.orig Sun Feb 4 15:42:05 2007
++++ src/vm/jit/x86_64/md.c Sun Feb 4 15:45:32 2007
+@@ -91,8 +91,8 @@
+ /* ATTENTION: Don't use CACAO's internal REG_* defines as they are
+ different to the ones in <ucontext.h>. */
+
+- sp = (u1 *) _mc->gregs[REG_RSP];
+- xpc = (u1 *) _mc->gregs[REG_RIP];
++ sp = (u1 *) _mc->mc_rsp;
++ xpc = (u1 *) _mc->mc_rip;
+ ra = xpc; /* return address is equal to xpc */
+
+ #if 0
+@@ -101,11 +101,11 @@
+ threads_check_stackoverflow(sp);
+ #endif
+
+- _mc->gregs[REG_RAX] =
++ _mc->mc_rax =
+ (ptrint) stacktrace_hardware_nullpointerexception(NULL, sp, ra, xpc);
+
+- _mc->gregs[REG_R10] = (ptrint) xpc; /* REG_ITMP2_XPC */
+- _mc->gregs[REG_RIP] = (ptrint) asm_handle_exception;
++ _mc->mc_r10 = (ptrint) xpc; /* REG_ITMP2_XPC */
++ _mc->mc_rip = (ptrint) asm_handle_exception;
+ }
+
+
+@@ -130,15 +130,15 @@
+ /* ATTENTION: Don't use CACAO's internal REG_* defines as they are
+ different to the ones in <ucontext.h>. */
+
+- sp = (u1 *) _mc->gregs[REG_RSP];
+- xpc = (u1 *) _mc->gregs[REG_RIP];
++ sp = (u1 *) _mc->mc_rsp;
++ xpc = (u1 *) _mc->mc_rip;
+ ra = xpc; /* return address is equal to xpc */
+
+- _mc->gregs[REG_RAX] =
++ _mc->mc_rax =
+ (ptrint) stacktrace_hardware_arithmeticexception(NULL, sp, ra, xpc);
+
+- _mc->gregs[REG_R10] = (ptrint) xpc; /* REG_ITMP2_XPC */
+- _mc->gregs[REG_RIP] = (ptrint) asm_handle_exception;
++ _mc->mc_r10 = (ptrint) xpc; /* REG_ITMP2_XPC */
++ _mc->mc_rip = (ptrint) asm_handle_exception;
+ }
+
+
+@@ -164,7 +164,7 @@
+ /* ATTENTION: Don't use CACAO's internal REG_* defines as they are
+ different to the ones in <ucontext.h>. */
+
+- pc = (u1 *) _mc->gregs[REG_RIP];
++ pc = (u1 *) _mc->mc_rip;
+
+ t->pc = pc;
+ }
+@@ -179,10 +179,10 @@
+
+ _mc = &_uc->uc_mcontext;
+
+- pc = critical_find_restart_point((void *) _mc->gregs[REG_RIP]);
++ pc = critical_find_restart_point((void *) _mc->mc_rip);
+
+ if (pc != NULL)
+- _mc->gregs[REG_RIP] = (ptrint) pc;
++ _mc->mc_rip = (ptrint) pc;
+ }
+ #endif
+