[前][次][番号順一覧][スレッド一覧]

ruby-changes:32874

From: usa <ko1@a...>
Date: Fri, 14 Feb 2014 20:52:57 +0900 (JST)
Subject: [ruby-changes:32874] usa:r44953 (ruby_1_9_3): * configure.in (ARCH_FLAG): __sync_val_compare_and_swap_4 needs

usa	2014-02-14 20:52:53 +0900 (Fri, 14 Feb 2014)

  New Revision: 44953

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=44953

  Log:
    * configure.in (ARCH_FLAG): __sync_val_compare_and_swap_4 needs
      -march=i486 on at least linux gcc 4.1.

  Modified files:
    branches/ruby_1_9_3/ChangeLog
    branches/ruby_1_9_3/configure.in
    branches/ruby_1_9_3/version.h
Index: ruby_1_9_3/configure.in
===================================================================
--- ruby_1_9_3/configure.in	(revision 44952)
+++ ruby_1_9_3/configure.in	(revision 44953)
@@ -308,6 +308,29 @@ if test "$target_cpu" != "$host_cpu" -a https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/configure.in#L308
     RUBY_DEFAULT_ARCH("$target_cpu")
 fi
 
+AS_CASE(["$target_cpu-$target_os"], [[i[3-6]86*]], [
+	 AC_CACHE_CHECK([for __sync_val_compare_and_swap], [rb_cv_gcc_compiler_cas], [
+			 AC_TRY_LINK([unsigned long atomic_var;],
+				     [
+				      __sync_val_compare_and_swap(&atomic_var, 0, 1);
+				      ],
+				      [rb_cv_gcc_compiler_cas=yes],
+				      [rb_cv_gcc_compiler_cas=no])])
+	 if test "$rb_cv_gcc_compiler_cas" = no; then
+		 unset rb_cv_gcc_compiler_cas
+		 save_CFLAGS="$CFLAGS"
+		 CFLAGS="$CFLAGS -march=i486"
+		 AC_CACHE_CHECK([for __sync_val_compare_and_swap with -march=i486], [rb_cv_gcc_compiler_cas], [
+				 AC_TRY_LINK([unsigned long atomic_var;],
+					     [
+					      __sync_val_compare_and_swap(&atomic_var, 0, 1);
+					      ],
+					      [rb_cv_gcc_compiler_cas=yes
+					       ARCH_FLAG="-march=i486"],
+					      [rb_cv_gcc_compiler_cas=no])])
+		 CFLAGS="$save_CFLAGS"
+	 fi])
+
 AC_CHECK_TOOL(RANLIB, ranlib, :)
 AC_CHECK_TOOL(AR, ar)
 if test -z "$AR"; then
Index: ruby_1_9_3/ChangeLog
===================================================================
--- ruby_1_9_3/ChangeLog	(revision 44952)
+++ ruby_1_9_3/ChangeLog	(revision 44953)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/ChangeLog#L1
+Fri Feb 14 20:52:31 2014  NAKAMURA Usaku  <usa@r...>
+
+	* configure.in (ARCH_FLAG): __sync_val_compare_and_swap_4 needs
+	  -march=i486 on at least linux gcc 4.1.
+
 Fri Feb 14 19:07:13 2014  Nobuyoshi Nakada  <nobu@r...>
 
 	* ruby_atomic.h (ATOMIC_PTR_EXCHANGE): atomic exchange function for
Index: ruby_1_9_3/version.h
===================================================================
--- ruby_1_9_3/version.h	(revision 44952)
+++ ruby_1_9_3/version.h	(revision 44953)
@@ -1,5 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/version.h#L1
 #define RUBY_VERSION "1.9.3"
-#define RUBY_PATCHLEVEL 532
+#define RUBY_PATCHLEVEL 533
 
 #define RUBY_RELEASE_DATE "2014-02-14"
 #define RUBY_RELEASE_YEAR 2014

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]