Skip to content

Instantly share code, notes, and snippets.

@mrkn
Created July 28, 2011 02:27
Show Gist options
  • Save mrkn/1110796 to your computer and use it in GitHub Desktop.
Save mrkn/1110796 to your computer and use it in GitHub Desktop.
diff --git a/ChangeLog b/ChangeLog
index b151bc4..f643541 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+Thu Jul 27 10:35:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * configure.in: change default compilers to gcc-4.2 and g++-4.2 on OS
+ X 10.7 (Lion).
+
+Fri Jul 22 21:46:54 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * vm_insnhelper.c (vm_call_cfunc): added volatile for a workaround
+ of cfp consistency error problem on OS X 10.7 (Lion). It's
+ suspected llvm optimization bug.
+ [Bug #5074] [ruby-dev:44185]
+
Sat Jul 9 19:25:02 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
* ext/tk/extconf.rb: I gave up to fix the build issue of ext/tk with Windows
diff --git a/configure.in b/configure.in
index 8e481b7..85bcfb3 100644
--- a/configure.in
+++ b/configure.in
@@ -82,13 +82,24 @@ AC_SUBST(RUBY_RELEASE_DATE)
if test "$MAJOR" = "1"; then
AC_DEFINE(CANONICALIZATION_FOR_MATHN)
fi
+
+AC_CANONICAL_TARGET
+target_os=`echo $target_os | sed 's/linux-gnu$/linux/;s/linux-gnu/linux-/'`
+AS_CASE(["$target_os"],
+ [darwin11.*], [
+ default_cc=cc-4.2
+ default_gcc=gcc-4.2],
+ [ default_cc=cc
+ default_gcc=gcc
+ ])
+
dnl checks for alternative programs
AC_ARG_WITH(gcc,
AS_HELP_STRING([--without-gcc], [never use gcc]),
[
AS_CASE([$withval],
- [no], [: ${CC=cc}],
- [yes], [: ${CC=gcc}],
+ [no], [: ${CC=$default_cc}],
+ [yes], [: ${CC=$default_gcc}],
[CC=$withval])])
dnl If the user switches compilers, we can't believe the cache
if test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC"
@@ -96,6 +107,15 @@ then
AC_MSG_ERROR(cached CC is different -- throw away $cache_file
(it is also a good idea to do 'make clean' before compiling))
fi
+AS_CASE(["$target_os"], [darwin11.*], [
+ test -z "$withval" && : ${CC=gcc-4.2}
+ AS_CASE(["x$CC"],
+ [x], [: ${CXX=g++-4.2}],
+ [xgcc-4.2|x/usr/bin/gcc-4.2], [: ${CXX=g++-4.2}],
+ [xgcc|x/usr/bin/gcc], [: ${CXX=g++}],
+ [xcc-4.2|x/usr/bin/cc-4.2], [: ${CXX=c++-4.2}],
+ [xcc|x/usr/bin/cc], [: ${CXX=c++}])
+])
test -z "$CC" || ac_cv_prog_CC="$CC"
if test "$program_prefix" = NONE; then
@@ -106,8 +126,6 @@ RUBYW_BASE_NAME=`echo rubyw | sed "$program_transform_name"`
AC_SUBST(RUBY_BASE_NAME)
AC_SUBST(RUBYW_BASE_NAME)
-AC_CANONICAL_TARGET
-target_os=`echo $target_os | sed 's/linux-gnu$/linux/;s/linux-gnu/linux-/'`
ac_install_sh='' # unusable for extension libraries.
AC_DEFUN([RUBY_APPEND_OPTION],
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 6b78394..9c9e6bf 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -384,8 +384,8 @@ call_cfunc(VALUE (*func)(), VALUE recv,
}
static inline VALUE
-vm_call_cfunc(rb_thread_t *th, rb_control_frame_t *reg_cfp,
- int num, VALUE recv, const rb_block_t *blockptr,
+vm_call_cfunc(rb_thread_t *th, volatile rb_control_frame_t *reg_cfp,
+ int num, volatile VALUE recv, const rb_block_t *blockptr,
const rb_method_entry_t *me)
{
VALUE val = 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment