Am Montag, den 08.06.2020, 10:24 +0200 schrieb Dave Plater:
> Hi, I maintain Lilypond for openSUSE and also created guile1 for
> lilypond using guile-1.8.8
> I have a problem, guile-1.8.8 doesn't build with gcc 10:
> [...]
> 
> Causes a:
> 15388 Segmentation fault      |
> GUILE="/home/abuild/rpmbuild/BUILD/guile-1.8.8/pre-inst-guile"
> ../scripts/snarf-check-and-output-texi > guile-procedures.texi
> 
> This is beyond my capabilities, the above command resists gdb --args
> so I'm unable to see where the segfault happens. Something in gcc10 is
> exposing a problem in guile-1.8.8

Yep, GCC 10 "breaks" the configure check to find the stack direction.
This makes Guile believe the stack grows up, which is of course plain
wrong. I was able to workaround this issue by disabling optimizations
for the configure check, see attached diff.

(For the technically interested: GCC 10 succeeds in rewriting a
particular tail call into jumps. This avoids stack frames from the
recursive call which the check relies on. Funnily enough, a comment
says: "If the code could be inlined, that might cause the test to give
an incorrect answer." - indeed.)

Cheers
Jonas
--- configure.orig	2020-06-08 12:22:19.878393341 +0200
+++ configure	2020-06-08 12:23:07.784281119 +0200
@@ -19089,6 +19089,8 @@
 # an incorrect answer.
 #--------------------------------------------------------------------
 
+save_CFLAGS="$CFLAGS"
+CFLAGS="-O0"
 SCM_I_GSC_STACK_GROWS_UP=0
 if test "$cross_compiling" = yes; then :
   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Guessing that stack grows down -- see scmconfig.h" >&5
@@ -19123,6 +19125,7 @@
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
+CFLAGS="$save_CFLAGS"
 
 
 # The cast to long int works around a bug in the HP C Compiler

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to