X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fforeign-stack-alignment.impure.lisp;h=069c5e8172141ba53aaebbe4be54ad9891253ae1;hb=01b41fdd69d197da85f86a2e4f8971f3ef9dda82;hp=5e9a7c787e8d97277ff90b2ea709a79a61e137e2;hpb=bd455348d39bee562296741689882dcb97c46ba3;p=sbcl.git diff --git a/tests/foreign-stack-alignment.impure.lisp b/tests/foreign-stack-alignment.impure.lisp index 5e9a7c7..069c5e8 100644 --- a/tests/foreign-stack-alignment.impure.lisp +++ b/tests/foreign-stack-alignment.impure.lisp @@ -22,7 +22,7 @@ (output (with-output-to-string (s) (setf proc (run-program program arguments - :search (not (eql #\. (char program 0))) + :environment (test-util::test-env) :output s))))) (unless (zerop (process-exit-code proc)) (error "Bad exit code: ~S~%Output:~% ~S" @@ -32,18 +32,18 @@ (defvar *required-alignment* #+(and ppc darwin) 16 - #+(and ppc linux) 8 + #+(and ppc (not darwin)) 8 #+x86-64 16 #+mips 8 - #+x86 4 - #-(or x86 x86-64 mips (and ppc (or darwin linux))) (error "Unknown platform")) + #+(and x86 (not darwin)) 4 + #+(and x86 darwin) 16 + #-(or x86 x86-64 mips ppc) (error "Unknown platform")) ;;;; Build the offset-tool as regular excutable, and run it with ;;;; fork/exec, so that no lisp is on the stack. This is our known-good ;;;; number. -(run "cc" - #+(and (or linux freebsd) (or x86-64 ppc)) "-fPIC" +(run "/bin/sh" "run-compiler.sh" "-sbcl-pic" "stack-alignment-offset.c" "-o" "stack-alignment-offset") (defparameter *good-offset* @@ -52,12 +52,10 @@ ;;;; Build the tool again, this time as a shared object, and load it -(run "cc" "stack-alignment-offset.c" - #+(and (or linux freebsd) (or x86-64 ppc)) "-fPIC" - #+darwin "-bundle" #-darwin "-shared" - "-o" "stack-alignment-offset.so") +(run "/bin/sh" "run-compiler.sh" "-sbcl-pic" "-sbcl-shared" + "stack-alignment-offset.c" "-o" "stack-alignment-offset.so") -(load-shared-object "stack-alignment-offset.so") +(load-shared-object (truename "stack-alignment-offset.so")) (define-alien-routine stack-alignment-offset int (alignment int)) (define-alien-routine trampoline int (callback (function int))) @@ -72,4 +70,7 @@ (assert (= *good-offset* (trampoline (alien-lambda int () (stack-alignment-offset *required-alignment*)))))) +(delete-file "stack-alignment-offset") +(delete-file "stack-alignment-offset.so") + ;;;; success!