For some time, I'm having trouble compiling Gambit with SMP on Mac (running Catalina 10.15.4). I've tried with the Apple's clang, I've installed several compilers through Macports, several versions of gcc and clang and I have the same problem: segmentation faults during make modules. Source is from git master, but I've tried going a few months back with no luck.
I'm running configure as
./configure --enable-single-host --enable-multiple-versions --enable-multiple-threaded-vms --enable-smp --enable-targets=js
(If I leave out one of the --enable-multiple-threaded-vms or --enable-smp flags then it builds ok)
and after the make -j && make modules I see stuff like this (in different modules):
>>>> building module _match for C
>>>> building module _match/match-expand for C
/bin/sh: line 7: 65949 Segmentation fault: 11 ../../gsc/gsc -:~~bin=../../bin,~~lib=../../lib,~~include=../../include -f -e "(let ((x (##build-module \"$main_mod\" (quote $target) (quote ((module-ref $modref)))))) (if (not x) (begin (println \"*** module failed to build\") (exit 1))))"
or
>>>> building module _test/verbose for js
/bin/sh: line 7: 66835 Segmentation fault: 11 ../../gsc/gsc -:~~bin=../../bin,~~lib=../../lib,~~include=../../include -f -e "(let ((x (##build-module \"$main_mod\" (quote $target) (quote ((module-ref $modref)))))) (if (not x) (begin (println \"*** module failed to build\") (exit 1))))"
Not sure how relevant this is, but if I build Gambit using --enable-smp but without --enable-multiple-threaded-vms, I get a successful build, but then I have one failed test when running make check:
[226| 0] 90% ##############.. 10.3s 13-modules/prim_exception.scm
*** FAILED 13-modules/prim_exception.scm WITH EXIT CODE HI=1 LO=0
(with-exception-handler ##list (lambda () (##cons 1 (##raise 123)))) in (include "~~lib/gambit/prim/exception#.scm") returned #<unbound-global-exception #2> but expected (1 123)
(with-exception-handler ##list (lambda () (##cons 1 (##raise 123)))) in (namespace ("##")) returned #<unbound-global-exception #3> but expected (1 123)
[250| 1] 100% ################ 11.3s
FAILED 1 UNIT TESTS OUT OF 251 (.4%)
gmake[2]: *** [makefile:186: ut] Error 1
gmake[2]: Leaving directory '/Users/ury/sources/gambit/tests'
gmake[1]: *** [makefile:183: test11] Error 2
gmake[1]: Leaving directory '/Users/ury/sources/gambit/tests'
gmake: *** [makefile:208: check] Error 2
Maybe this problem sounds familiar, or at least maybe there is something I can try to fix or at least to debug it?
(This is on an old Macbook, so I would've suspected faulty hardware, but I've tried some rather significant builds such as GTK3 or TeX and they run ok)
I'm attaching the full compilation log (this time with GCC 10, but I had the same results with other versions).