Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
2  NEWS
@@ -3,6 +3,8 @@ changes relative to sbcl-1.0.39:
3 3 * bug fix: Name conflicts between symbols passed as arguments to a
4 4 single call to IMPORT no longer add multiple symbols with the same name
5 5 to the package (detectable via DO-SYMBOLS).
  6 + * bug fix: support building without the dlshim on darwin x86 and x86-64
  7 + (lp#533470).
6 8
7 9 changes in sbcl-1.0.39 relative to sbcl-1.0.38:
8 10 * bug fix: Backtrace from undefined function on x86 and x86-64 now show
13 make-config.sh
@@ -146,12 +146,11 @@ echo //setting up OS-dependent information
146 146
147 147 # Under Darwin x86-64, guess whether Darwin 9+ or below.
148 148 if [ "$sbcl_os" = "darwin" ] && [ "$sbcl_arch" = "x86-64" ]; then
149   - darwin_version=`uname -r`
150   - darwin_version_major=${DARWIN_VERSION_MAJOR:-${darwin_version%%.*}}
151   - if (( 8 < $darwin_version_major )); then
152   - ver9_or_above="9+"
153   - printf ' :inode64' >> $ltf
154   - fi
  149 + darwin_version=`uname -r`
  150 + darwin_version_major=${DARWIN_VERSION_MAJOR:-${darwin_version%%.*}}
  151 + if (( 8 < $darwin_version_major )); then
  152 + printf ' :inode64 :darwin9-or-better' >> $ltf
  153 + fi
155 154 fi
156 155
157 156 original_dir=`pwd`
@@ -247,7 +246,7 @@ case "$sbcl_os" in
247 246 fi
248 247 link_or_copy $sbcl_arch-darwin-os.h target-arch-os.h
249 248 link_or_copy bsd-os.h target-os.h
250   - link_or_copy Config.$sbcl_arch-darwin$ver9_or_above Config
  249 + link_or_copy Config.$sbcl_arch-darwin Config
251 250 ;;
252 251 sunos)
253 252 printf ' :unix' >> $ltf
9 src/code/foreign.lisp
@@ -16,8 +16,8 @@
16 16
17 17 (defun extern-alien-name (name)
18 18 (handler-case
19   - #!+elf (coerce name 'base-string)
20   - #!+(or mach-o win32) (concatenate 'base-string "_" name)
  19 + #!+(or elf (and mach-o (not dlshim))) (coerce name 'base-string)
  20 + #!+(or (and mach-o dlshim) win32) (concatenate 'base-string "_" name)
21 21 (error ()
22 22 (error "invalid external alien name: ~S" name))))
23 23
@@ -35,8 +35,9 @@
35 35 (values
36 36 (or (gethash extern table)
37 37 (gethash (concatenate 'base-string
38   - #!+(and darwin (or x86 x86-64 ppc)) "_ldso_stub__"
39   - #!-(and darwin (or x86 x86-64 ppc)) "ldso_stub__"
  38 + #!+(and mach-o dlshim) "_ldso_stub_"
  39 + #!+(and mach-o (not dlshim)) "ldso_stub__"
  40 + #!-mach-o "ldso_stub__"
40 41 extern) table)))))
41 42
42 43 (defun find-foreign-symbol-address (name)
7 src/compiler/generic/genesis.lisp
@@ -1597,6 +1597,13 @@ core and return a descriptor to it."
1597 1597 (subseq line (1+ p2)))
1598 1598 (values (parse-integer line :end p1 :radix 16)
1599 1599 (subseq line (1+ p2))))
  1600 + ; KLUDGE CLH 2010-05-31: on darwin, nm gives us
  1601 + ;; _function but dlsym expects us to look up
  1602 + ;; function, without the leading _ . Therefore, we
  1603 + ;; strip it off here.
  1604 + #!+(and darwin (not dlshim))
  1605 + (when (equal (char name 0) #\_)
  1606 + (setf name (subseq name 1)))
1600 1607 (multiple-value-bind (old-value found)
1601 1608 (gethash name *cold-foreign-symbol-table*)
1602 1609 (when (and found
18 src/runtime/Config.x86-64-darwin
@@ -9,9 +9,23 @@
9 9 # provided with absolutely no warranty. See the COPYING and CREDITS
10 10 # files for more information.
11 11
12   -CFLAGS = -g -Wall -O2 -fdollars-in-identifiers -mmacosx-version-min=10.4
  12 +CFLAGS = -g -Wall -O2 -fdollars-in-identifiers
  13 +ifdef LISP_FEATURE_DARWIN9_OR_BETTER
  14 +CFLAGS += -mmacosx-version-min=10.5
  15 +LINKFLAGS += -mmacosx-version-min=10.5
  16 +else
  17 +CFLAGS += -mmacosx-version-min=10.4
13 18 LINKFLAGS += -mmacosx-version-min=10.4
14   -OS_SRC = bsd-os.c x86-64-bsd-os.c darwin-os.c x86-64-darwin-os.c darwin-dlshim.c darwin-langinfo.c
  19 +endif
  20 +ifdef LISP_FEATURE_INODE64
  21 +CFLAGS += -D_DARWIN_USE_64_BIT_INODE
  22 +endif
  23 +
  24 +OS_SRC = bsd-os.c x86-64-bsd-os.c darwin-os.c x86-64-darwin-os.c darwin-langinfo.c
  25 +ifdef LISP_FEATURE_DLSHIM
  26 + OS_SRC += darwin-dlshim.c
  27 +endif
  28 +
15 29 OS_LIBS = -lSystem -lc -ldl
16 30 ifdef LISP_FEATURE_SB_THREAD
17 31 OS_LIBS += -lpthread
31 src/runtime/Config.x86-64-darwin9+
... ... @@ -1,31 +0,0 @@
1   -# -*- makefile -*- for the C-level run-time support for SBCL
2   -
3   -# This software is part of the SBCL system. See the README file for
4   -# more information.
5   -#
6   -# This software is derived from the CMU CL system, which was
7   -# written at Carnegie Mellon University and released into the
8   -# public domain. The software is in the public domain and is
9   -# provided with absolutely no warranty. See the COPYING and CREDITS
10   -# files for more information.
11   -
12   -CFLAGS = -g -Wall -O2 -fdollars-in-identifiers -mmacosx-version-min=10.5 -D_DARWIN_USE_64_BIT_INODE
13   -LINKFLAGS += -mmacosx-version-min=10.5
14   -OS_SRC = bsd-os.c x86-64-bsd-os.c darwin-os.c x86-64-darwin-os.c darwin-dlshim.c darwin-langinfo.c
15   -OS_LIBS = -lSystem -lc -ldl
16   -ifdef LISP_FEATURE_SB_THREAD
17   - OS_LIBS += -lpthread
18   -endif
19   -
20   -ASSEM_SRC = x86-64-assem.S ldso-stubs.S
21   -ARCH_SRC = x86-64-arch.c
22   -
23   -LINKFLAGS += -arch x86_64 -dynamic -twolevel_namespace -bind_at_load -pagezero_size 0x100000
24   -
25   -CFLAGS += -arch x86_64 -fno-omit-frame-pointer -pagezero_size 0x100000
26   -
27   -GC_SRC = gencgc.c
28   -
29   -# Nothing to do for after-grovel-headers.
30   -.PHONY: after-grovel-headers
31   -after-grovel-headers:
18 src/runtime/Config.x86-darwin
@@ -9,9 +9,21 @@
9 9 # provided with absolutely no warranty. See the COPYING and CREDITS
10 10 # files for more information.
11 11
12   -CFLAGS = -arch i386 -g -Wall -O2 -fdollars-in-identifiers -mmacosx-version-min=10.4
13   -LINKFLAGS += -arch i386 -mmacosx-version-min=10.4
14   -OS_SRC = bsd-os.c x86-bsd-os.c darwin-os.c x86-darwin-os.c darwin-dlshim.c darwin-langinfo.c
  12 +CFLAGS = -arch i386 -g -Wall -O2 -fdollars-in-identifiers
  13 +LINKFLAGS += -arch i386
  14 +ifdef LISP_FEATURE_DARWIN9_OR_BETTER
  15 +CFLAGS += -mmacosx-version-min=10.5
  16 +LINKFLAGS += -mmacosx-version-min=10.5
  17 +else
  18 +CFLAGS += -mmacosx-version-min=10.4
  19 +LINKFLAGS += -mmacosx-version-min=10.4
  20 +endif
  21 +
  22 +OS_SRC = bsd-os.c x86-bsd-os.c darwin-os.c x86-darwin-os.c darwin-langinfo.c
  23 +ifdef LISP_FEATURE_DLSHIM
  24 + OS_SRC += darwin-dlshim.c
  25 +endif
  26 +
15 27 OS_LIBS = -lSystem -lc -ldl
16 28 ifdef LISP_FEATURE_SB_THREAD
17 29 OS_LIBS += -lpthread
4 src/runtime/darwin-os.c
@@ -23,6 +23,10 @@
23 23 #include "bsd-os.h"
24 24 #include <errno.h>
25 25
  26 +#ifndef LISP_FEATURE_DLSHIM
  27 +#include <dlfcn.h>
  28 +#endif
  29 +
26 30 char *
27 31 os_get_runtime_executable_path(int external)
28 32 {
11 tools-for-build/grovel-headers.c
@@ -18,6 +18,8 @@
18 18 * more information.
19 19 */
20 20
  21 +#include "genesis/config.h"
  22 +
21 23 #include <stdio.h>
22 24 #include <stdlib.h>
23 25 #include <sys/types.h>
@@ -34,12 +36,13 @@
34 36 #include <sys/wait.h>
35 37 #include <sys/ioctl.h>
36 38 #include <sys/termios.h>
37   - #ifdef __APPLE_CC__
38   - #include "../src/runtime/darwin-dlshim.h"
  39 + #ifdef LISP_FEATURE_DARWIN
39 40 #include "../src/runtime/darwin-langinfo.h"
  41 + #endif
  42 + #ifdef LISP_FEATURE_DLSHIM
  43 + #include "../src/runtime/darwin-dlshim.h"
40 44 #else
41 45 #include <dlfcn.h>
42   - #include <langinfo.h>
43 46 #endif
44 47 #endif
45 48
@@ -49,8 +52,6 @@
49 52 #include <signal.h>
50 53 #include <errno.h>
51 54
52   -#include "genesis/config.h"
53   -
54 55 #ifdef LISP_FEATURE_HPUX
55 56 #include <sys/bsdtty.h> /* for TIOCGPGRP */
56 57 #endif
10 tools-for-build/ldso-stubs.lisp
@@ -133,8 +133,8 @@ ldso_stub__ ## fct ## $lazy_ptr: @\\
133 133 #define LDSO_STUBIFY(fct) \\
134 134 .text ; \\
135 135 .align 4 ; \\
136   -.globl _ldso_stub___ ## fct ; \\
137   -_ldso_stub___ ## fct: ; \\
  136 +.globl _ldso_stub__ ## fct ; \\
  137 +_ldso_stub__ ## fct: ; \\
138 138 jmp L ## fct ## $stub ; \\
139 139 .section __IMPORT,__jump_table,symbol_stubs,self_modifying_code+pure_instructions,5 ; \\
140 140 L ## fct ## $stub: ; \\
@@ -150,8 +150,8 @@ L ## fct ## $stub: ; \\
150 150 #!+(and darwin x86-64) "
151 151 #define LDSO_STUBIFY(fct) \\
152 152 .align 4 ; \\
153   -.globl _ldso_stub___ ## fct ; \\
154   -_ldso_stub___ ## fct: ; \\
  153 +.globl _ldso_stub__ ## fct ; \\
  154 +_ldso_stub__ ## fct: ; \\
155 155 jmp _ ## fct ; \\
156 156 .L ## fct ## e1: ; "
157 157
@@ -324,7 +324,7 @@ ldso_stub__ ## fct: ; \\
324 324 "unlockpt")
325 325 #!+openbsd
326 326 '("openpty")
327   - #!-darwin
  327 + #!-dlshim
328 328 '("dlclose"
329 329 "dlerror"
330 330 "dlopen"
2  version.lisp-expr
@@ -17,4 +17,4 @@
17 17 ;;; checkins which aren't released. (And occasionally for internal
18 18 ;;; versions, especially for internal versions off the main CVS
19 19 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
20   -"1.0.39.2"
  20 +"1.0.39.3"

0 comments on commit bd2df60

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