From 13a5993b31ad0fb483272d8269d249d78ed01dd5 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 13 Apr 2014 15:51:08 -0700 Subject: [PATCH] Port to IRIX 6.5. This port requires IRIX cc, as I did not have time to get undump working with the old GCC on the system I had access to, but that's better than nothing. * configure.ac (gl_GCC_VERSION_IFELSE): Remove unused macro that wouldn't have worked anyway, with IRIX cc. (emacs_cv_clang, emacs_cv_sanitize_address) (ns_osx_have_104, ns_osx_have_105): Don't assume '#error' makes the compiler fail, as this doesn't work with IRIX cc. (CFLAGS, LIBS): Don't let the GnuTLS results infect later 'configure' checks. This runs afoul of an IRIX configuration where GnuTLS is in an optional library that also contains getdelim, and causes a later 'configure' to incorrectly think getdelim is supported. * src/alloc.c (TAGGABLE_NULL): New constant, for porting to hosts with nontrivial DATA_SEG_BITS settings. (next_vector, set_next_vector): Use it. * src/conf_post.h (INET6) [IRIX6_5]: Define. (HAVE_GETADDRINFO) [IRIX6_5]: Undef. * src/data.c (BITS_PER_ULL): Don't assume ULLONG_MAX is defined. * src/lisp.h (lisp_h_XPNTR): Don't OR in bits that aren't masked out, for consistency with how TAGGABLE_NULL is computed. Fixes: debbugs:9684 --- ChangeLog | 17 +++++++++++++++++ configure.ac | 29 ++++------------------------- src/ChangeLog | 12 ++++++++++++ src/alloc.c | 10 ++++++++-- src/conf_post.h | 3 ++- src/data.c | 2 +- src/lisp.h | 2 +- 7 files changed, 45 insertions(+), 30 deletions(-) diff --git a/ChangeLog b/ChangeLog index 69e03a1bab5..f70e461cd5b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2014-04-13 Paul Eggert + + Port to IRIX 6.5 (Bug#9684). + This port requires IRIX cc, as I did not have time to get + undump working with the old GCC on the system I had access to, + but that's better than nothing. + * configure.ac (gl_GCC_VERSION_IFELSE): Remove unused macro + that wouldn't have worked anyway, with IRIX cc. + (emacs_cv_clang, emacs_cv_sanitize_address) + (ns_osx_have_104, ns_osx_have_105): + Don't assume '#error' makes the compiler fail, + as this doesn't work with IRIX cc. + (CFLAGS, LIBS): Don't let the GnuTLS results infect later 'configure' + checks. This runs afoul of an IRIX configuration where GnuTLS is + in an optional library that also contains getdelim, and causes + a later 'configure' to incorrectly think getdelim is supported. + 2014-04-13 Eli Zaretskii * configure.ac (LN_S_FILEONLY, LN_S): Use "/bin/ln" on MinGW, to diff --git a/configure.ac b/configure.ac index 3113fe0e5c4..9d69e2670ec 100644 --- a/configure.ac +++ b/configure.ac @@ -779,30 +779,12 @@ if test "${enableval}" != "no"; then fi fi) -# gl_GCC_VERSION_IFELSE([major], [minor], [run-if-found], [run-if-not-found]) -# ------------------------------------------------ -# If $CPP is gcc-MAJOR.MINOR or newer, then run RUN-IF-FOUND. -# Otherwise, run RUN-IF-NOT-FOUND. -AC_DEFUN([gl_GCC_VERSION_IFELSE], - [AC_PREPROC_IFELSE( - [AC_LANG_PROGRAM( - [[ -#if ($1) < __GNUC__ || (($1) == __GNUC__ && ($2) <= __GNUC_MINOR__) -/* ok */ -#else -# error "your version of gcc is older than $1.$2" -#endif - ]]), - ], [$3], [$4]) - ] -) - # clang is unduly picky about some things. AC_CACHE_CHECK([whether the compiler is clang], [emacs_cv_clang], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[ #ifndef __clang__ - #error "not clang" + error "not clang"; #endif ]])], [emacs_cv_clang=yes], @@ -1114,7 +1096,7 @@ AC_CACHE_CHECK([whether addresses are sanitized], #endif #if defined __SANITIZE_ADDRESS__ || __has_feature (address_sanitizer) #else - #error "Addresses are not sanitized." + error "Addresses are not sanitized."; #endif ]])], [emacs_cv_sanitize_address=yes], @@ -1712,7 +1694,7 @@ fail; #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040 ; /* OK */ #else -#error "OSX 10.4 or newer required" + error "OSX 10.4 or newer required"; #endif #endif ])], @@ -1730,7 +1712,7 @@ fail; #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 ; /* OK */ #else -#error "OSX 10.5 not found" + error "OSX 10.5 not found"; #endif #endif ])], @@ -2529,9 +2511,6 @@ if test "${with_gnutls}" = "yes" ; then # Windows loads GnuTLS dynamically if test "${opsys}" = "mingw32"; then LIBGNUTLS_LIBS= - else - CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS" - LIBS="$LIBGNUTLS_LIBS $LIBS" fi fi diff --git a/src/ChangeLog b/src/ChangeLog index d885863d73c..be4ce13129c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,15 @@ +2014-04-13 Paul Eggert + + Port to IRIX 6.5 (Bug#9684). + * alloc.c (TAGGABLE_NULL): New constant, + for porting to hosts with nontrivial DATA_SEG_BITS settings. + (next_vector, set_next_vector): Use it. + * conf_post.h (INET6) [IRIX6_5]: Define. + (HAVE_GETADDRINFO) [IRIX6_5]: Undef. + * data.c (BITS_PER_ULL): Don't assume ULLONG_MAX is defined. + * lisp.h (lisp_h_XPNTR): Don't OR in bits that aren't masked out, + for consistency with how TAGGABLE_NULL is computed. + 2014-04-13 Eli Zaretskii * keyboard.c (Fopen_dribble_file): Encode the dribble file-name diff --git a/src/alloc.c b/src/alloc.c index d4e24b6244b..ccb955a547b 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -2647,18 +2647,24 @@ DEFUN ("make-list", Fmake_list, Smake_list, 2, 2, 0, ***********************************************************************/ /* Sometimes a vector's contents are merely a pointer internally used - in vector allocation code. Usually you don't want to touch this. */ + in vector allocation code. On the rare platforms where a null + pointer cannot be tagged, represent it with a Lisp 0. + Usually you don't want to touch this. */ + +enum { TAGGABLE_NULL = (DATA_SEG_BITS & ~VALMASK) == 0 }; static struct Lisp_Vector * next_vector (struct Lisp_Vector *v) { + if (! TAGGABLE_NULL && EQ (v->contents[0], make_number (0))) + return 0; return XUNTAG (v->contents[0], 0); } static void set_next_vector (struct Lisp_Vector *v, struct Lisp_Vector *p) { - v->contents[0] = make_lisp_ptr (p, 0); + v->contents[0] = TAGGABLE_NULL || p ? make_lisp_ptr (p, 0) : make_number (0); } /* This value is balanced well enough to avoid too much internal overhead diff --git a/src/conf_post.h b/src/conf_post.h index 80d561090ed..bb3be1bb1ea 100644 --- a/src/conf_post.h +++ b/src/conf_post.h @@ -99,7 +99,8 @@ typedef bool bool_bf; #ifdef emacs char *_getpty(); #endif - +#define INET6 /* Needed for struct sockaddr_in6. */ +#undef HAVE_GETADDRINFO /* IRIX has getaddrinfo but not struct addrinfo. */ #endif /* IRIX6_5 */ #ifdef MSDOS diff --git a/src/data.c b/src/data.c index 4ef81f2474e..33dd619a0e1 100644 --- a/src/data.c +++ b/src/data.c @@ -2982,7 +2982,7 @@ bool_vector_spare_mask (EMACS_INT nr_bits) /* Info about unsigned long long, falling back on unsigned long if unsigned long long is not available. */ -#if HAVE_UNSIGNED_LONG_LONG_INT +#if HAVE_UNSIGNED_LONG_LONG_INT && defined ULLONG_MAX enum { BITS_PER_ULL = CHAR_BIT * sizeof (unsigned long long) }; # define ULL_MAX ULLONG_MAX #else diff --git a/src/lisp.h b/src/lisp.h index ea294f8d1da..6232c326c9a 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -344,7 +344,7 @@ enum enum_USE_LSB_TAG { USE_LSB_TAG = false }; (eassert (CONSP (a)), (struct Lisp_Cons *) XUNTAG (a, Lisp_Cons)) #define lisp_h_XHASH(a) XUINT (a) #define lisp_h_XPNTR(a) \ - ((void *) (intptr_t) ((XLI (a) & VALMASK) | DATA_SEG_BITS)) + ((void *) (intptr_t) ((XLI (a) & VALMASK) | (DATA_SEG_BITS & ~VALMASK))) #define lisp_h_XSYMBOL(a) \ (eassert (SYMBOLP (a)), (struct Lisp_Symbol *) XUNTAG (a, Lisp_Symbol)) #ifndef GC_CHECK_CONS_LIST -- 2.39.2