* Patch by Josh Elsasser, lp#615489.
* On OpenBSD/i386, the structure that stores the FPU state during
signals was recently moved.
Add a script to tools-for-build/ which is run from make-config.sh
to detect where the FPU state is located, and create a
src/runtime/openbsd-sigcontext.h header containing a #define which
src/runtime/x86-bsd-os.c can use.
This is necessary to build SBCL on recent -current snapshots of
OpenBSD, and for the upcoming 4.8 release.
* Missing NEWS entry for last commit.
correctly. (lp#598374, thanks to Stas Boukarev)
* bug fix: better availability of names of foreign functions in backtraces
on Linux. (lp#626962, thanks to Stas Boukarev)
+ * bug fix: scripting fixes for Solaris and FreeBSD. (lp#615497, thanks to
+ Josh Elsasser)
+ * bug fix: build fixes for OpenBSD -current and 4.8 (lp#615489, thanks to
+ Josh Elsasser)
changes in sbcl-1.0.42 relative to sbcl-1.0.41
* build changes
# roughly-equivalent magic nevertheless.
printf ' :os-provides-dlopen' >> $ltf
fi
+ if [ "$sbcl_os" = "openbsd" ]; then
+ rm -f src/runtime/openbsd-sigcontext.h
+ sh tools-for-build/openbsd-sigcontext.sh > src/runtime/openbsd-sigcontext.h
+ fi
elif [ "$sbcl_arch" = "x86-64" ]; then
printf ' :gencgc :stack-grows-downward-not-upward :c-stack-is-control-stack :linkage-table' >> $ltf
printf ' :compare-and-swap-vops :unwind-to-frame-and-call-vop :raw-instance-init-vops' >> $ltf
#endif
#if defined(LISP_FEATURE_OPENBSD)
-#include <machine/frame.h>
#include <machine/npx.h>
#include <stddef.h>
+#include "openbsd-sigcontext.h"
+#ifdef OS_OPENBSD_FPSTATE_IN_SIGFRAME
+# include <machine/frame.h>
+#endif
#endif
/* KLUDGE: There is strong family resemblance in the signal context
void
os_restore_fp_control(os_context_t *context)
{
- struct sigframe *frame;
- union savefpu *fpu;
+#ifdef OS_OPENBSD_FPSTATE_IN_SIGFRAME
+ struct sigframe *frame = (struct sigframe *)((char*)context -
+ offsetof(struct sigframe, sf_sc));
+ union savefpu *fpu = frame->sf_fpstate;
+#elif defined(OS_OPENBSD_FPSTATE_IN_SIGCONTEXT)
+ union savefpu *fpu = context->sc_fpstate;
+#endif
- frame = (struct sigframe *)((char*)context - offsetof(struct sigframe, sf_sc));
- fpu = frame->sf_fpstate;
if (openbsd_use_fxsave)
__asm__ __volatile__ ("fldcw %0" : : "m" (fpu->sv_xmm.sv_env.en_cw));
else
--- /dev/null
+cd ./tools-for-build
+
+base=openbsd-sigcontext
+
+# check for sf_fpstate in struct sigframe (ie: pre July 2010)
+rm -f "${base}.c"
+cat > "${base}.c" <<EOF
+#include <stddef.h>
+#include <stdio.h>
+#include <machine/frame.h>
+int
+main()
+{
+ printf("it works: %d\n", offsetof(struct sigframe, sf_fpstate));
+ return (0);
+}
+EOF
+if $GNUMAKE "${base}" > /dev/null 2>&1 && "./${base}" > /dev/null 2>&1
+then
+ echo '#define OS_OPENBSD_FPSTATE_IN_SIGFRAME'
+fi
+
+# check for sc_fpstate in struct sigcontext (ie: July 2010 and later)
+rm -f "${base}.c"
+cat > "${base}.c" <<EOF
+#include <stddef.h>
+#include <stdio.h>
+#include <signal.h>
+int
+main()
+{
+ printf("it works: %d\n", offsetof(struct sigcontext, sc_fpstate));
+ return (0);
+}
+EOF
+if $GNUMAKE "${base}" > /dev/null 2>&1 && "./${base}" > /dev/null 2>&1
+then
+ echo '#define OS_OPENBSD_FPSTATE_IN_SIGCONTEXT'
+fi
+
+rm -f "${base}.c" "${base}"
;;; 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.42.7"
+"1.0.42.8"