From: Alexandre Oliva Date: Mon, 19 Jul 1999 19:32:38 +0000 (+0000) Subject: config.h: Updates for GNU/Linux/sparc. X-Git-Tag: releases/libgcj-2.95.0~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=23acce6cf92f933faa135ba55efc44faef6e2e4c;p=thirdparty%2Fgcc.git config.h: Updates for GNU/Linux/sparc. 1999-07-19 Alexandre Oliva * 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. From-SVN: r28181 --- diff --git a/boehm-gc/ChangeLog b/boehm-gc/ChangeLog index 5cea85f7cf12..beab3b3da1da 100644 --- a/boehm-gc/ChangeLog +++ b/boehm-gc/ChangeLog @@ -1,3 +1,11 @@ +1999-07-19 Alexandre Oliva + + * 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. + 1999-07-19 Tom Tromey * config.h (MPROTECT_VDB): Don't define on Linux. diff --git a/boehm-gc/config.h b/boehm-gc/config.h index 7791b6cacb98..913371629305 100644 --- a/boehm-gc/config.h +++ b/boehm-gc/config.h @@ -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 # 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 @@ -979,7 +1000,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. */ diff --git a/boehm-gc/misc.c b/boehm-gc/misc.c index 70f583f982d5..18b30a18a89b 100644 --- a/boehm-gc/misc.c +++ b/boehm-gc/misc.c @@ -439,6 +439,9 @@ void GC_init_inner() # 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. */ diff --git a/boehm-gc/os_dep.c b/boehm-gc/os_dep.c index 29cf8ff99ecd..1b1442fe5c56 100644 --- a/boehm-gc/os_dep.c +++ b/boehm-gc/os_dep.c @@ -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 @@ struct hblk *h; * 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 # else