(Sorry for changing the subject inmidst the thread)
> I would like to test [...] the x86 port on my x86-64 machine.
> Is there a way to build a 32-bit version of SBCL in this environment?
> CC='gcc -m32' SBCL_ARCH=x86 sh make.sh
> This built an SBCL that would run, but it only built 10 out of 14
> contribs. A quick investigation showed that "alien.so" had been built
> as a 64-bit library and thus could not be linked with the 32-bit
The unusable "alien.so" additionally makes run-tests.sh stop very early,
I should have added, and thus makes it impossible to run the tests.
Brian Mastenbrook answered:
> Right. You might try changing your PATH so that gcc points to a shell
> script which invokes your real gcc with -m32 instead of -m64.
> Also, 0.8.21.7 is very old. You might want to try a much newer SBCL.
Many thanks for the fast reply!
0.9.5.82 showed the same behaviour, so I tried your suggestion with
the shell script. This didn't work. By some digging through SBCL's
sources I found that the C compiler is sometimes called "gcc" and
sometimes "cc" (and in some Makefiles "$(CC)" is used). So I put the
shell script in the PATH not only under the name "gcc" but also under
"cc", and SBCL built fine, including all the contribs, using the
following command line:
SBCL_ARCH=x86 sh make.sh
To make it pass the tests, I needed to edit "tests/foreign.test.sh".
In the last line of the function "build_so" I replaced "ld" by "cc".
(I also experimented with using the "gcc" shell script for "ld", too,
but this broke the build of SBCL itself.) Here is the result of the
successful test run:
Unexpected success: debug.impure.lisp / (UNDEFINED-FUNCTION BUG-356)
Unexpected success: debug.impure.lisp / (THROW NO-SUCH-TAG)
Unexpected success: debug.impure.lisp / (BACKTRACE MISC)
Expected failure: package-locks.impure.lisp / PROGRAM-ERROR
//apparent success (reached end of run-tests.sh normally)
While I would have preferred a solution that simply sets an environment
variable or two, this one is fine with me, so thanks again for the hint.