Commit 520141c0 authored by Erick's avatar Erick

Adding a patch for building on MacOs X Lion

parent b891b433
......@@ -7,6 +7,18 @@ on the following architectures
- MacOS 10.5+ (gcc-4.x 32 and 64 bits)
- FreeBSD 8.x (gcc-4.x 32 bits)
MacOs X Lion
To compile stklos on MacOs X Lion, you the following
configuration line is known to work:
$ CFLAGS="-Wl,-no_pie,-no_compact_unwind" ./configure \
--with-provided-gc --with-provided-regexp \
--with-provided-ffi --with-provided-bignum
======================================================================
======================================================================
All the informations given below are for old versions (pre-1.0) of
......
......@@ -5739,6 +5739,7 @@ case $OS in
case $version in
9*) OS_NAME_VERSION=DARWIN_9;;
10*) OS_NAME_VERSION=DARWIN_10;;
11*) OS_NAME_VERSION=DARWIN_11;;
*) OS_NAME_VERSION=DARWIN_OLD;;
esac
;;
......@@ -5972,6 +5973,19 @@ echo "*****"
echo "***** GC support"
echo "*****"
# Patch code for OSX Lion
case $OS_NAME_VERSION in
DARWIN_11)
if test ! -f gc/stklos-patch-applied
then
echo "**** Patching GC library";
patch -p1 < etc/lion.patch
touch gc/stklos-patch-applied
fi
;;
esac
# Try to determine if libgc is installed
if ${PKGCONFIG} --exists bdw-gc ;then
HAVE_GC="yes"
......
......@@ -2,7 +2,7 @@
###
### Author: Erick Gallesio [eg@unice.fr]
### Creation date: 28-Dec-1999 21:19 (eg)
### Last file update: 28-Aug-2011 23:45 (eg)
### Last file update: 16-Oct-2011 12:37 (eg)
AC_PREREQ(2.64)
AC_INIT([stklos], [1.10])
......@@ -99,6 +99,7 @@ case $OS in
case $version in
9*) OS_NAME_VERSION=DARWIN_9;;
10*) OS_NAME_VERSION=DARWIN_10;;
11*) OS_NAME_VERSION=DARWIN_11;;
*) OS_NAME_VERSION=DARWIN_OLD;;
esac
;;
......@@ -178,6 +179,19 @@ echo "*****"
echo "***** GC support"
echo "*****"
# Patch code for OSX Lion
case $OS_NAME_VERSION in
DARWIN_11)
if test ! -f gc/stklos-patch-applied
then
echo "**** Patching GC library";
patch -p1 < etc/lion.patch
touch gc/stklos-patch-applied
fi
;;
esac
# Try to determine if libgc is installed
if ${PKGCONFIG} --exists bdw-gc ;then
HAVE_GC="yes"
......
diff -r a63253e53bf9 gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/gcc/x86.h
--- a/gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/gcc/x86.h Sat Oct 15 23:51:26 2011 +0200
+++ b/gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/gcc/x86.h Sun Oct 16 00:05:12 2011 +0200
@@ -113,7 +113,7 @@
/* Note: the "xchg" instruction does not need a "lock" prefix */
__asm__ __volatile__("xchgb %0, %1"
: "=q"(oldval), "=m"(*addr)
- : "0"(0xff), "m"(*addr) : "memory");
+ : "0"((unsigned char) 0xff), "m"(*addr) : "memory");
return (AO_TS_VAL_t)oldval;
}
diff -r a63253e53bf9 gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/gcc/x86_64.h
--- a/gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/gcc/x86_64.h Sat Oct 15 23:51:26 2011 +0200
+++ b/gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/gcc/x86_64.h Sun Oct 16 00:05:12 2011 +0200
@@ -126,7 +126,7 @@
/* Note: the "xchg" instruction does not need a "lock" prefix */
__asm__ __volatile__("xchgb %0, %1"
: "=q"(oldval), "=m"(*addr)
- : "0"(0xff), "m"(*addr) : "memory");
+ : "0"((unsigned char) 0xff), "m"(*addr) : "memory");
return (AO_TS_VAL_t)oldval;
}
diff -r a63253e53bf9 gc/mach_dep.c
--- a/gc/mach_dep.c Sat Oct 15 23:51:26 2011 +0200
+++ b/gc/mach_dep.c Sun Oct 16 00:05:12 2011 +0200
@@ -161,7 +161,7 @@
#if !defined(HAVE_PUSH_REGS) && defined(UNIX_LIKE)
# include <signal.h>
-# include <ucontext.h>
+# include <sys/ucontext.h>
#endif
#if defined(UNIX_LIKE) && !defined(NO_GETCONTEXT) && \
diff -r a63253e53bf9 gc/os_dep.c
--- a/gc/os_dep.c Sat Oct 15 23:51:26 2011 +0200
+++ b/gc/os_dep.c Sun Oct 16 00:05:12 2011 +0200
@@ -2679,7 +2679,7 @@
# if defined(MSWIN32) || defined(MSWINCE)
LONG WINAPI GC_write_fault_handler(struct _EXCEPTION_POINTERS *exc_info)
# else
-# include <ucontext.h>
+# include <sys/ucontext.h>
/*ARGSUSED*/
STATIC void GC_write_fault_handler(int sig, siginfo_t *si, void *raw_sc)
# endif /* MSWIN32 || MSWINCE */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment