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:
Nobuyoshi Nakada 2025-01-17 22:48:10 +09:00
parent cc7fafb459
commit f7059af50a
No known key found for this signature in database
GPG Key ID: 3582D74E1FEE4465
Notes: git 2025-01-17 14:27:44 +00:00
3 changed files with 4 additions and 4 deletions

View File

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

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_current_ec(void)
{

View File

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