changeset 2132:34ca43a57692

[xemacs-hg @ 2004-06-16 12:01:17 by malcolmp] IA-64 compilation and unaligned access fixes.
author malcolmp
date Wed, 16 Jun 2004 12:01:19 +0000
parents 646a9dd3e204
children 5c7bc4e019e6
files src/ChangeLog src/emacs.c src/file-coding.c src/file-coding.h src/malloc.c src/mem-limits.h
diffstat 6 files changed, 31 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Wed Jun 16 10:32:59 2004 +0000
+++ b/src/ChangeLog	Wed Jun 16 12:01:19 2004 +0000
@@ -1,3 +1,15 @@
+2004-06-15  Malcolm Purvis  <malcolmp@xemacs.org>
+
+	* emacs.c:
+	* malloc.c: lim_data is a long because in some architectures
+	(eg ia-64) an int cannot hold the address range.
+	* mem-limits.h: lim-data is a long.  Linux uses getrlimit() instead
+	of ulimit() because ulimit() always returns -1.
+	* file-coding.h (struct Lisp_Coding_System): Moved a field to the
+	end of the structure to work around alignment problems on the ia-64.
+	* file-coding.c (struct convert_eol_coding_system): Added dummy
+	field to work around alignment problems on the ia-64.
+
 2004-06-08  Didier Verna  <didier@xemacs.org>
 
 	* config.h.in (EXTERN_C_BLOCK_BEGIN): Remove.
--- a/src/emacs.c	Wed Jun 16 10:32:59 2004 +0000
+++ b/src/emacs.c	Wed Jun 16 12:01:19 2004 +0000
@@ -402,7 +402,7 @@
 
 /* Number of bytes of writable memory we can expect to be able to get:
    Leave this as an unsigned int because it could potentially be 4G */
-unsigned int lim_data;
+unsigned long lim_data;
 
 /* WARNING!
 
--- a/src/file-coding.c	Wed Jun 16 10:32:59 2004 +0000
+++ b/src/file-coding.c	Wed Jun 16 12:01:19 2004 +0000
@@ -3032,6 +3032,10 @@
 struct convert_eol_coding_system
 {
   enum eol_type subtype;
+  int dummy; /* On some architectures (eg ia64) the portable dumper can
+                produce unaligned access errors without this field.  Probably
+                because the combined structure of this structure and
+                Lisp_Coding_System is not properly aligned. */
 };
 
 #define CODING_SYSTEM_CONVERT_EOL_SUBTYPE(codesys) \
--- a/src/file-coding.h	Wed Jun 16 10:32:59 2004 +0000
+++ b/src/file-coding.h	Wed Jun 16 12:01:19 2004 +0000
@@ -187,10 +187,6 @@
   struct lcrecord_header header;
   struct coding_system_methods *methods;
 
-  /* If true, this is an internal coding system, which will not show up in
-     coding-system-list unless a special parameter is given to it. */
-  int internal_p;
-
 #define CODING_SYSTEM_SLOT_DECLARATION
 #define MARKED_SLOT(x) Lisp_Object x;
 #include "coding-system-slots.h"
@@ -199,6 +195,10 @@
      coding-system-slots.h. */
   enum eol_type eol_type;
 
+  /* If true, this is an internal coding system, which will not show up in
+     coding-system-list unless a special parameter is given to it. */
+  int internal_p;
+
   /* type-specific extra data attached to a coding_system */
   char data[1];
 };
--- a/src/malloc.c	Wed Jun 16 10:32:59 2004 +0000
+++ b/src/malloc.c	Wed Jun 16 12:01:19 2004 +0000
@@ -285,7 +285,7 @@
 static char busy[30];
 
 /* Number of bytes of writable memory we can expect to be able to get */
-extern unsigned int lim_data;
+extern unsigned long lim_data;
 
 /* Level number of warnings already issued.
   0 -- no warnings issued.
--- a/src/mem-limits.h	Wed Jun 16 10:32:59 2004 +0000
+++ b/src/mem-limits.h	Wed Jun 16 12:01:19 2004 +0000
@@ -58,20 +58,14 @@
 #endif
 
 #if defined(__bsdi__) || defined(__NetBSD__) || defined(__linux__) || defined(__OpenBSD__)
-#if defined(__linux__) && defined (powerpc)	/*Added by Fukui*/
-#else					/*Added by Fukui*/
 #define BSD4_2
-#endif					/*Added by Fukui*/
 #endif
 
 #ifndef BSD4_2
 #ifndef USG
 #ifndef WIN32_NATIVE
 #ifndef CYGWIN
-#if defined(__linux__) && defined(powerpc)	/*Added Kaoru Fukui*/
-#else						/*Added Kaoru Fukui*/
 #include <sys/vlimit.h>
-#endif				/*Added by Fukui*/
 #endif /* not CYGWIN */
 #endif /* not WIN32_NATIVE */
 #endif /* not USG */
@@ -108,7 +102,7 @@
 static POINTER data_space_start;
 
 /* Number of bytes of writable memory we can expect to be able to get */
-extern unsigned int lim_data;
+extern unsigned long lim_data;
 
 #if defined (HEAP_IN_DATA) && !defined(PDUMP)
 extern unsigned long static_heap_size;
@@ -118,11 +112,11 @@
 {
   if (!initialized)
     {
-      lim_data = (unsigned int) -1; /* static_heap_size; */
+      lim_data = (unsigned long) -1; /* static_heap_size; */
     }
   else
     {
-      lim_data = (unsigned int) -1;
+      lim_data = (unsigned long) -1;
     }
 }
 #else
@@ -130,25 +124,25 @@
 static void
 get_lim_data (void)
 {
-  lim_data = (unsigned int) -1;
+  lim_data = (unsigned long) -1;
 }
 #else /* not NO_LIM_DATA */
 
-#ifdef USG
+#if defined(USG) && !defined(LINUX)
 
 static void
 get_lim_data (void)
 {
-  lim_data = (unsigned int) -1;
+  lim_data = (unsigned long) -1;
 
   /* Use the ulimit call, if we seem to have it.  */
-#if !defined (ULIMIT_BREAK_VALUE) || defined (LINUX)
+#if !defined (ULIMIT_BREAK_VALUE)
   lim_data = ulimit (3, 0);
 #endif
 
   /* If that didn't work, just use the macro's value.  */
 #ifdef ULIMIT_BREAK_VALUE
-  if (lim_data == (unsigned int) -1)
+  if (lim_data == (unsigned long) -1)
     lim_data = ULIMIT_BREAK_VALUE;
 #endif
 
@@ -166,7 +160,7 @@
 }
 
 #else
-#if !defined (BSD4_2) && !defined (__osf__)
+#if !defined (BSD4_2) && !defined (__osf__) && !defined(LINUX)
 
 static void
 get_lim_data (void)