Jamie Craig | 11 Jul 10:31 2007

Compiling CLISP on ARM Linux - ffi problems

Hi,

I've been trying to get CLISP up and running on a Nokia N800 internet 
tablet, which runs one of the usual little debian-based Linux 
distributions. While I've had some success getting CLISP proper running 
(configure settings and make check-recompile timings below) I can't get 
it to build with FFI or any of the standard base modules. Can anyone 
offer any suggestions?

The following might shed some light on the problems:
When I run configure (CFLAGS set to -DSAFETY=3 -mcpu=arm1136j-s, no 
other configure options) mostly everything looks OK, but near the end of 
the process, vacall-arm.s fails to assemble with:

make[1]: Entering directory `/root/clisp-2.41/src/callback/vacall_r'
/bin/sh ./libtool --mode=compile gcc -x none -c vacall-arm.s
 gcc -x none -c vacall-arm.s -o vacall-arm.o
vacall-arm.s: Assembler messages:
vacall-arm.s:3: Warning: ignoring attempt to redefine built-in register 'sl'
vacall-arm.s:3: Warning: ignoring attempt to redefine built-in register 'SL'
vacall-arm.s:4: Warning: ignoring attempt to redefine built-in register 'fp'
vacall-arm.s:4: Warning: ignoring attempt to redefine built-in register 'FP'
vacall-arm.s:5: Warning: ignoring attempt to redefine built-in register 'ip'
vacall-arm.s:5: Warning: ignoring attempt to redefine built-in register 'IP'
vacall-arm.s:6: Warning: ignoring attempt to redefine built-in register 'sp'
vacall-arm.s:6: Warning: ignoring attempt to redefine built-in register 'SP'
vacall-arm.s:7: Warning: ignoring attempt to redefine built-in register 'lr'
vacall-arm.s:7: Warning: ignoring attempt to redefine built-in register 'LR'
vacall-arm.s:8: Warning: ignoring attempt to redefine built-in register 'pc'
vacall-arm.s:8: Warning: ignoring attempt to redefine built-in register 'PC'
vacall-arm.s:77: Error: selected processor does not support `ldfeqs f0,[sp,#20]'
vacall-arm.s:81: Error: selected processor does not support `ldfeqd f0,[sp,#20]'
make[1]: *** [vacall-arm.lo] Error 1
make[1]: Leaving directory `/root/clisp-2.41/src/callback/vacall_r'
make: *** [all-subdirs] Error 2
Configure findings:
  FFI:        no (user requested: default)
  readline:   yes (user requested: default)
  libsigsegv: yes

This appears to be complaining about a pretty simple float-point load 
instruction; later ARMs have different FPUs (or none, in the more common 
case) but as far as I knew they all supported at least the instruction 
set of the original ARMv2 FPU. Does anyone know of a working vacall-arm?

However, configure completes regardless, and it's happy from that point 
to compile CLISP itself. Unfortunately, although it can compile the main 
program no problem, and produces a pretty decent working version, it 
can't compile any of the modules, all of which fail with syntax errors 
in clisp.h. I'm not sure why this breaks; I gather clisp.h is 
autogenerated, but presumably it's generated much the same regardless of 
the fine details of the platform? In any case, I don't think I'm 
expecting this to work too well until vacall works. For now, if I remove 
the modules from the base modules list in the Makefile, then make clisp 
etc. all work nicely.

For the platforms list, make check-recompile on a Nokia N800 Internet 
tablet finishes successfully as:

ARM 1136J-S, 128M RAM, gcc 3.4.4, 339 seconds (306 user, 12 sys), all 
running from SD card instead of internal flash.

CFLAGS are as above, no configure options, but anyone else trying it 
will want to set the TMP environment variable to point to a space on 
SD/disk, not leave it pointing to /tmp in core.

-- Jamie Craig
<jamie <at> jamiecraig.com>

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

Gmane