« CMUCL FreeBSD -lc_r | Main | SQLite Threading »

30 October 2004

SBCL FreeBSD -lc_r

Building SBCL from source takes one command. In my case, using an existing lisp to bootstrap:

$ sh make.sh 'lisp -batch -noinit -nositeinit'

The build seems to take longer than CMUCL's multi-stage build process. After building the regression test suite completed successfully.

What about adding -pthread? It is similar to CMUCL's; in SBCL's case, modify OS_LINK_FLAGS in src/runtime/Config.x86-freebsd. Then, run make.sh again.

After another long while, it is done once more.

$ ldd src/runtime/sbcl
src/runtime/sbcl:
        libm.so.2 => /usr/lib/libm.so.2 (0x28084000)
        libc_r.so.4 => /usr/lib/libc_r.so.4 (0x2809f000)

Rerun the test suite:

$ cd tests && sh run-tests.sh
...
unhandled condition in --disable-debugger mode, quitting
; compilation unit aborted
;   caught 1 fatal ERROR condition
;   caught 1 ERROR condition
;   caught 1 WARNING condition
13 test (pure.lisp files) failed, expected 104 return code, got 1

So the tests don't complete fully. But let's just try loading ASDF anyway:

$ src/runtime/sbcl --core output/sbcl.core
...
* (load (translate-logical-pathname "pkg:asdf"))
...
; 
; compilation unit finished
;   caught 2 STYLE-WARNING conditions

T
*

Hey! It loads! Keep going:

* (asdf:oos 'asdf:load-op :uffi)
...
NIL
...
* (load (translate-logical-pathname "pkg:defsystem"))
...
* (mk:oos :lsqlite3 :load)
...
(#<FILE: sqlite3-sql> #<FILE: sqlite3-ffi> #<FILE: package>)
* (lsqlite3:connect "/tmp/xx.db")

#<LSQLITE3::SQLITE3-CONNECTION {48D209B9}>
* (lsqlite3:exec "select * from a")

(("1" "1"))
* (lsqlite3:disconnect)

T
* (quit)
$

No error caused by mixing libc.so and libc_r.so, because libc.so isn't linked into the sbcl process. Well, well, this has possibilities.


Posted by ngps at 23:51 | Comments (0) | Trackbacks (0)
Comments
There is no comment.
Trackbacks
Please send trackback to:http://sandbox.rulemaker.net/ngps/153/tbping
There is no trackback.