ruby-changes:65528
From: nagachika <ko1@a...>
Date: Sat, 20 Mar 2021 13:56:37 +0900 (JST)
Subject: [ruby-changes:65528] ba6f087944 (ruby_2_7): merge revision(s) abe2e7de4d1f2d5861d7c9ab9c7e778f2ee1dcd2: [Backport #16774]
https://git.ruby-lang.org/ruby.git/commit/?id=ba6f087944 From ba6f0879448ebc80c7a595c369c59b6d8dfbdf3e Mon Sep 17 00:00:00 2001 From: nagachika <nagachika@r...> Date: Sat, 20 Mar 2021 13:33:52 +0900 Subject: merge revision(s) abe2e7de4d1f2d5861d7c9ab9c7e778f2ee1dcd2: [Backport #16774] 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. --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- configure.ac | 4 ++-- version.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 9077f4b..1ec13bf 100644 --- a/configure.ac +++ b/configure.ac @@ -1457,7 +1457,7 @@ AS_IF([test "$GCC" = yes], [ https://github.com/ruby/ruby/blob/trunk/configure.ac#L1457 ]) 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); @@ -1472,7 +1472,7 @@ AS_IF([test "$GCC" = yes], [ https://github.com/ruby/ruby/blob/trunk/configure.ac#L1472 ]) 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); diff --git a/version.h b/version.h index fac9ec3..ee50c12 100644 --- a/version.h +++ b/version.h @@ -2,7 +2,7 @@ https://github.com/ruby/ruby/blob/trunk/version.h#L2 # define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR #define RUBY_VERSION_TEENY 3 #define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR -#define RUBY_PATCHLEVEL 165 +#define RUBY_PATCHLEVEL 166 #define RUBY_RELEASE_YEAR 2021 #define RUBY_RELEASE_MONTH 3 -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/