Active Topics

 



Notices


Reply
Thread Tools
Posts: 5 | Thanked: 0 times | Joined on Jan 2008
#1
Hello,

I was wondering if anyone has managed to get a version of clisp or gnu common lisp (or ANY lisp) to compile in scratchbox for armel on Maemo 2008?

I get qemu segmentation faults every time...

Thanks,
Scott
 
Posts: 164 | Thanked: 132 times | Joined on Dec 2007
#2
Originally Posted by scott View Post
Hello,

I was wondering if anyone has managed to get a version of clisp or gnu common lisp (or ANY lisp) to compile in scratchbox for armel on Maemo 2008?

I get qemu segmentation faults every time...

Thanks,
Scott
Do you mean you get segmentation errors when you run the compiled binary? If so, this is ok, qemu emulation isn't always 100% reliable. The binary should run fine outside of the scratchbox.
 
Posts: 5 | Thanked: 0 times | Joined on Jan 2008
#3
Thanks for the reply.

I can 'make' to the point that qemu runs. With CLisp, it makes an initial memory image "lispinit.mem", by running lisp.run. Compilation of lisp.run completes and executing "./lisp.run --help" gives a help printout, however any other attempted use of lisp.run segfaults. Same thing happens when I copy to the Nokia N810 and run there.

Any ideas? Ive tried SAFETY=3, -O0, --with-debug, with all the packages (except FFI, cant seem to make that work either), without generational garbage collection, even installed the qemu-arm-eabi patched version. The most I can change is the segfault to an illegal instruction on the execution of lisp.run. (lisp.run --help works)

-Scott
 
Posts: 5 | Thanked: 0 times | Joined on Jan 2008
#4
Here's the error:

