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

ruby-changes:60741

From: Andreas <ko1@a...>
Date: Sat, 11 Apr 2020 11:20:07 +0900 (JST)
Subject: [ruby-changes:60741] abe2e7de4d (master): Don't require sub-word atomics

https://git.ruby-lang.org/ruby.git/commit/?id=abe2e7de4d

From abe2e7de4d1f2d5861d7c9ab9c7e778f2ee1dcd2 Mon Sep 17 00:00:00 2001
From: Andreas Schwab <schwab@s...>
Date: Fri, 10 Apr 2020 15:34:52 +0200
Subject: Don't require sub-word atomics

On some architectures (like RISC-V) sub-word atomics are only available
when linking against -latomic, but the configure script doesn't do that,
causing the atomic checks to fail and the resulting ruby binary is
non-functional.  Ruby does not use sub-word atomic operations, rb_atomic_t
is defined to unsigned int, so use unsigned int when checking for atomic
operations.

diff --git a/configure.ac b/configure.ac
index 7c12b9e..ba86def 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1498,7 +1498,7 @@ AS_IF([test "$GCC" = yes], [ https://github.com/ruby/ruby/blob/trunk/configure.ac#L1498
     ])
 
     AC_CACHE_CHECK([for __atomic builtins], [rb_cv_gcc_atomic_builtins], [
-	AC_TRY_LINK([unsigned char atomic_var;],
+	AC_TRY_LINK([unsigned int atomic_var;],
 		    [
 			__atomic_exchange_n(&atomic_var, 0, __ATOMIC_SEQ_CST);
 			__atomic_exchange_n(&atomic_var, 1, __ATOMIC_SEQ_CST);
@@ -1513,7 +1513,7 @@ AS_IF([test "$GCC" = yes], [ https://github.com/ruby/ruby/blob/trunk/configure.ac#L1513
     ])
 
     AC_CACHE_CHECK([for __sync builtins], [rb_cv_gcc_sync_builtins], [
-	AC_TRY_LINK([unsigned char atomic_var;],
+	AC_TRY_LINK([unsigned int atomic_var;],
 		    [
 			__sync_lock_test_and_set(&atomic_var, 0);
 			__sync_lock_test_and_set(&atomic_var, 1);
-- 
cgit v0.10.2


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

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