From: Glenn Morris Date: Sat, 14 Jul 2012 00:04:10 +0000 (-0400) Subject: Move GC_SETJMP_WORKS, GC_MARK_STACK from src/s to configure X-Git-Tag: emacs-24.2.90~1199^2~5 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5b3f250f88e2bf2abd8b5af553b7643d3cdcc782;p=emacs.git Move GC_SETJMP_WORKS, GC_MARK_STACK from src/s to configure * configure.ac (GC_SETJMP_WORKS, GC_MARK_STACK): Move here from src/s. (AH_BOTTOM): Move GC_SETJMP_WORKS GCC fallback to main body. * src/s/aix4-2.h, src/s/freebsd.h, src/s/gnu-linux.h, src/s/hpux10-20.h: * src/s/irix6-5.h, src/s/netbsd.h, src/s/sol2-6.h, src/s/unixware.h: Let configure set GC_SETJMP_WORKS, GC_MARK_STACK. --- diff --git a/ChangeLog b/ChangeLog index 54159560e5d..cb7d197c8d1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-07-14 Glenn Morris + + * configure.ac (GC_SETJMP_WORKS, GC_MARK_STACK): Move here from src/s. + (AH_BOTTOM): Move GC_SETJMP_WORKS GCC fallback to main body. + 2012-07-13 Glenn Morris * configure.ac (opsysfile): Set to empty on gnu, cygwin. diff --git a/configure.ac b/configure.ac index ed500dd6ea8..a553c340b85 100644 --- a/configure.ac +++ b/configure.ac @@ -3600,6 +3600,55 @@ case $opsys in esac +dnl These won't be used automatically yet. We also need to know, at least, +dnl that the stack is continuous. +AH_TEMPLATE(GC_SETJMP_WORKS, [Define if setjmp is known to save all + registers relevant for conservative garbage collection in the jmp_buf.]) + +AH_TEMPLATE(GC_MARK_STACK, [Define to GC_USE_GCPROS_AS_BEFORE if + conservative garbage collection is not known to work.]) + + +case $opsys in + aix4-2 | hpux* | unixware) + dnl Conservative garbage collection has not been tested, so for now + dnl play it safe and stick with the old-fashioned way of marking. + AC_DEFINE(GC_MARK_STACK, [GC_USE_GCPROS_AS_BEFORE]) + ;; + + dnl Not all the architectures are tested, but there are Debian packages + dnl for SCM and/or Guile on them, so the technique must work. See also + dnl comments in alloc.c concerning setjmp and gcc. + dnl Fixme: it's probably safe to just use the GCC conditional below. + gnu-linux | gnu-kfreebsd ) + AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[ +#if defined __i386__ || defined __sparc__ || defined __mc68000__ \ + || defined __alpha__ || defined __mips__ || defined __s390__ \ + || defined __arm__ || defined __powerpc__ || defined __amd64__ \ + || defined __ia64__ || defined __sh__ +/* ok */ +#else +# error "setjmp not known to work on this arch" +#endif + ]], [[]])], AC_DEFINE(GC_SETJMP_WORKS, 1), + AC_DEFINE(GC_MARK_STACK, [GC_USE_GCPROS_AS_BEFORE]) ) + ;; +esac + + +if test x$GCC = xyes; then + dnl GC_SETJMP_WORKS is nearly always appropriate for GCC. + AC_DEFINE(GC_SETJMP_WORKS, 1) +else + case $opsys in + dnl irix: Tested on Irix 6.5. SCM worked on earlier versions. + freebsd | netbsd | openbsd | irix6-5 | sol2* ) + AC_DEFINE(GC_SETJMP_WORKS, 1) + ;; + esac +fi dnl GCC? + + dnl Used in xfaces.c. case $opsys in hpux* | sol2* ) @@ -4221,15 +4270,6 @@ AH_BOTTOM([ #undef noinline #endif -/* These won't be used automatically yet. We also need to know, at least, - that the stack is continuous. */ -#ifdef __GNUC__ -# ifndef GC_SETJMP_WORKS - /* GC_SETJMP_WORKS is nearly always appropriate for GCC. */ -# define GC_SETJMP_WORKS 1 -# endif -#endif - #endif /* EMACS_CONFIG_H */ /* diff --git a/src/ChangeLog b/src/ChangeLog index b7736ae5db6..6571030039c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2012-07-14 Glenn Morris + + * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h: + * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h: + Let configure set GC_SETJMP_WORKS, GC_MARK_STACK. + 2012-07-13 Glenn Morris * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it. diff --git a/src/s/aix4-2.h b/src/s/aix4-2.h index debc9f78c16..6c881a7fb8c 100644 --- a/src/s/aix4-2.h +++ b/src/s/aix4-2.h @@ -19,6 +19,3 @@ along with GNU Emacs. If not, see . */ /* Perry Smith says these are correct. */ #undef sigmask -/* Conservative garbage collection has not been tested, so for now - play it safe and stick with the old-fashioned way of marking. */ -#define GC_MARK_STACK GC_USE_GCPROS_AS_BEFORE diff --git a/src/s/freebsd.h b/src/s/freebsd.h index ff31f073427..9177403f426 100644 --- a/src/s/freebsd.h +++ b/src/s/freebsd.h @@ -20,6 +20,3 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see . */ -/* Tell that garbage collector that setjmp is known to save all - registers relevant for conservative garbage collection in the jmp_buf. */ -#define GC_SETJMP_WORKS 1 diff --git a/src/s/gnu-linux.h b/src/s/gnu-linux.h index 0a083fe3f15..2847fd6d19c 100644 --- a/src/s/gnu-linux.h +++ b/src/s/gnu-linux.h @@ -20,18 +20,3 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see . */ -/* Tell that garbage collector that setjmp is known to save all - registers relevant for conservative garbage collection in the jmp_buf. - Not all the architectures are tested, but there are Debian packages - for SCM and/or Guile on them, so the technique must work. See also - comments in alloc.c concerning setjmp and gcc. Fixme: it's - probably safe to just let the GCC conditional in AH_BOTTOM handle this. -*/ -#if defined __i386__ || defined __sparc__ || defined __mc68000__ \ - || defined __alpha__ || defined __mips__ || defined __s390__ \ - || defined __arm__ || defined __powerpc__ || defined __amd64__ \ - || defined __ia64__ || defined __sh__ -#define GC_SETJMP_WORKS 1 -#else -#define GC_MARK_STACK GC_USE_GCPROS_AS_BEFORE -#endif diff --git a/src/s/hpux10-20.h b/src/s/hpux10-20.h index c913062701a..94b46a715ea 100644 --- a/src/s/hpux10-20.h +++ b/src/s/hpux10-20.h @@ -25,7 +25,3 @@ along with GNU Emacs. If not, see . */ Note we also undef HAVE_RANDOM via configure. */ #undef srandom #undef random - -/* Conservative garbage collection has not been tested, so for now - play it safe and stick with the old-fashioned way of marking. */ -#define GC_MARK_STACK GC_USE_GCPROS_AS_BEFORE diff --git a/src/s/irix6-5.h b/src/s/irix6-5.h index 1d1989ad9ac..9b215845461 100644 --- a/src/s/irix6-5.h +++ b/src/s/irix6-5.h @@ -30,5 +30,3 @@ char *_getpty(); #undef TIOCSIGSEND /* defined in usg5-4-common.h */ -/* Tested on Irix 6.5. SCM worked on earlier versions. */ -#define GC_SETJMP_WORKS 1 diff --git a/src/s/netbsd.h b/src/s/netbsd.h index b0e298f2c2e..7a571ee8116 100644 --- a/src/s/netbsd.h +++ b/src/s/netbsd.h @@ -22,6 +22,3 @@ along with GNU Emacs. If not, see . */ that are handled with CPP __RENAME() macro in signal.h. */ #include -/* Tell that garbage collector that setjmp is known to save all - registers relevant for conservative garbage collection in the jmp_buf. */ -#define GC_SETJMP_WORKS 1 diff --git a/src/s/sol2-6.h b/src/s/sol2-6.h index 78d13f2063d..3bed55598b7 100644 --- a/src/s/sol2-6.h +++ b/src/s/sol2-6.h @@ -19,4 +19,3 @@ along with GNU Emacs. If not, see . */ #include "usg5-4-common.h" -#define GC_SETJMP_WORKS 1 diff --git a/src/s/unixware.h b/src/s/unixware.h index f42e6363245..59c74a56f4e 100644 --- a/src/s/unixware.h +++ b/src/s/unixware.h @@ -17,9 +17,4 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see . */ - #include "usg5-4-common.h" - -/* Conservative garbage collection has not been tested, so for now - play it safe and stick with the old-fashioned way of marking. */ -#define GC_MARK_STACK GC_USE_GCPROS_AS_BEFORE