From: Brian Mastenbrook Date: Thu, 9 Oct 2008 00:36:08 +0000 (+0000) Subject: 1.0.21.12: build OS X 10.4-compatible binaries on OS X 10.5 X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=540a673f3dcf4e4a3b6306275684565a8643c161;p=sbcl.git 1.0.21.12: build OS X 10.4-compatible binaries on OS X 10.5 * Set minimum compatibility version in compiler options. * Refactor existing 10.5 support so that when 10.4 support is deprecated and we're building on 10.6+, everything will continue to work. --- diff --git a/src/runtime/Config.ppc-darwin b/src/runtime/Config.ppc-darwin index 1fbf2c8..9350ffc 100644 --- a/src/runtime/Config.ppc-darwin +++ b/src/runtime/Config.ppc-darwin @@ -9,7 +9,7 @@ # provided with absolutely no warranty. See the COPYING and CREDITS # files for more information. -CFLAGS = -g -Wall -O2 -fdollars-in-identifiers +CFLAGS = -g -Wall -O2 -fdollars-in-identifiers -mmacosx-version-min=10.4 OS_SRC = bsd-os.c darwin-os.c ppc-darwin-os.c darwin-dlshim.c darwin-langinfo.c OS_LIBS = -lSystem -lc diff --git a/src/runtime/Config.x86-64-darwin b/src/runtime/Config.x86-64-darwin index 1f2b66e..65142f9 100644 --- a/src/runtime/Config.x86-64-darwin +++ b/src/runtime/Config.x86-64-darwin @@ -9,7 +9,7 @@ # provided with absolutely no warranty. See the COPYING and CREDITS # files for more information. -CFLAGS = -g -Wall -O2 -fdollars-in-identifiers +CFLAGS = -g -Wall -O2 -fdollars-in-identifiers -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 OS_LIBS = -lSystem -lc -ldl ifdef LISP_FEATURE_SB_THREAD diff --git a/src/runtime/Config.x86-darwin b/src/runtime/Config.x86-darwin index 08801d5..1c877a6 100644 --- a/src/runtime/Config.x86-darwin +++ b/src/runtime/Config.x86-darwin @@ -9,7 +9,7 @@ # provided with absolutely no warranty. See the COPYING and CREDITS # files for more information. -CFLAGS = -g -Wall -O2 -fdollars-in-identifiers +CFLAGS = -g -Wall -O2 -fdollars-in-identifiers -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 OS_LIBS = -lSystem -lc -ldl ifdef LISP_FEATURE_SB_THREAD diff --git a/src/runtime/darwin-os.h b/src/runtime/darwin-os.h index 2a7a405..f0923d7 100644 --- a/src/runtime/darwin-os.h +++ b/src/runtime/darwin-os.h @@ -6,6 +6,7 @@ #include #include #include +#include /* man pages claim that the third argument is a sigcontext struct, but ucontext_t is defined, matches sigcontext where sensible, @@ -17,7 +18,8 @@ #if defined(LISP_FEATURE_X86) #include #include -#ifdef MAC_OS_X_VERSION_10_5 + +#if __DARWIN_UNIX03 typedef struct __darwin_ucontext os_context_t; #else typedef struct ucontext os_context_t; diff --git a/src/runtime/ppc-darwin-os.h b/src/runtime/ppc-darwin-os.h index 6d23ee2..119dcbd 100644 --- a/src/runtime/ppc-darwin-os.h +++ b/src/runtime/ppc-darwin-os.h @@ -1,18 +1,19 @@ #ifndef _PPC_DARWIN_OS_H #define _PPC_DARWIN_OS_H +#include "darwin-os.h" + typedef unsigned int os_context_register_t; static inline os_context_t *arch_os_get_context(void **void_context) { return (os_context_t *) *void_context; } -/* As of XCode 3.0, the field names for the thread state have changed - * and now are prepended with __. Use some #define hackery to deal - * with this. MAC_OS_X_VERSION_10_5 seems to be a good test to see if - * we need the new style field names. +/* On OS X 10.5, the field names for the thread state have changed and + * now are prepended with __. Use some #define hackery to deal with + * this. */ -#if MAC_OS_X_VERSION_10_5 +#if __DARWIN_UNIX03 #define PPC_DARWIN_REGIFY(foo) __ ## foo @@ -24,6 +25,6 @@ typedef ppc_thread_state_t ppc_ss_struct_t; typedef ppc_saved_state_t ppc_ss_struct_t; -#endif /* MAC_OS_X_VERSION_10_5 */ +#endif /* __DARWIN_UNIX03 */ #endif /* _PPC_DARWIN_OS_H */ diff --git a/src/runtime/x86-64-arch.c b/src/runtime/x86-64-arch.c index 9f590e9..a7f7354 100644 --- a/src/runtime/x86-64-arch.c +++ b/src/runtime/x86-64-arch.c @@ -63,11 +63,7 @@ context_eflags_addr(os_context_t *context) #elif defined __FreeBSD__ return &context->uc_mcontext.mc_rflags; #elif defined LISP_FEATURE_DARWIN -#ifdef MAC_OS_X_VERSION_10_5 - return &context->uc_mcontext->__ss.__rflags; -#else - return &context->uc_mcontext->ss.rflags; -#endif + return CONTEXT_ADDR_FROM_STEM(rflags); #elif defined __OpenBSD__ return &context->sc_eflags; #else diff --git a/src/runtime/x86-64-darwin-os.c b/src/runtime/x86-64-darwin-os.c index 99f8121..6542978 100644 --- a/src/runtime/x86-64-darwin-os.c +++ b/src/runtime/x86-64-darwin-os.c @@ -25,11 +25,11 @@ #include #include -#ifdef MAC_OS_X_VERSION_10_5 +#if __DARWIN_UNIX03 #include #endif -#ifdef MAC_OS_X_VERSION_10_5 +#if __DARWIN_UNIX03 typedef struct __darwin_ucontext darwin_ucontext; typedef struct __darwin_mcontext64 darwin_mcontext; diff --git a/src/runtime/x86-64-darwin-os.h b/src/runtime/x86-64-darwin-os.h index 1a4f796..22cde5e 100644 --- a/src/runtime/x86-64-darwin-os.h +++ b/src/runtime/x86-64-darwin-os.h @@ -10,10 +10,10 @@ static inline os_context_t *arch_os_get_context(void **void_context) return (os_context_t *) *void_context; } -#ifdef MAC_OS_X_VERSION_10_5 +#if __DARWIN_UNIX03 #define CONTEXT_ADDR_FROM_STEM(stem) &context->uc_mcontext->__ss.__##stem #else #define CONTEXT_ADDR_FROM_STEM(stem) &context->uc_mcontext->ss.stem -#endif +#endif /* __DARWIN_UNIX03 */ #endif /* _X86_64_DARWIN_OS_H */ diff --git a/src/runtime/x86-darwin-os.c b/src/runtime/x86-darwin-os.c index 121b63b..bb9212e 100644 --- a/src/runtime/x86-darwin-os.c +++ b/src/runtime/x86-darwin-os.c @@ -254,18 +254,10 @@ void signal_emulation_wrapper(x86_thread_state32_t *thread_state, */ os_context_t *context; -#if MAC_OS_X_VERSION_10_5 - struct __darwin_mcontext32 *regs; -#else - struct mcontext *regs; -#endif + mcontext_t *regs; context = (os_context_t*) os_validate(0, sizeof(os_context_t)); -#if MAC_OS_X_VERSION_10_5 - regs = (struct __darwin_mcontext32*) os_validate(0, sizeof(struct __darwin_mcontext32)); -#else - regs = (struct mcontext*) os_validate(0, sizeof(struct mcontext)); -#endif + regs = (mcontext_t*) os_validate(0, sizeof(mcontext_t)); context->uc_mcontext = regs; /* when BSD signals are fired, they mask they signals in sa_mask @@ -285,11 +277,7 @@ void signal_emulation_wrapper(x86_thread_state32_t *thread_state, update_thread_state_from_context(thread_state, float_state, context); os_invalidate((os_vm_address_t)context, sizeof(os_context_t)); -#if MAC_OS_X_VERSION_10_5 - os_invalidate((os_vm_address_t)regs, sizeof(struct __darwin_mcontext32)); -#else - os_invalidate((os_vm_address_t)regs, sizeof(struct mcontext)); -#endif + os_invalidate((os_vm_address_t)regs, sizeof(mcontext_t)); /* Trap to restore the signal context. */ asm volatile ("movl %0, %%eax; movl %1, %%ebx; .long 0xffff0b0f" diff --git a/src/runtime/x86-darwin-os.h b/src/runtime/x86-darwin-os.h index edc3a6c..20caa8c 100644 --- a/src/runtime/x86-darwin-os.h +++ b/src/runtime/x86-darwin-os.h @@ -16,12 +16,11 @@ static inline os_context_t *arch_os_get_context(void **void_context) void set_data_desc_size(data_desc_t* desc, unsigned long size); void set_data_desc_addr(data_desc_t* desc, void* addr); -/* As of XCode 3.0, the field names for the thread state have changed - * and now are prepended with __. Use some #define hackery to deal - * with this. MAC_OS_X_VERSION_10_5 seems to be a good test to see if - * we need the new style field names. +/* On OS X 10.5, the field names for the thread state have changed and + * now are prepended with __. Use some #define hackery to deal with + * this. */ -#if MAC_OS_X_VERSION_10_5 +#if __DARWIN_UNIX03 #define CONTEXT_ADDR_FROM_STEM(stem) &context->uc_mcontext->__ss.__##stem #define EIP __eip @@ -61,7 +60,7 @@ void set_data_desc_addr(data_desc_t* desc, void* addr); #define SS ss #define GS gs -#endif /* MAC_OS_X_VERSION_10_5 */ +#endif /* __DARWIN_UNIX03 */ diff --git a/version.lisp-expr b/version.lisp-expr index 907aeda..d65b1ea 100644 --- a/version.lisp-expr +++ b/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.21.11" +"1.0.21.12"