Package: guile-1.8
Version: 1.8.5+1-1
Severity: serious
Tags: patch

Guile-1.8 currently fails to build on ia64, m68k, mips, mipsel and
powerpc. I created two patches which let it build again on mips,
however, one of those patches is only a workaround.

There are two problems:
- For Linux on mips/mipsel the gc definitions look decidedly strange,
  I replaced those with more sensible variants.
- For at least mips, but probably a number of other architectures as
  well, the stack direction check goes wrong. It looks like gcc
  outsmarts the autoconf test. I worked around by removing the test,
  this breaks HP/UX on hppa, and probably also some old Cray machines.


Thiemo
--- guile-1.8-1.8.5+1.old/libguile/gc_os_dep.c	2008-04-07 22:30:03.000000000 +0100
+++ guile-1.8-1.8.5+1/libguile/gc_os_dep.c	2008-05-15 15:02:07.000000000 +0100
@@ -1008,19 +1008,18 @@ scm_get_stack_base ()
 
 # ifdef MIPS
 #   define MACH_TYPE "MIPS"
-/* #   define STACKBOTTOM ((ptr_t)0x7fff8000)  sometimes also works.  */
 #   ifdef LINUX
-      /* This was developed for a linuxce style platform.  Probably	*/
-      /* needs to be tweaked for workstation class machines.		*/
-#     define OS_TYPE "LINUX"
-      extern int __data_start;
-#     define DATASTART ((ptr_t)(&__data_start))
-#     define ALIGNMENT 4
-#     define USE_GENERIC_PUSH_REGS 1
-#     define STACKBOTTOM 0x80000000
-	/* In many cases, this should probably use LINUX_STACKBOTTOM 	*/
-	/* instead. But some kernel versions seem to give the wrong	*/
-	/* value from /proc.						*/
+#       define CPP_WORDSZ _MIPS_SZPTR
+#       define OS_TYPE "LINUX"
+#       define ALIGNMENT 4
+#       define ALIGN_DOUBLE
+        extern int _fdata;
+#       define DATASTART ((ptr_t)(&_fdata))
+        extern int _end;
+#       define DATAEND ((ptr_t)(&_end))
+#       define STACKBOTTOM ((ptr_t)0x7fff8000)
+#       define USE_GENERIC_PUSH_REGS 1
+#       define DYNAMIC_LOADING
 #   endif /* Linux */
 #   ifdef ULTRIX
 #	define HEURISTIC2
--- guile-1.8-1.8.5+1.old/configure.in	2008-05-15 15:47:04.000000000 +0100
+++ guile-1.8-1.8.5+1/configure.in	2008-05-15 15:25:38.000000000 +0100
@@ -1106,12 +1106,12 @@ GUILE_STRUCT_UTIMBUF
 #--------------------------------------------------------------------
 
 SCM_I_GSC_STACK_GROWS_UP=0
-AC_TRY_RUN(aux (l) unsigned long l;
-	     { int x; exit (l >= ((unsigned long)&x)); }
-	   main () { int q; aux((unsigned long)&q); },
-           [SCM_I_GSC_STACK_GROWS_UP=1],
-	   [],
-           [AC_MSG_WARN(Guessing that stack grows down -- see scmconfig.h)])
+dnl AC_TRY_RUN(aux (l) unsigned long l;
+dnl 	     { int x; exit (l >= ((unsigned long)&x)); }
+dnl 	   main () { int q; aux((unsigned long)&q); },
+dnl            [SCM_I_GSC_STACK_GROWS_UP=1],
+dnl 	   [],
+dnl            [AC_MSG_WARN(Guessing that stack grows down -- see scmconfig.h)])
 
 AC_CHECK_SIZEOF(float)
 if test "$ac_cv_sizeof_float" -le "$ac_cv_sizeof_long"; then
--- guile-1.8-1.8.5+1.old/configure	2008-05-15 15:47:04.000000000 +0100
+++ guile-1.8-1.8.5+1/configure	2008-05-15 16:31:07.000000000 +0100
@@ -41987,51 +41987,6 @@ _ACEOF
 #--------------------------------------------------------------------
 
 SCM_I_GSC_STACK_GROWS_UP=0
-if test "$cross_compiling" = yes; then
-  { echo "$as_me:$LINENO: WARNING: Guessing that stack grows down -- see scmconfig.h" >&5
-echo "$as_me: WARNING: Guessing that stack grows down -- see scmconfig.h" >&2;}
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-aux (l) unsigned long l;
-	     { int x; exit (l >= ((unsigned long)&x)); }
-	   main () { int q; aux((unsigned long)&q); }
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  SCM_I_GSC_STACK_GROWS_UP=1
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
-
 
 { echo "$as_me:$LINENO: checking for float" >&5
 echo $ECHO_N "checking for float... $ECHO_C" >&6; }

Reply via email to