gcc -DNO_GENERATIONAL_GC -DSAFETY=3 -Igllib -W -Wswitch -Wcomment -Wpointer-arith -Wimplicit -Wreturn-type -Wmissing-declarations -Wno-sign-compare -O2 -DUNICODE -I. -x none spvw.o spvwtabf.o spvwtabs.o spvwtabo.o eval.o control.o encoding.o pathname.o stream.o socket.o io.o array.o hashtabl.o list.o package.o record.o weak.o sequence.o charstrg.o debug.o error.o misc.o time.o predtype.o symbol.o lisparit.o i18n.o unixaux.o built.o ariarm.o gllib/uniwidth/width.o gllib/uniname/uniname.o gllib/localcharset.o modules.o /usr/local/lib/libreadline.a -lncurses -ldl -L/usr/local/lib -lsigsegv -lc -o lisp.run
./lisp.run -B . -N locale -E 1:1 -Efile UTF-8 -Eterminal UTF-8 -norc -m 1800KW -x "(and (load \"init.lisp\") (sys::%saveinitmem) (ext::exit)) (ext::exit t)"
qemu: uncaught target signal 11 (Segmentation fault) - exiting
make: *** [interpreted.mem] Error 126
[sbox-CHINOOK_ARMEL: /scratchbox/users/scott/code/clisp/clisp-2.43/src] > ./lisp.run --help
GNU CLISP (http://clisp.cons.org/) is an ANSI Common Lisp.
Usage: ./lisp.run [options] [lispfile [argument ...]]
When 'lispfile' is given, it is loaded and '*ARGS*' is set
to the list of argument strings. Otherwise, an interactive
read-eval-print loop is entered.
Informative output:
-h, --help - print this help and exit
--version - print the version information
--license - print the licensing information
-help-image - print image-specific help and exit
Memory image selection:
[snipped]
 
Posts: 5 | Thanked: 0 times | Joined on Jan 2008
#5
[sbox-CHINOOK_ARMEL: /scratchbox/users/scott/code/clisp/clisp-2.43/src] > gdb lisp.run
GNU gdb 6.4.90
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "--host=i686-pc-linux-gnu --target=arm-linux"...
Breakpoint 1 at 0x27abc
Breakpoint 2 at 0x2a32c
Breakpoint 3 at 0x255b8
Breakpoint 4 at 0x1d7c0
Breakpoint 5 at 0xd1f0
Watchpoint 6: {<data variable, no debug info>} 1852696
Function "register_foreign_inttype" not defined.
Breakpoint 7 at 0xfe84
Breakpoint 8 at 0x17180
Breakpoint 9 at 0x1710c
Breakpoint 10 at 0xab2ac
Breakpoint 11 at 0xab5c4
Breakpoint 12 at 0xad6b8
Breakpoint 13 at 0xad728
Breakpoint 14 at 0xad884
Breakpoint 15 at 0xad7ac
Num Type Disp Enb Address What
1 breakpoint keep n 0x00027abc <funcall>
---Type <return> to continue, or q <return> to quit---
xout fun
2 breakpoint keep n 0x0002a32c <apply>
xout fun
3 breakpoint keep n 0x000255b8 <eval>
xout form
4 breakpoint keep n 0x0001d7c0 <interpret_bytecode_+16>
xout closure
5 breakpoint keep n 0x0000d1f0 <gar_col>
6 watchpoint keep n {<data variable, no debug info>} 1852696
silent
printf "%30s: %d %d\n", name_asciz, size, signed_p
continue
7 breakpoint keep y 0x0000fe84 <fehler_notreached>
8 breakpoint keep y 0x00017180 <SP_ueber>
9 breakpoint keep y 0x0001710c <STACK_ueber>
10 breakpoint keep y 0x000ab2ac <fehler>
11 breakpoint keep y 0x000ab5c4 <prepare_error>
12 breakpoint keep y 0x000ad6b8 <OS_error>
13 breakpoint keep y 0x000ad728 <OS_file_error>
14 breakpoint keep y 0x000ad884 <OS_filestream_error>
15 breakpoint keep y 0x000ad7ac <errno_out_low>
Function "sigsegv_handler_failed" not defined.
/scratchbox/users/scott/code/clisp/clisp-2.43/src/.gdbinit:172: Error in sourced command file:
No symbol "byteptr" in current context.
(gdb)
 
Posts: 5 | Thanked: 0 times | Joined on Jan 2008
#6
Sorry, on that dump there was no debug. Here's a --with-debug AND --without-ffcall trace:

This GDB was configured as "--host=i686-pc-linux-gnu --target=arm-linux"...
Breakpoint 1 at 0x40ee0: file eval.d, line 4929.
Breakpoint 2 at 0x3cfac: file eval.d, line 4012.
Breakpoint 3 at 0x376fc: file eval.d, line 2874.
Breakpoint 4 at 0x43714: file eval.d, line 5897.
Breakpoint 5 at 0x17ae4: file spvw_garcol.d, line 2430.
Watchpoint 6: back_trace
Function "register_foreign_inttype" not defined.
Breakpoint 7 at 0x1c3dc: file spvw.d, line 658.
Breakpoint 8 at 0xd890: file spvw.d, line 479.
Breakpoint 9 at 0xd93c: file spvw.d, line 494.
Breakpoint 10 at 0x15fd0c: file error.d, line 349.
Breakpoint 11 at 0x15fc5c: file error.d, line 326.
Breakpoint 12 at 0x160fa4: file errunix.d, line 680.
Breakpoint 13 at 0x161070: file errunix.d, line 695.
Breakpoint 14 at 0x161274: file error.d, line 425.
Breakpoint 15 at 0x161168: file errunix.d, line 723.
Num Type Disp Enb Address What
1 breakpoint keep n 0x00040ee0 in funcall at eval.d:4929
---Type <return> to continue, or q <return> to quit---
xout fun
2 breakpoint keep n 0x0003cfac in apply at eval.d:4012
xout fun
3 breakpoint keep n 0x000376fc in eval at eval.d:2874
xout form
4 breakpoint keep n 0x00043714 in interpret_bytecode_ at eval.d:5897
xout closure
5 breakpoint keep n 0x00017ae4 in gar_col at spvw_garcol.d:2430
6 watchpoint keep n back_trace
silent
printf "%30s: %d %d\n", name_asciz, size, signed_p
continue
7 breakpoint keep y 0x0001c3dc in fehler_notreached at spvw.d:658
8 breakpoint keep y 0x0000d890 in SP_ueber at spvw.d:479
9 breakpoint keep y 0x0000d93c in STACK_ueber at spvw.d:494
10 breakpoint keep y 0x0015fd0c in fehler at error.d:349
11 breakpoint keep y 0x0015fc5c in prepare_error at error.d:326
12 breakpoint keep y 0x00160fa4 in OS_error at errunix.d:680
13 breakpoint keep y 0x00161070 in OS_file_error at errunix.d:695
14 breakpoint keep y 0x00161274 in OS_filestream_error at error.d:425
15 breakpoint keep y 0x00161168 in errno_out_low at errunix.d:723
Function "sigsegv_handler_failed" not defined.
/scratchbox/users/scott/code/clisp/clisp-2.43/src/.gdbinit:172: Error in sourced command file:
No symbol "byteptr" in current context.
(gdb)
 
free's Avatar
Posts: 739 | Thanked: 159 times | Joined on Sep 2007 @ Germany - Munich
#7
I've uploaded scm (scheme). Was a pain to build..
 
Posts: 251 | Thanked: 22 times | Joined on Dec 2007 @ Houston, Texas
#8
I've been looking for a nice implementation of LISP to run on my N800, too.

My preference would be something like XLISP so that it can be run in an interpretted mode. Someone would have to Hildonize the interface (start with XLISPWIN?).
 
Posts: 72 | Thanked: 58 times | Joined on Feb 2008
#9
In case anyone else finds this thread, I decided to have a look at porting the ffcall library, used by clisp for its FFI, to the ARM EABI. This despite my egregious lack of clue in anything to do with modern instruction sets or assembler or ABIs or Clisp. So far I've managed to get just one piece, avcall, passing its unit tests. Maybe this will give some pointers to anyone else who wants to have a go.

Code:
apt-get source libffcall1
wget http://mat.exon.name/ffcall-arm.diff
patch -p0 < ffcall-arm.diff
make -C ffcall-1.10+2.41/ffcall/avcall -f Makefile.devel avcall-arm.S
make -C ffcall-1.10+2.41/ffcall/callback/vacall_r -f Makefile.devel vacall-arm.S
make -C ffcall-1.10+2.41/ffcall/vacall -f Makefile.devel vacall-arm.S
cd ffcall-1.10+2.41/ffcall
./configure
make extracheck
This should pass avcall, and then fail on vacall which I haven't started yet.

As far as I've been able to make out, the main changes are:
  • doubles and long longs have 8-byte alignment, previously it was 4
  • 8-byte structs are no longer considered "small", and are passed on the stack
  • chars in structs are aligned left, rather than being promoted to ints
  • as a result, it's necessary to round up the number of words being passed in registers
Also, I can't figure out how the whole build system is supposed to work, so I just hacked it to make it work. The tarball comes with pre-generated assembler which doesn't seem to have been regenerated since gcc 2.6.3, and this assembler doesn't compile under armel. There's a Makefile.devel to rebuild, but then it passes the assembler through a wacky sed script which strips out some underscores for some reason, and this fails too. So I had to hack the sed script as well. I guess someone out there understands how this is all supposed to work, but I'm just happy to get it passing its unit tests.
 
Posts: 72 | Thanked: 58 times | Joined on Feb 2008
#10
Just a followup, to keep everything linked together...

I failed to get clisp working, basically due to neither QEMU nor a real N810 being a suitable development platform for real deep assembly debugging. My notes are here:

http://mat.exon.name/logs/clisp

Patches so far:

http://mat.exon.name/logs/ffcall-arm.diff

I also reported this to the clisp-devel list:

http://sourceforge.net/mailarchive/m...40yahoo.com.au

...and to debian-arm:

http://lists.debian.org/debian-arm/2.../msg00028.html

Martin Guy suggested gcl, which apparently is known to work on ARM. However, I was unable to get it to build under scratchbox.
 
Reply


 
Forum Jump


All times are GMT. The time now is 17:41.