Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

1.0.39.3: support building on darwin x86 and x86-64 without the dlshim

  * x86 config -mmacosx-version-min cleanup

  * remove dlshim feature in make-config.sh

  * fix extern-alien-name and ldso naming conventions

  * kludge in load-cold-foreign-symbol-table to strip off the leading
    #\_ from the nm parsing

  * change dependency on ldso stubs for dlopen and friends to be
    #!-dlshim instead of #!-darwin

  * remove Config.x86-64-darwin9+ and replace with makefile
    conditionals

  * add :dlshim feature for darwin in make-config.sh and rework the
    darwin9+ stuff

  * make grovel-headers.c load genesis/config.h first so that we can
    use the LISP_FEATURE_xxx conditionals earlier
  • Loading branch information...
commit bd2df60f7c3f579a9c7610925c79a0e783adaa0e 1 parent 46b1591
Cyrus Harmon authored
View
2  NEWS
@@ -3,6 +3,8 @@ changes relative to sbcl-1.0.39:
* bug fix: Name conflicts between symbols passed as arguments to a
single call to IMPORT no longer add multiple symbols with the same name
to the package (detectable via DO-SYMBOLS).
+ * bug fix: support building without the dlshim on darwin x86 and x86-64
+ (lp#533470).
changes in sbcl-1.0.39 relative to sbcl-1.0.38:
* bug fix: Backtrace from undefined function on x86 and x86-64 now show
View
13 make-config.sh
@@ -146,12 +146,11 @@ 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
+ darwin_version=`uname -r`
+ darwin_version_major=${DARWIN_VERSION_MAJOR:-${darwin_version%%.*}}
+ if (( 8 < $darwin_version_major )); then
+ printf ' :inode64 :darwin9-or-better' >> $ltf
+ fi
fi
original_dir=`pwd`
@@ -247,7 +246,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$ver9_or_above Config
+ link_or_copy Config.$sbcl_arch-darwin Config
;;
sunos)
printf ' :unix' >> $ltf
View
9 src/code/foreign.lisp
@@ -16,8 +16,8 @@
(defun extern-alien-name (name)
(handler-case
- #!+elf (coerce name 'base-string)
- #!+(or mach-o win32) (concatenate 'base-string "_" name)
+ #!+(or elf (and mach-o (not dlshim))) (coerce name 'base-string)
+ #!+(or (and mach-o dlshim) win32) (concatenate 'base-string "_" name)
(error ()
(error "invalid external alien name: ~S" name))))
@@ -35,8 +35,9 @@
(values
(or (gethash extern table)
(gethash (concatenate 'base-string
- #!+(and darwin (or x86 x86-64 ppc)) "_ldso_stub__"
- #!-(and darwin (or x86 x86-64 ppc)) "ldso_stub__"
+ #!+(and mach-o dlshim) "_ldso_stub_"
+ #!+(and mach-o (not dlshim)) "ldso_stub__"
+ #!-mach-o "ldso_stub__"
extern) table)))))
(defun find-foreign-symbol-address (name)
View
7 src/compiler/generic/genesis.lisp
@@ -1597,6 +1597,13 @@ core and return a descriptor to it."
(subseq line (1+ p2)))
(values (parse-integer line :end p1 :radix 16)
(subseq line (1+ p2))))
+ ; KLUDGE CLH 2010-05-31: on darwin, nm gives us
+ ;; _function but dlsym expects us to look up
+ ;; function, without the leading _ . Therefore, we
+ ;; strip it off here.
+ #!+(and darwin (not dlshim))
+ (when (equal (char name 0) #\_)
+ (setf name (subseq name 1)))
(multiple-value-bind (old-value found)
(gethash name *cold-foreign-symbol-table*)
(when (and found
View
18 src/runtime/Config.x86-64-darwin
@@ -9,9 +9,23 @@
# 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.4
+CFLAGS = -g -Wall -O2 -fdollars-in-identifiers
+ifdef LISP_FEATURE_DARWIN9_OR_BETTER
+CFLAGS += -mmacosx-version-min=10.5
+LINKFLAGS += -mmacosx-version-min=10.5
+else
+CFLAGS += -mmacosx-version-min=10.4
LINKFLAGS += -mmacosx-version-min=10.4
-OS_SRC = bsd-os.c x86-64-bsd-os.c darwin-os.c x86-64-darwin-os.c darwin-dlshim.c darwin-langinfo.c
+endif
+ifdef LISP_FEATURE_INODE64
+CFLAGS += -D_DARWIN_USE_64_BIT_INODE
+endif
+
+OS_SRC = bsd-os.c x86-64-bsd-os.c darwin-os.c x86-64-darwin-os.c darwin-langinfo.c
+ifdef LISP_FEATURE_DLSHIM
+ OS_SRC += darwin-dlshim.c
+endif
+
OS_LIBS = -lSystem -lc -ldl
ifdef LISP_FEATURE_SB_THREAD
OS_LIBS += -lpthread
View
31 src/runtime/Config.x86-64-darwin9+
@@ -1,31 +0,0 @@
-# -*- 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
18 src/runtime/Config.x86-darwin
@@ -9,9 +9,21 @@
# provided with absolutely no warranty. See the COPYING and CREDITS
# files for more information.
-CFLAGS = -arch i386 -g -Wall -O2 -fdollars-in-identifiers -mmacosx-version-min=10.4
-LINKFLAGS += -arch i386 -mmacosx-version-min=10.4
-OS_SRC = bsd-os.c x86-bsd-os.c darwin-os.c x86-darwin-os.c darwin-dlshim.c darwin-langinfo.c
+CFLAGS = -arch i386 -g -Wall -O2 -fdollars-in-identifiers
+LINKFLAGS += -arch i386
+ifdef LISP_FEATURE_DARWIN9_OR_BETTER
+CFLAGS += -mmacosx-version-min=10.5
+LINKFLAGS += -mmacosx-version-min=10.5
+else
+CFLAGS += -mmacosx-version-min=10.4
+LINKFLAGS += -mmacosx-version-min=10.4
+endif
+
+OS_SRC = bsd-os.c x86-bsd-os.c darwin-os.c x86-darwin-os.c darwin-langinfo.c
+ifdef LISP_FEATURE_DLSHIM
+ OS_SRC += darwin-dlshim.c
+endif
+
OS_LIBS = -lSystem -lc -ldl
ifdef LISP_FEATURE_SB_THREAD
OS_LIBS += -lpthread
View
4 src/runtime/darwin-os.c
@@ -23,6 +23,10 @@
#include "bsd-os.h"
#include <errno.h>
+#ifndef LISP_FEATURE_DLSHIM
+#include <dlfcn.h>
+#endif
+
char *
os_get_runtime_executable_path(int external)
{
View
11 tools-for-build/grovel-headers.c
@@ -18,6 +18,8 @@
* more information.
*/
+#include "genesis/config.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
@@ -34,12 +36,13 @@
#include <sys/wait.h>
#include <sys/ioctl.h>
#include <sys/termios.h>
- #ifdef __APPLE_CC__
- #include "../src/runtime/darwin-dlshim.h"
+ #ifdef LISP_FEATURE_DARWIN
#include "../src/runtime/darwin-langinfo.h"
+ #endif
+ #ifdef LISP_FEATURE_DLSHIM
+ #include "../src/runtime/darwin-dlshim.h"
#else
#include <dlfcn.h>
- #include <langinfo.h>
#endif
#endif
@@ -49,8 +52,6 @@
#include <signal.h>
#include <errno.h>
-#include "genesis/config.h"
-
#ifdef LISP_FEATURE_HPUX
#include <sys/bsdtty.h> /* for TIOCGPGRP */
#endif
View
10 tools-for-build/ldso-stubs.lisp
@@ -133,8 +133,8 @@ ldso_stub__ ## fct ## $lazy_ptr: @\\
#define LDSO_STUBIFY(fct) \\
.text ; \\
.align 4 ; \\
-.globl _ldso_stub___ ## fct ; \\
-_ldso_stub___ ## fct: ; \\
+.globl _ldso_stub__ ## fct ; \\
+_ldso_stub__ ## fct: ; \\
jmp L ## fct ## $stub ; \\
.section __IMPORT,__jump_table,symbol_stubs,self_modifying_code+pure_instructions,5 ; \\
L ## fct ## $stub: ; \\
@@ -150,8 +150,8 @@ L ## fct ## $stub: ; \\
#!+(and darwin x86-64) "
#define LDSO_STUBIFY(fct) \\
.align 4 ; \\
-.globl _ldso_stub___ ## fct ; \\
-_ldso_stub___ ## fct: ; \\
+.globl _ldso_stub__ ## fct ; \\
+_ldso_stub__ ## fct: ; \\
jmp _ ## fct ; \\
.L ## fct ## e1: ; "
@@ -324,7 +324,7 @@ ldso_stub__ ## fct: ; \\
"unlockpt")
#!+openbsd
'("openpty")
- #!-darwin
+ #!-dlshim
'("dlclose"
"dlerror"
"dlopen"
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.39.2"
+"1.0.39.3"
Please sign in to comment.
Something went wrong with that request. Please try again.