This is the mail archive of the
java-patches@sourceware.cygnus.com
mailing list for the Java project.
Re: Boehm GC import
- To: tromey@cygnus.com
- Subject: Re: Boehm GC import
- From: Alexandre Oliva <oliva@dcc.unicamp.br>
- Date: 19 Jul 1999 02:13:03 -0300
- Cc: java-patches@sourceware.cygnus.com
- References: <87pv2dqwh6.fsf@cygnus.com>
On Jun 30, 1999, Tom Tromey <tromey@cygnus.com> wrote:
> I've imported version 4.14 of the Boehm GC into libgcj/boehm-gc
> in case anybody (Alexandre :-) wants to extract patches for new
> ports in 4.14 for possible inclusion in the 2.95 branch.
I hope it's not too late.
With this simple patch, libgcj now builds and apparently runs on
GNU/Linux/sparc. There's also a hunk that selects HEURISTIC2 for
Solaris 7/sparc, as in version 4.14.
Index: boehm-gc/ChangeLog
from Alexandre Oliva <oliva@dcc.unicamp.br>
* config.h: Updates for GNU/Linux/sparc. Use HEURISTIC2 on
Solaris7/sparc, since HEURISTIC1 does not work.
* os_dep.c: Updates for GNU/Linux/sparc.
* misc.c (GC_init_inner): Likewise.
From gc-boehm 4.14.
Index: boehm-gc/config.h
===================================================================
RCS file: /cvs/java/libgcj/boehm-gc/config.h,v
retrieving revision 1.4
diff -u -r1.4 config.h
--- boehm-gc/config.h 1999/06/21 15:38:59 1.4
+++ boehm-gc/config.h 1999/07/19 03:08:04
@@ -128,6 +128,12 @@
# define LINUX
# define mach_type_known
# endif
+# if (defined(linux) || defined(__linux__)) && \
+ (defined(sparc) || defined(__sparc__))
+# define SPARC
+# define LINUX
+# define mach_type_known
+# endif
# if defined(__alpha) || defined(__alpha__)
# define ALPHA
# if defined(linux) || defined(__linux__)
@@ -498,7 +504,10 @@
# define HEAP_START DATAEND
# endif
# define PROC_VDB
-# define HEURISTIC1
+/* HEURISTIC1 reportedly no longer works under 2.7. Thus we */
+/* switched to HEURISTIC2, eventhough it creates some debugging */
+/* issues. */
+# define HEURISTIC2
# include <unistd.h>
# define GETPAGESIZE() sysconf(_SC_PAGESIZE)
/* getpagesize() appeared to be missing from at least one */
@@ -532,6 +541,18 @@
# define STACKBOTTOM ((ptr_t) 0xdfff0000)
# endif
# define DYNAMIC_LOADING
+# ifdef LINUX
+# define OS_TYPE "LINUX"
+# ifdef __ELF__
+# define DATASTART GC_data_start
+# else
+ Linux Sparc non elf ?
+# endif
+ extern int _end;
+# define DATAEND (&_end)
+# define SVR4
+# define STACKBOTTOM ((ptr_t) 0xf0000000)
+# endif
# endif
# ifdef I386
@@ -976,7 +997,7 @@
# define THREADS
# endif
-# if defined(SPARC)
+# if defined(SPARC) && !defined(LINUX)
# define SAVE_CALL_CHAIN
# define ASM_CLEAR_CODE /* Stack clearing is crucial, and we */
/* include assembly code to do it well. */
Index: boehm-gc/misc.c
===================================================================
RCS file: /cvs/java/libgcj/boehm-gc/misc.c,v
retrieving revision 1.4
diff -u -r1.4 misc.c
--- boehm-gc/misc.c 1999/06/21 15:39:01 1.4
+++ boehm-gc/misc.c 1999/07/19 03:08:04
@@ -439,6 +439,9 @@
# if defined(LINUX) && defined(ALPHA)
GC_init_linuxalpha();
# endif
+# if defined(LINUX) && defined(SPARC)
+ GC_init_linuxsparc();
+# endif
# ifdef SOLARIS_THREADS
GC_thr_init();
/* We need dirty bits in order to find live stack sections. */
Index: boehm-gc/os_dep.c
===================================================================
RCS file: /cvs/java/libgcj/boehm-gc/os_dep.c,v
retrieving revision 1.4
diff -u -r1.4 os_dep.c
--- boehm-gc/os_dep.c 1999/06/21 15:39:02 1.4
+++ boehm-gc/os_dep.c 1999/07/19 03:08:04
@@ -68,7 +68,7 @@
# define NEED_FIND_LIMIT
# endif
-# if defined(LINUX) && (defined(POWERPC) || defined(ALPHA))
+# if defined(LINUX) && (defined(POWERPC) || defined(ALPHA) || defined(SPARC))
# define NEED_FIND_LIMIT
# endif
@@ -224,6 +224,19 @@
}
#endif
+#if defined(LINUX) && defined(SPARC)
+ ptr_t GC_data_start;
+
+ void GC_init_linuxsparc()
+ {
+ extern ptr_t GC_find_limit();
+ 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);
+ }
+#endif
+
# ifdef ECOS
# ifndef ECOS_GC_MEMORY_SIZE
@@ -2261,7 +2274,7 @@
* Call stack save code for debugging.
* Should probably be in mach_dep.c, but that requires reorganization.
*/
-#if defined(SPARC)
+#if defined(SPARC) && !defined(LINUX)
# if defined(SUNOS4)
# include <machine/frame.h>
# else
--
Alexandre Oliva http://www.dcc.unicamp.br/~oliva IC-Unicamp, Bra[sz]il
oliva@{dcc.unicamp.br,guarana.{org,com}} aoliva@{acm.org,computer.org}
oliva@{gnu.org,kaffe.org,{egcs,sourceware}.cygnus.com,samba.org}
** I may forward mail about projects to mailing lists; please use them