#-(or x86 x86-64 mips (and ppc (or darwin linux))) (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.
#-(or x86 x86-64 mips (and ppc (or darwin linux))) (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" "stack-alignment-offset.c" "-o" "stack-alignment-offset")
+(run "cc"
+ #+(and (or linux freebsd) (or x86-64 ppc)) "-fPIC"
+ #+(and x86-64 darwin) "-arch" #+(and x86-64 darwin) "x86_64"
+ "stack-alignment-offset.c" "-o" "stack-alignment-offset")
;;;; Build the tool again, this time as a shared object, and load it
(run "cc" "stack-alignment-offset.c"
;;;; Build the tool again, this time as a shared object, and load it
(run "cc" "stack-alignment-offset.c"
;;;; Now get the offset by calling from lisp, first with a regular foreign function
;;;; call, then with an intervening callback.
;;;; Now get the offset by calling from lisp, first with a regular foreign function
;;;; call, then with an intervening callback.
-(assert (= *good-offset* (trampoline (alien-lambda int ()
- (stack-alignment-offset *required-alignment*)))))
+(with-test (:name :callback)
+ (assert (= *good-offset* (trampoline (alien-lambda int ()
+ (stack-alignment-offset *required-alignment*))))))