Re: Bug#977223: guile-3.0: FTBFS on hppa - segmentation faults

Rob Browning <[email protected]>
Newsgroups gmane.linux.debian.ports.hppa,gmane.linux.debian.ports.68k,gmane.linux.debian.ports.powerpc
Message-ID <[email protected]>
John Paul Adrian Glaubitz <[email protected]> writes:

> Could you include this patch or a possible better version in the next guile-3.0 upload?

As mentioned, I'm working on 3.0.8, and the bootstrap process has
changed somewhat to support reproducible builds.  So I went ahead and
uploaded 3.0.8-1 without this patch, and then I hoped, if you have time,
you might be able to test that and see if we need to make adjustments to
the fix.  In particular, guile now has
{bootstrap,stage0,stage1,stage2}/Makefile.am.

It may be that we only need to adjust a subset of these (say bootstrap
and/or stage0)...

Oh, and I'm not sure it's working exactly right yet, but I'd been toying
with a more selective approach that works with automake's if/then
restrictions via an AM_CONDITIONAL.  Of course we'll still need to
figure out which Makefiles we need to adjust.


Oh, and you should be able to see those $(info ...) messages in the
build output, so we'll be able to see if it's picking the right setting.
(I just verified that it picks the right one for amd64, at least.)

Thanks
32-bit-be-optimze.patch (text/x-diff, 1.7 KB)
commit 6c1173b3a96d65159062b2ba82afb7264a01591e
Author: Rob Browning <[email protected]>
Date:   Sun Feb 27 12:55:42 2022 -0600

    Adjust GUILE_OPTIMIZATION to avoid 32-bit BE build crashes

diff --git a/bootstrap/Makefile.am b/bootstrap/Makefile.am
index a4634c447..0aa548c26 100644
--- a/bootstrap/Makefile.am
+++ b/bootstrap/Makefile.am
@@ -22,7 +22,14 @@
 
 
 GUILE_WARNINGS = -W0
-GUILE_OPTIMIZATIONS = -O1
+
+if !DEB_GUILE_32_BIT_BIG_ENDIAN
+  $(info Note: not adjusting GUILE_OPTIMIZATIONS for 32-bit big-endian architecture)
+  GUILE_OPTIMIZATIONS = -O1
+else
+  $(info Note: adjusting GUILE_OPTIMIZATIONS for 32-bit big-endian architecture)
+  GUILE_OPTIMIZATIONS = -O1 -Oresolve-primitives -Ocps
+endif
 
 include $(top_srcdir)/am/bootstrap.am
 
diff --git a/configure.ac b/configure.ac
index 827e1c09d..dec060414 100644
--- a/configure.ac
+++ b/configure.ac
@@ -369,6 +369,9 @@ else
 fi
 AC_SUBST([SCM_I_GSC_T_PTRDIFF])
 
+AM_CONDITIONAL([DEB_GUILE_32_BIT_BIG_ENDIAN],
+  [test "$ac_cv_words_bigendian" && test "$ac_cv_sizeof_void_p" -lt 8])
+
 AC_CHECK_HEADERS([stdatomic.h])
 
 AC_MSG_CHECKING([for which prebuilt binary set to use during bootstrap])
diff --git a/stage0/Makefile.am b/stage0/Makefile.am
index 12029fb45..4228f607d 100644
--- a/stage0/Makefile.am
+++ b/stage0/Makefile.am
@@ -22,7 +22,15 @@
 
 
 GUILE_WARNINGS = -W0
-GUILE_OPTIMIZATIONS = -O1
+
+if !DEB_GUILE_32_BIT_BIG_ENDIAN
+  $(info Note: not adjusting GUILE_OPTIMIZATIONS for 32-bit big-endian architecture)
+  GUILE_OPTIMIZATIONS = -O1
+else
+  $(info Note: adjusting GUILE_OPTIMIZATIONS for 32-bit big-endian architecture)
+  GUILE_OPTIMIZATIONS = -O1 -Oresolve-primitives -Ocps
+endif
+
 GUILE_BOOTSTRAP_STAGE = stage0
 
 include $(top_srcdir)/am/bootstrap.am
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.