[kaffe] CVS kaffe (robilad): Fixed ALIGNMENTOF_VOIDP cross-compilation problems for good

Kaffe CVS cvs-commits at kaffe.org
Sun Mar 13 03:37:26 PST 2005


PatchSet 5530 
Date: 2005/03/13 11:31:35
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
Fixed ALIGNMENTOF_VOIDP cross-compilation problems for good

2005-03-13  Dalibor Topic  <robilad at kaffe.org>

        * configure.ac: Removed ALIGNMENTOF_VOIDP check.

        * include/defs.h (ALIGNMENTOF_VOIDP): Define portably.

        * kaffe/kaffevm/kaffe-gc/gc-incremental.c,
        kaffe/kaffevm/classMethod.c,
        kaffe/kaffevm/gcFuncs.c:
        Include defs.h.

Members: 
	ChangeLog:1.3704->1.3705 
	configure:1.431->1.432 
	configure.ac:1.121->1.122 
	config/config.h.in:1.135->1.136 
	include/defs.h:1.6->1.7 
	kaffe/kaffevm/classMethod.c:1.136->1.137 
	kaffe/kaffevm/gcFuncs.c:1.68->1.69 
	kaffe/kaffevm/kaffe-gc/gc-incremental.c:1.20->1.21 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.3704 kaffe/ChangeLog:1.3705
--- kaffe/ChangeLog:1.3704	Sun Mar 13 01:26:04 2005
+++ kaffe/ChangeLog	Sun Mar 13 11:31:35 2005
@@ -1,3 +1,14 @@
+2005-03-13  Dalibor Topic  <robilad at kaffe.org>
+
+	* configure.ac: Removed ALIGNMENTOF_VOIDP check.
+
+	* include/defs.h (ALIGNMENTOF_VOIDP): Define portably.
+
+	* kaffe/kaffevm/kaffe-gc/gc-incremental.c,
+	kaffe/kaffevm/classMethod.c,
+	kaffe/kaffevm/gcFuncs.c: 
+	Include defs.h.
+
 2005-03-13  Jim Huang  <jserv at kaffe.org>
 
 	* kaffe/kaffevm/locks.c:
Index: kaffe/configure
diff -u kaffe/configure:1.431 kaffe/configure:1.432
--- kaffe/configure:1.431	Sat Mar 12 19:25:52 2005
+++ kaffe/configure	Sun Mar 13 11:31:39 2005
@@ -31998,62 +31998,6 @@
 
 
 
-echo "$as_me:$LINENO: checking alignment of void*" >&5
-echo $ECHO_N "checking alignment of void*... $ECHO_C" >&6
-if test "${ac_cv_alignmentof_voidp+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test "$cross_compiling" = yes; then
-  ac_cv_alignmentof_voidp=$ac_cv_sizeof_void_p
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <stdio.h>
-main() { struct { char c; void *p; } t; FILE *f;
-  if ((char*) &t.c != (char*) &t)  exit (1);
-  f=fopen ("conftestdata", "w");
-  if (! f)                         exit (1);
-  fprintf (f, "%d", ((char*) &t.p)-((char*) &t));
-  fclose(f); exit (0); }
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_alignmentof_voidp=`cat conftestdata`
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: Unexpected result" >&5
-echo "$as_me: error: Unexpected result" >&2;}
-   { (exit 1); exit 1; }; }
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-fi
-echo "$as_me:$LINENO: result: $ac_cv_alignmentof_voidp" >&5
-echo "${ECHO_T}$ac_cv_alignmentof_voidp" >&6
-
-cat >>confdefs.h <<_ACEOF
-#define ALIGNMENTOF_VOIDP $ac_cv_alignmentof_voidp
-_ACEOF
-
-
-
 echo "$as_me:$LINENO: checking return type of signal handlers" >&5
 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6
 if test "${ac_cv_type_signal+set}" = set; then
Index: kaffe/configure.ac
diff -u kaffe/configure.ac:1.121 kaffe/configure.ac:1.122
--- kaffe/configure.ac:1.121	Sat Mar 12 19:25:55 2005
+++ kaffe/configure.ac	Sun Mar 13 11:31:46 2005
@@ -867,20 +867,6 @@
 AC_TYPE_OFF_T
 AC_TYPE_PID_T
 
