case `uname` in
Linux)
printf ' :linux' >> $ltf
+ sbcl_os="linux"
if [ "`uname -m`" = "x86_64" ]; then
ln -s Config.x86_64-linux Config
else
# the marketers forgot to tell the engineers about Digital Unix
# _or_ OSF/1 ...
printf ' :osf1' >> $ltf
+ sbcl_os="osf1"
ln -s Config.$sbcl_arch-osf1 Config
ln -s $sbcl_arch-osf1-os.h target-arch-os.h
ln -s osf1-os.h target-os.h
case `uname` in
FreeBSD)
printf ' :freebsd' >> $ltf
+ sbcl_os="freebsd"
ln -s Config.$sbcl_arch-freebsd Config
;;
OpenBSD)
printf ' :openbsd' >> $ltf
+ sbcl_os="openbsd"
ln -s Config.$sbcl_arch-openbsd Config
;;
*)
;;
Darwin)
printf ' :bsd' >> $ltf
+ sbcl_os="darwin"
ln -s $sbcl_arch-darwin-os.h target-arch-os.h
ln -s bsd-os.h target-os.h
printf ' :darwin' >> $ltf
;;
SunOS)
printf ' :sunos' >> $ltf
+ sbcl_os="sunos"
ln -s Config.$sbcl_arch-sunos Config
ln -s $sbcl_arch-sunos-os.h target-arch-os.h
ln -s sunos-os.h target-os.h
# cross-compilers!
$GNUMAKE -C tools-for-build determine-endianness
tools-for-build/determine-endianness >> $ltf
+elif [ "$sbcl_arch" = "ppc" -a "$sbcl_os" = "linux" ]; then
+ # Use a C program to detect which kind of glibc we're building on,
+ # to bandage across the break in source compatibility between
+ # versions 2.3.1 and 2.3.2
+ $GNUMAKE -C tools-for-build where-is-mcontext
+ tools-for-build/where-is-mcontext > src/runtime/ppc-linux-mcontext.h
else
# Nothing need be done in this case, but sh syntax wants a placeholder.
echo > /dev/null
depend
genesis
+ppc-linux-mcontext.h
sbcl
sbcl.h
sbcl.nm
#ifdef LISP_FEATURE_SB_THREAD
#error "Define threading support functions"
#else
-struct thread *arch_os_get_current_thread() {
- return all_threads;
-}
int arch_os_thread_init(struct thread *thread) {
return 1; /* success */
}
#ifdef LISP_FEATURE_SB_THREAD
#error "Define threading support functions"
#else
-struct thread *arch_os_get_current_thread() {
- return all_threads;
-}
int arch_os_thread_init(struct thread *thread) {
stack_t sigstack;
#ifdef LISP_FEATURE_C_STACK_IS_CONTROL_STACK
#ifdef LISP_FEATURE_SB_THREAD
#error "Define threading support functions"
#else
-struct thread *arch_os_get_current_thread() {
- return all_threads;
-}
int arch_os_thread_init(struct thread *thread) {
return 1; /* success */
}
#ifdef LISP_FEATURE_SB_THREAD
#error "Define threading support functions"
#else
-struct thread *arch_os_get_current_thread() {
- return all_threads;
-}
int arch_os_thread_init(struct thread *thread) {
return 1; /* success */
}
#include <unistd.h>
#include "validate.h"
+#include "ppc-linux-mcontext.h"
+
size_t os_vm_page_size;
-struct thread *arch_os_get_current_thread() {
- return all_threads;
-}
int arch_os_thread_init(struct thread *thread) {
return 1; /* success */
}
os_context_register_t *
os_context_register_addr(os_context_t *context, int offset)
{
+#if defined(GLIBC231_STYLE_UCONTEXT)
return &((context->uc_mcontext.regs)->gpr[offset]);
+#elif defined(GLIBC232_STYLE_UCONTEXT)
+ return &((context->uc_regs->gregs)[offset]);
+#endif
}
os_context_register_t *
os_context_pc_addr(os_context_t *context)
{
+#if defined(GLIBC231_STYLE_UCONTEXT)
return &((context->uc_mcontext.regs)->nip);
+#elif defined(GLIBC232_STYLE_UCONTEXT)
+ return &((context->uc_regs->gregs)[PT_NIP]);
+#endif
}
os_context_register_t *
os_context_lr_addr(os_context_t *context)
{
+#if defined(GLIBC231_STYLE_UCONTEXT)
return &((context->uc_mcontext.regs)->link);
+#elif defined(GLIBC232_STYLE_UCONTEXT)
+ return &((context->uc_regs->gregs)[PT_LNK]);
+#endif
}
sigset_t *
os_context_sigmask_addr(os_context_t *context)
{
+#if defined(GLIBC231_STYLE_UCONTEXT)
return &context->uc_sigmask;
+#elif defined(GLIBC232_STYLE_UCONTEXT)
+ return &context->uc_oldsigmask;
+#endif
}
unsigned long
registers, and PT_FPSCR is an offset that is larger than 32
(the number of ppc registers), but that happens to get the
right answer. -- CSR, 2002-07-11 */
+#if defined(GLIBC231_STYLE_UCONTEXT)
return context->uc_mcontext.regs->gpr[PT_FPSCR];
+#elif defined(GLIBC232_STYLE_UCONTEXT)
+ return context->uc_regs->gregs[PT_FPSCR];
+#endif
}
void
#ifdef LISP_FEATURE_SB_THREAD
#error "Define threading support functions"
#else
-struct thread *arch_os_get_current_thread() {
- return all_threads;
-}
int arch_os_thread_init(struct thread *thread) {
return 1; /* success */
}
#ifdef LISP_FEATURE_SB_THREAD
#error "Define threading support functions"
#else
-struct thread *arch_os_get_current_thread() {
- return all_threads;
-}
int arch_os_thread_init(struct thread *thread) {
return 1; /* success */
}
grovel_headers
determine-endianness
+where-is-mcontext
# provided with absolutely no warranty. See the COPYING and CREDITS
# files for more information.
-include ../src/runtime/Config
+-include ../src/runtime/Config
CPPFLAGS=-I../src/runtime
-all: grovel_headers determine-endianness
+all: grovel_headers determine-endianness where-is-mcontext
clean:
- rm -f *.o grovel_headers determine-endianness
+ rm -f *.o grovel_headers determine-endianness where-is-mcontext
--- /dev/null
+/*
+ * Find the offset of uc_mcontext in a ucontext structure, to enable
+ * building on both (glibc-2.3.1 and earlier) and (glibc-2.3.2 and
+ * later), after the glibc developers broke source code compatibility.
+ * (see also Debian bugs #207806 and #209074)
+ */
+
+/*
+ * This software is part of the SBCL system. See the README file for
+ * more information.
+ *
+ * While most of SBCL is derived from the CMU CL system, many
+ * utilities for the build process (like this one) were written from
+ * scratch after the fork from CMU CL.
+ *
+ * This software is in the public domain and is provided with
+ * absolutely no warranty. See the COPYING and CREDITS files for
+ * more information.
+ */
+
+#include <stdio.h>
+#include <stddef.h>
+#include <sys/ucontext.h>
+
+int main (int argc, char *argv[]) {
+
+ if(argc != 1) {
+ fprintf(stderr,"%s: command line arguments provided. Don't do that.\n", argv[0]);
+ exit(1);
+ }
+
+ printf("\
+/* This is an automatically-generated file; please do not edit it.\n\
+ See the program tools-for-build/where-is-mcontext.c.\n\
+ */\n\n");
+
+ printf("\
+#ifndef PPC_LINUX_MCONTEXT_H\n\
+#define PPC_LINUX_MCONTEXT_H\n\n");
+
+ switch (offsetof(ucontext_t,uc_mcontext)) {
+ case 192:
+ printf("#define GLIBC232_STYLE_UCONTEXT\n\n");
+ break;
+ case 20:
+ printf("#define GLIBC231_STYLE_UCONTEXT\n\n");
+ break;
+ default:
+ printf("#error \"Unknown PPC/Linux ucontext layout\"\n\n");
+ }
+ printf("\
+#endif /* PPC_LINUX_MCONTEXT_H */\n");
+}
+
;;; 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".)
-"0.8.4.4"
+"0.8.4.5"