Permalink
Browse files

0.8.5.17:

	Possibly the least useful fix I shall ever make while working on
	SBCL:

	Implement ldso_stub__foo for MIPS/Linux, so that the system can
	be built to link dynamically, allowing linking of foreign code
	in
	... many thanks to Ralf Baechle for education about the MIPS ABI
	Now foreign.test.sh passes, and we build and pass tests for all
	13 contribs!  Woohoo!

	Is there a user in the house?
  • Loading branch information...
1 parent bbfa2ae commit 2fc49454e0967364f816a132ad5d0a6747d6cd6d @csrhodes csrhodes committed Oct 30, 2003
Showing with 33 additions and 4 deletions.
  1. +3 −0 NEWS
  2. +2 −3 src/runtime/Config.mips-linux
  3. +27 −0 src/runtime/ldso-stubs.S
  4. +1 −1 version.lisp-expr
View
3 NEWS
@@ -2173,6 +2173,9 @@ changes in sbcl-0.8.6 relative to sbcl-0.8.5:
that the various BOOLE-related constants have the same value in
host and target lisps. (noted by Paul Dietz' test suite on an
SBCL binary built from CLISP)
+ * the system can now be dynamically linked on the MIPS platform,
+ which enables dynamic loading of foreign code from Lisp. (thanks
+ to Ralf Baechle for discussions on the MIPS ABI)
* fixed a compiler bug: MV-LET convertion did not check references
to the "max args" entry point. (reported by Brian Downing)
* tweaked disassembly notes to be less confident about proclaiming
@@ -12,11 +12,10 @@ LD = ld
LINKFLAGS = -v -g
NM = nm -p
-ASSEM_SRC = mips-assem.S #hppa-linux-stubs.S
-ARCH_SRC = mips-arch.c undefineds.c
+ASSEM_SRC = mips-assem.S ldso-stubs.S
+ARCH_SRC = mips-arch.c #undefineds.c
OS_SRC = linux-os.c mips-linux-os.c os-common.c
-LINKFLAGS+=-static
OS_LIBS= -ldl
GC_SRC= cheneygc.c
View
@@ -99,6 +99,33 @@ ldso_stub__ ## fct: ; \
nop /* delay slot*/ ; \
.L ## fct ## e1: ; \
.size ldso_stub__ ## fct,.L ## fct ## e1-ldso_stub__ ## fct ;
+
+#elif defined LISP_FEATURE_MIPS
+
+/* KLUDGE: set up the vital fifth argument, passed on the
+ stack. Do this unconditionally, even if the stub is for a
+ function with few arguments: it can't hurt. We only do this for
+ the fifth argument, as the first four are passed in registers
+ and we apparently don't ever need to pass six arguments to a
+ libc function. -- CSR, 2003-10-29 */
+
+#define LDSO_STUBIFY(fct) \
+.globl ldso_stub__ ## fct ; \
+ .type ldso_stub__ ## fct,@function ; \
+ldso_stub__ ## fct: ; \
+ addiu $29,-48 ; \
+ sw $28,40($29) ; \
+ sw $31,44($29) ; \
+ lw $25,64($29) ; \
+ sw $25,16($29) ; \
+ la $25, fct ; \
+ jalr $25 ; \
+ lw $31,44($29) ; \
+ lw $28,40($29) ; \
+ addiu $29,48 ; \
+ jr $31 ; \
+.L ## fct ## e1: ; \
+ .size ldso_stub__ ## fct,.L ## fct ## e1-ldso_stub__ ## fct ;
#else
#error unsupported CPU architecture
View
@@ -17,4 +17,4 @@
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.8.5.16"
+"0.8.5.17"

0 comments on commit 2fc4945

Please sign in to comment.