Hi!
Trying to build Gambit v4.6.0 on i586 with a bootstrap compiler I've got the following error:
LD_LIBRARY_PATH=../lib:../gsi:../gsc: ../gsc-comp -:d-,~~bin=../bin,~~lib=../lib,~~include=../include -f -c -check _num.scm make: *** [_num.c] Segmentation fault
I try to build Gambit v4.6.0 from the git tree (http://www.iro.umontreal.ca/~gambit/repo/gambit.git) using gsc v4.5.3 that was built earlier by the same procedure explained below. The same build procedure if running on x86-64 architecture compiles Gambit fine from the same v4.6.0 sources.
About the build process in more detail. First, the v4.5.3 Gambit compiler are copied from /usr/bin/gsc to gsc-comp in the directory where the 4.6.0 bootstrap version sources are deployed. Some information on it:
/usr/bin/gsc --- $ ls -l /usr/bin/gsc -rwxr-xr-x 1 rooter rooter 46380 Apr 7 20:05 /usr/bin/gsc
$ /usr/bin/gsc -v v4.5.3 20091102023345 i586-alt-linux-gnu "./configure --build=i586-alt-linux --host=i586-alt-linux --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib --libexecdir=/usr/lib --localstatedir=/var/lib --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info --disable-dependency-tracking --without-included-gettext --enable-single-host --enable-shared --disable-absolute-shared-libs"
$ ldd /usr/bin/gsc libgambcgsc.so => /usr/lib/libgambcgsc.so (0xb7ca9000) libgambc.so => /usr/lib/libgambc.so (0xb78eb000) libc.so.6 => /lib/libc.so.6 (0xb7787000) libutil.so.1 => /lib/libutil.so.1 (0xb7783000) libdl.so.2 => /lib/libdl.so.2 (0xb777d000) libm.so.6 => /lib/libm.so.6 (0xb7753000) /lib/ld-linux.so.2 (0xb7f4b000) ---
Then, the bootstrap version sources are configured with the use of just --enable-single-host option in order to build a statically linked bootstrap compiler:
./configure --enable-single-host
Then the bootstrap compilation started with
make bootstrap
The resulting gsc is overwritten to ./gsc-comp. Some information on it:
The bootstrap built from the bootstrap tree [a56942cf9d4d4a57512edc0f1070baf7bd41cb4f] --- $ ls -l ./gsc-comp -rwxr-xr-x 1 builder builder 15383359 Apr 8 15:00 ./gsc-comp
$ ./gsc-comp -v v4.5.3 20100107170955 i586-alt-linux-gnu "./configure --build=i586-alt-linux --host=i586-alt-linux --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib --libexecdir=/usr/lib --localstatedir=/var/lib --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info --disable-dependency-tracking --without-included-gettext --enable-single-host"
$ ldd ./gsc-comp libutil.so.1 => /lib/libutil.so.1 (0xb7f68000) libdl.so.2 => /lib/libdl.so.2 (0xb7f63000) libm.so.6 => /lib/libm.so.6 (0xb7f39000) libc.so.6 => /lib/libc.so.6 (0xb7dd5000) /lib/ld-linux.so.2 (0xb7f70000) ---
Then the freshly built bootstrap compiler file gsc-comp is copied to the separate directory where 4.6.0 release version sources are deployed. The sources are then configured with the use of just --enable-single-host option in order to build a statically linked bootstrap compiler:
./configure --enable-single-host
Then the bootstrap compilation is started with
make bootstrap
Note, that because the release version sources are deployed in the separate directory, there is no need to run `make bootclean`, is it?
The resulting gsc is overwritten to ./gsc-comp. Some information on it:
The bootstrap built from the release tree [3bdc64fb33dcdd1792d4c899c861c317aa0feabb] --- $ ls -l ./gsc-comp -rwxr-xr-x 1 builder builder 15401399 Apr 8 15:03 ./gsc-comp
$ ./gsc-comp -v v4.6.0 20100610205958 i586-alt-linux-gnu "./configure --build=i586-alt-linux --host=i586-alt-linux --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib --libexecdir=/usr/lib --localstatedir=/var/lib --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info --disable-dependency-tracking --without-included-gettext --enable-single-host"
$ ldd ./gsc-comp libutil.so.1 => /lib/libutil.so.1 (0xb7f2c000) libdl.so.2 => /lib/libdl.so.2 (0xb7f27000) libm.so.6 => /lib/libm.so.6 (0xb7efd000) libc.so.6 => /lib/libc.so.6 (0xb7d99000) /lib/ld-linux.so.2 (0xb7f34000) ---
Then the release version tree is cleaned using
make realclean
and configured again with more options specified in order to build a dynamically linked set of programs:
./configure --enable-single-host --enable-shared --disable-absolute-shared-libs
Then an attempt is made to compile the final versions of the programs. On x86-64 (64-bit mode) it builds fine, but it fails to build on the same machine in an i586 environment. Note, that Gambit v4.5.3 (used as the first available compiler in this session) builds fine on the top of v4.5.2 by the same three-stage build process and all of the tests (cd tests; make check) are passed successfully. The compilation of the final 4.6.0 version fails in the lib subdirectory:
Try to build a shared-lib version from the release tree [3bdc64fb33dcdd1792d4c899c861c317aa0feabb] --- ... LD_LIBRARY_PATH=../lib:../gsi:../gsc: ../gsc-comp -:d-,~~bin=../bin,~~lib=../lib,~~include=../include -f -c -check _num.scm make: *** [_num.c] Segmentation fault ---
I've tried to run the same command in the debugger:
Run it within gdb --- LD_LIBRARY_PATH=../lib:../gsi:../gsc: gdb --args ../gsc-comp -:d-,~~bin=../bin,~~lib=../lib,~~include=../include -f -c -check _num.scm ... Starting program: /usr/src/RPM/BUILD/gambit-4.6.0/gambit-4.6.0/gsc-comp -:d-,~~bin=../bin,~~lib=../lib,~~include=../include -f -c -check _num.scm
Program received signal SIGSEGV, Segmentation fault. mark_array (start=<value optimized out>, n=4) at mem.c:2108 2108 head = body[-1];
I will be glad to see your comments on the build process described above and about any way I could debug or workaround that error.
TIA,
Paul.