Skip to content
Browse files

1.0.34.9: darwin/x86-64 sb-posix:stat fixes from Kei Suzuki

* sb-unix:unix-stat/lstat/fstat return the 32bit inode with x86 and
  the 64bit inode with x86-64,

* sb-posix:stat/lstat/fstat get stat values using the old stat calls
  with x86 and the new ones with x86-64

* re-enable now-working sb-posix stat tests
  • Loading branch information...
1 parent 09e08ad commit a3282da5cd4d2e9793a4def7738e544b813eed01 Cyrus Harmon committed
View
12 contrib/sb-grovel/def-to-lisp.lisp
@@ -205,10 +205,16 @@ code:
'("-D_LARGEFILE_SOURCE"
"-D_LARGEFILE64_SOURCE"
"-D_FILE_OFFSET_BITS=64")
- #+(and x86-64 darwin)
- '("-arch" "x86_64")
+ #+(and x86-64 darwin inode64)
+ '("-arch" "x86_64"
+ "-mmacosx-version-min=10.5"
+ "-D_DARWIN_USE_64_BIT_INODE")
+ #+(and x86-64 darwin (not inode64))
+ '("-arch" "x86_64"
+ "-mmacosx-version-min=10.4")
#+(and x86 darwin)
- '("-arch" "i386")
+ '("-arch" "i386"
+ "-mmacosx-version-min=10.4")
#+(and x86-64 sunos) '("-m64")
(list "-o"
(namestring tmp-a-dot-out)
View
6 contrib/sb-posix/interface.lisp
@@ -514,7 +514,9 @@
(defmacro define-stat-call (name arg designator-fun type)
;; FIXME: this isn't the documented way of doing this, surely?
- (let ((lisp-name (lisp-for-c-symbol name)))
+ (let ((lisp-name (lisp-for-c-symbol name))
+ (real-name #+inode64 (format nil "~A$INODE64" name)
+ #-inode64 name))
`(progn
(export ',lisp-name :sb-posix)
(declaim (inline ,lisp-name))
@@ -522,7 +524,7 @@
(declare (type (or null stat) stat))
(with-alien-stat a-stat ()
(let ((r (alien-funcall
- (extern-alien ,(real-c-name (list name :options :largefile)) ,type)
+ (extern-alien ,(real-c-name (list real-name :options :largefile)) ,type)
(,designator-fun ,arg)
a-stat)))
(when (minusp r)
View
13 contrib/sb-posix/posix-tests.lisp
@@ -213,7 +213,6 @@
result)))
#.sb-posix::eacces)
-#-darwin
(deftest stat.1
(let* ((stat (sb-posix:stat *test-directory*))
(mode (sb-posix::stat-mode stat)))
@@ -221,7 +220,7 @@
(logand mode (logior sb-posix::s-iread sb-posix::s-iwrite sb-posix::s-iexec)))
#.(logior sb-posix::s-iread sb-posix::s-iwrite sb-posix::s-iexec))
-#-(or darwin win32)
+#-win32
(deftest stat.2
(let* ((stat (sb-posix:stat "/"))
(mode (sb-posix::stat-mode stat)))
@@ -242,7 +241,7 @@
(< (- atime unix-now) 10))
t)
-#-(or darwin win32)
+#-win32
(deftest stat.4
(let* ((stat (sb-posix:stat (make-pathname :directory '(:absolute :up))))
(mode (sb-posix::stat-mode stat)))
@@ -331,7 +330,6 @@
(sb-posix:s-isreg mode))
nil)
-#-darwin
(deftest stat-mode.2
(with-stat-mode (mode *test-directory*)
(sb-posix:s-isdir mode))
@@ -358,7 +356,7 @@
(sb-posix:s-issock mode))
nil)
-#-(or win32 darwin)
+#-win32
(deftest stat-mode.7
(let ((link-pathname (make-pathname :name "stat-mode.7"
:defaults *test-directory*)))
@@ -370,7 +368,6 @@
(ignore-errors (sb-posix:unlink link-pathname))))
t)
-#-darwin
(deftest stat-mode.8
(let ((pathname (make-pathname :name "stat-mode.8"
:defaults *test-directory*)))
@@ -611,12 +608,12 @@
t)
-#-(or darwin win32)
+#-win32
(deftest time.1
(plusp (sb-posix:time))
t)
-#-(or darwin win32)
+#-win32
(deftest utimes.1
(let ((file (merge-pathnames #p"utimes.1" *test-directory*))
(atime (random (1- (expt 2 31))))
View
13 make-config.sh
@@ -143,6 +143,17 @@ fi
printf ":%s" "$sbcl_arch" >> $ltf
echo //setting up OS-dependent information
+
+# Under Darwin x86-64, guess whether Darwin 9+ or below.
+if [ "$sbcl_os" = "darwin" ] && [ "$sbcl_arch" = "x86-64" ]; then
+ darwin_version=`uname -r`
+ darwin_version_major=${DARWIN_VERSION_MAJOR:-${darwin_version%%.*}}
+ if (( 8 < $darwin_version_major )); then
+ ver9_or_above="9+"
+ printf ' :inode64' >> $ltf
+ fi
+fi
+
original_dir=`pwd`
cd ./src/runtime/
rm -f Config target-arch-os.h target-arch.h target-os.h target-lispregs.h
@@ -236,7 +247,7 @@ case "$sbcl_os" in
fi
link_or_copy $sbcl_arch-darwin-os.h target-arch-os.h
link_or_copy bsd-os.h target-os.h
- link_or_copy Config.$sbcl_arch-darwin Config
+ link_or_copy Config.$sbcl_arch-darwin$ver9_or_above Config
;;
sunos)
printf ' :unix' >> $ltf
View
31 src/runtime/Config.x86-64-darwin9+
@@ -0,0 +1,31 @@
+# -*- makefile -*- for the C-level run-time support for SBCL
+
+# This software is part of the SBCL system. See the README file for
+# more information.
+#
+# This software is derived from the CMU CL system, which was
+# written at Carnegie Mellon University and released into the
+# public domain. The software is in the public domain and is
+# provided with absolutely no warranty. See the COPYING and CREDITS
+# files for more information.
+
+CFLAGS = -g -Wall -O2 -fdollars-in-identifiers -mmacosx-version-min=10.5 -D_DARWIN_USE_64_BIT_INODE
+LINKFLAGS += -mmacosx-version-min=10.5
+OS_SRC = bsd-os.c x86-64-bsd-os.c darwin-os.c x86-64-darwin-os.c darwin-dlshim.c darwin-langinfo.c
+OS_LIBS = -lSystem -lc -ldl
+ifdef LISP_FEATURE_SB_THREAD
+ OS_LIBS += -lpthread
+endif
+
+ASSEM_SRC = x86-64-assem.S ldso-stubs.S
+ARCH_SRC = x86-64-arch.c
+
+LINKFLAGS += -arch x86_64 -dynamic -twolevel_namespace -bind_at_load -pagezero_size 0x100000
+
+CFLAGS += -arch x86_64 -fno-omit-frame-pointer -pagezero_size 0x100000
+
+GC_SRC = gencgc.c
+
+# Nothing to do for after-grovel-headers.
+.PHONY: after-grovel-headers
+after-grovel-headers:
View
3 tools-for-build/ldso-stubs.lisp
@@ -220,6 +220,7 @@ ldso_stub__ ## fct: ; \\
"fork"
"free"
"fstat"
+ #!+inode64 "fstat$INODE64"
"fsync"
"ftruncate"
"getcwd"
@@ -250,6 +251,7 @@ ldso_stub__ ## fct: ; \\
"log1p"
"lseek"
"lstat"
+ #!+inode64 "lstat$INODE64"
"malloc"
"memmove"
"mkdir"
@@ -274,6 +276,7 @@ ldso_stub__ ## fct: ; \\
"sinh"
"socket"
"stat"
+ #!+inode64 "stat$INODE64"
"strerror"
"strlen"
"symlink"
View
2 version.lisp-expr
@@ -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".)
-"1.0.34.8"
+"1.0.34.9"

0 comments on commit a3282da

Please sign in to comment.
Something went wrong with that request. Please try again.