ruby-changes:66107
From: usa <ko1@a...>
Date: Mon, 10 May 2021 01:12:09 +0900 (JST)
Subject: [ruby-changes:66107] 5df653caaa (ruby_2_6): fix macos build
https://git.ruby-lang.org/ruby.git/commit/?id=5df653caaa From 5df653caaa1a666172d889760786cdf26952a1a7 Mon Sep 17 00:00:00 2001 From: usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> Date: Sun, 9 May 2021 16:11:52 +0000 Subject: fix macos build note that this is not a security fix, but recognized as critical build problem. [Backport #17777] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_6@67942 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/fiddle/closure.c | 5 +---- ext/fiddle/extconf.rb | 13 +++++++++++-- version.h | 10 +++++----- vm.c | 4 +++- 4 files changed, 20 insertions(+), 12 deletions(-) diff --git a/ext/fiddle/closure.c b/ext/fiddle/closure.c index 1a80b2b..2044c83 100644 --- a/ext/fiddle/closure.c +++ b/ext/fiddle/closure.c @@ -14,10 +14,7 @@ typedef struct { https://github.com/ruby/ruby/blob/trunk/ext/fiddle/closure.c#L14 } fiddle_closure; #if defined(USE_FFI_CLOSURE_ALLOC) -#elif defined(__OpenBSD__) || defined(__APPLE__) || defined(__linux__) -# define USE_FFI_CLOSURE_ALLOC 0 -#elif defined(RUBY_LIBFFI_MODVERSION) && RUBY_LIBFFI_MODVERSION < 3000005 && \ - (defined(__i386__) || defined(__x86_64__) || defined(_M_IX86) || defined(_M_AMD64)) +#elif !defined(HAVE_FFI_CLOSURE_ALLOC) # define USE_FFI_CLOSURE_ALLOC 0 #else # define USE_FFI_CLOSURE_ALLOC 1 diff --git a/ext/fiddle/extconf.rb b/ext/fiddle/extconf.rb index fce0cb4..dc53f22 100644 --- a/ext/fiddle/extconf.rb +++ b/ext/fiddle/extconf.rb @@ -13,7 +13,7 @@ if ! bundle https://github.com/ruby/ruby/blob/trunk/ext/fiddle/extconf.rb#L13 if have_header(ffi_header = 'ffi.h') true elsif have_header(ffi_header = 'ffi/ffi.h') - $defs.push(format('-DUSE_HEADER_HACKS')) + $defs.push('-DUSE_HEADER_HACKS') true end and (have_library('ffi') || have_library('libffi')) end or @@ -116,6 +116,15 @@ if ver https://github.com/ruby/ruby/blob/trunk/ext/fiddle/extconf.rb#L116 ver = ver.gsub(/-rc\d+/, '') # If ver contains rc version, just ignored. ver = (ver.split('.') + [0,0])[0,3] $defs.push(%{-DRUBY_LIBFFI_MODVERSION=#{ '%d%03d%03d' % ver }}) + warn "libffi_version: #{ver.join('.')}" +end + +case +when $mswin, $mingw, (ver && (ver <=> [3, 2]) >= 0) + $defs << "-DUSE_FFI_CLOSURE_ALLOC=1" +when (ver && (ver <=> [3, 2]) < 0) +else + have_func('ffi_closure_alloc', ffi_header) end have_header 'sys/mman.h' @@ -142,7 +151,7 @@ types.each do |type, signed| https://github.com/ruby/ruby/blob/trunk/ext/fiddle/extconf.rb#L151 if /^\#define\s+SIZEOF_#{type}\s+(SIZEOF_(.+)|\d+)/ =~ config if size = $2 and size != 'VOIDP' size = types.fetch(size) {size} - $defs << format("-DTYPE_%s=TYPE_%s", signed||type, size) + $defs << "-DTYPE_#{signed||type}=TYPE_#{size}" end if signed check_signedness(type.downcase, "stddef.h") diff --git a/version.h b/version.h index 1c491eb..dd836d4 100644 --- a/version.h +++ b/version.h @@ -1,10 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/version.h#L1 -#define RUBY_VERSION "2.6.7" -#define RUBY_RELEASE_DATE "2021-04-05" -#define RUBY_PATCHLEVEL 197 +#define RUBY_VERSION "2.6.8" +#define RUBY_RELEASE_DATE "2021-05-10" +#define RUBY_PATCHLEVEL 198 #define RUBY_RELEASE_YEAR 2021 -#define RUBY_RELEASE_MONTH 4 -#define RUBY_RELEASE_DAY 5 +#define RUBY_RELEASE_MONTH 5 +#define RUBY_RELEASE_DAY 10 #include "ruby/version.h" diff --git a/vm.c b/vm.c index 0954aa7..04b8b96 100644 --- a/vm.c +++ b/vm.c @@ -2263,6 +2263,8 @@ free_loading_table_entry(st_data_t key, st_data_t value, st_data_t arg) https://github.com/ruby/ruby/blob/trunk/vm.c#L2263 return ST_DELETE; } +extern void rb_native_mutex_destroy(rb_nativethread_lock_t *lock); + int ruby_vm_destruct(rb_vm_t *vm) { @@ -2486,7 +2488,7 @@ rb_execution_context_mark(const rb_execution_context_t *ec) https://github.com/ruby/ruby/blob/trunk/vm.c#L2488 rb_gc_mark_machine_stack(ec); rb_gc_mark_locations((VALUE *)&ec->machine.regs, (VALUE *)(&ec->machine.regs) + - sizeof(ec->machine.regs) / sizeof(VALUE)); + sizeof(ec->machine.regs) / (sizeof(VALUE))); } RUBY_MARK_UNLESS_NULL(ec->errinfo); -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/