merge revision(s) f7059af50a: [Backport #21046]

Use no-inline version `rb_current_ec` on Arm64

	The TLS across .so issue seems related to Arm64, but not Darwin.
This commit is contained in:
Takashi Kokubun 2025-02-13 21:08:20 -08:00
parent 04298f2d15
commit 3db440f5a1
4 changed files with 5 additions and 5 deletions

View file

@ -133,8 +133,8 @@ struct rb_thread_sched {
#ifdef RB_THREAD_LOCAL_SPECIFIER #ifdef RB_THREAD_LOCAL_SPECIFIER
NOINLINE(void rb_current_ec_set(struct rb_execution_context_struct *)); NOINLINE(void rb_current_ec_set(struct rb_execution_context_struct *));
# ifdef __APPLE__ # if defined(__arm64__) || defined(__aarch64__)
// on Darwin, TLS can not be accessed across .so // on Arm64, TLS can not be accessed across .so
NOINLINE(struct rb_execution_context_struct *rb_current_ec(void)); NOINLINE(struct rb_execution_context_struct *rb_current_ec(void));
# else # else
RUBY_EXTERN RB_THREAD_LOCAL_SPECIFIER struct rb_execution_context_struct *ruby_current_ec; RUBY_EXTERN RB_THREAD_LOCAL_SPECIFIER struct rb_execution_context_struct *ruby_current_ec;

View file

@ -11,7 +11,7 @@
# define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR # define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR
#define RUBY_VERSION_TEENY 1 #define RUBY_VERSION_TEENY 1
#define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR #define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR
#define RUBY_PATCHLEVEL 16 #define RUBY_PATCHLEVEL 17
#include "ruby/version.h" #include "ruby/version.h"
#include "ruby/internal/abi.h" #include "ruby/internal/abi.h"

2
vm.c
View file

@ -571,7 +571,7 @@ rb_current_ec_set(rb_execution_context_t *ec)
} }
#ifdef __APPLE__ #if defined(__arm64__) || defined(__aarch64__)
rb_execution_context_t * rb_execution_context_t *
rb_current_ec(void) rb_current_ec(void)
{ {

View file

@ -1977,7 +1977,7 @@ static inline rb_execution_context_t *
rb_current_execution_context(bool expect_ec) rb_current_execution_context(bool expect_ec)
{ {
#ifdef RB_THREAD_LOCAL_SPECIFIER #ifdef RB_THREAD_LOCAL_SPECIFIER
#ifdef __APPLE__ #if defined(__arm64__) || defined(__aarch64__)
rb_execution_context_t *ec = rb_current_ec(); rb_execution_context_t *ec = rb_current_ec();
#else #else
rb_execution_context_t *ec = ruby_current_ec; rb_execution_context_t *ec = ruby_current_ec;