-dnl =========================================================================
-dnl Checks for alignments
-dnl -------------------------------------------------------------------------
-
-AC_CACHE_CHECK(alignment of void*, ac_cv_alignmentof_voidp,
-AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
-main() { struct { char c; void *p; } t; FILE *f;
-  if ((char*) &t.c != (char*) &t)  exit (1);
-  f=fopen ("conftestdata", "w");
-  if (! f)                         exit (1);
-  fprintf (f, "%d", ((char*) &t.p)-((char*) &t));
-  fclose(f); exit (0); }]])],[ac_cv_alignmentof_voidp=`cat conftestdata`],[AC_MSG_ERROR(Unexpected result)],[ac_cv_alignmentof_voidp=$ac_cv_sizeof_void_p]))
-AC_DEFINE_UNQUOTED(ALIGNMENTOF_VOIDP,$ac_cv_alignmentof_voidp, [How are pointers aligned])
-
 dnl -------------------------------------------------------------------------
 
 AC_TYPE_SIGNAL
Index: kaffe/config/config.h.in
diff -u kaffe/config/config.h.in:1.135 kaffe/config/config.h.in:1.136
--- kaffe/config/config.h.in:1.135	Thu Feb 24 15:06:50 2005
+++ kaffe/config/config.h.in	Sun Mar 13 11:31:47 2005
@@ -1,8 +1,5 @@
 /* config/config.h.in.  Generated from configure.ac by autoheader.  */
 
-/* How are pointers aligned */
-#undef ALIGNMENTOF_VOIDP
-
 /* Define the version we're compiling for */
 #undef ARCHOS
 
Index: kaffe/include/defs.h
diff -u kaffe/include/defs.h:1.6 kaffe/include/defs.h:1.7
--- kaffe/include/defs.h:1.6	Mon Jul  5 16:40:10 2004
+++ kaffe/include/defs.h	Sun Mar 13 11:31:48 2005
@@ -65,4 +65,10 @@
 #define NULL (void *)0
 #endif
 
+/* define alignment of 'void *' */
+#ifndef ALIGNMENTOF_VOIDP
+typedef struct { char c; void *p; } alignmentof_voidp_helper;
+#define ALIGNMENTOF_VOIDP (offsetof(alignmentof_voidp_helper, p))
+#endif
+
 #endif /* __defs_h */
Index: kaffe/kaffe/kaffevm/classMethod.c
diff -u kaffe/kaffe/kaffevm/classMethod.c:1.136 kaffe/kaffe/kaffevm/classMethod.c:1.137
--- kaffe/kaffe/kaffevm/classMethod.c:1.136	Fri Mar 11 16:41:52 2005
+++ kaffe/kaffe/kaffevm/classMethod.c	Sun Mar 13 11:31:49 2005
@@ -14,6 +14,7 @@
 #include "config-std.h"
 #include "config-mem.h"
 #include "config-hacks.h"
+#include "defs.h"
 #include "gtypes.h"
 #include "slots.h"
 #include "access.h"
Index: kaffe/kaffe/kaffevm/gcFuncs.c
diff -u kaffe/kaffe/kaffevm/gcFuncs.c:1.68 kaffe/kaffe/kaffevm/gcFuncs.c:1.69
--- kaffe/kaffe/kaffevm/gcFuncs.c:1.68	Fri Mar 11 16:41:52 2005
+++ kaffe/kaffe/kaffevm/gcFuncs.c	Sun Mar 13 11:31:49 2005
@@ -16,6 +16,7 @@
 #include "debug.h"
 #include "config-std.h"
 #include "config-mem.h"
+#include "defs.h"
 #include "gtypes.h"
 #include "slots.h"
 #include "access.h"
Index: kaffe/kaffe/kaffevm/kaffe-gc/gc-incremental.c
diff -u kaffe/kaffe/kaffevm/kaffe-gc/gc-incremental.c:1.20 kaffe/kaffe/kaffevm/kaffe-gc/gc-incremental.c:1.21
--- kaffe/kaffe/kaffevm/kaffe-gc/gc-incremental.c:1.20	Fri Mar 11 16:41:55 2005
+++ kaffe/kaffe/kaffevm/kaffe-gc/gc-incremental.c	Sun Mar 13 11:31:50 2005
@@ -16,6 +16,7 @@
 #include "debug.h"
 #include "config-std.h"
 #include "config-mem.h"
+#include "defs.h"
 #include "gtypes.h"
 #include "gc.h"
 #include "gc-mem.h"




More information about the kaffe mailing list