summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2026-03-24 14:24:24 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2026-03-24 14:49:12 +0900
commit7cb33b6a88beda081c9fd56302ee403333ba4427 (patch)
treee8b8a90ad6949b7b71e4f8501fec262ee0f9ba5c
parentc675ec66e912b3000e05d65bba473e8bf6e18c96 (diff)
merge revision(s) bc2a8a002a6c41fc1b28e02e15e2fb2b72d1b66e, c26057ebafb23b063190d31d5b4d19a0e0a1306c: [Backport #21779]
[Bug #21779] Uniquify `InitVM` functions as well as `Init` Avoid possible name conflict when `--with-static-linked-ext`. [Bug #21779] Do not export InitVM functions Fix ruby/io-console#105.
-rw-r--r--configure.ac1
-rwxr-xr-xext/extmk.rb1
-rw-r--r--template/Makefile.in3
-rw-r--r--version.h2
4 files changed, 5 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 0f9553ee42..5720a474bb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3623,6 +3623,7 @@ AS_CASE("$enable_shared", [yes], [
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-current_version $(RUBY_PROGRAM_VERSION)'
AS_IF([test "$visibility_option" = ld], [
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-Wl,-unexported_symbol,_Init_*'
+ LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-Wl,-unexported_symbol,_InitVM_*'
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-Wl,-unexported_symbol,_ruby_static_id_*'
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-Wl,-unexported_symbol,*_threadptr_*'
])
diff --git a/ext/extmk.rb b/ext/extmk.rb
index da0b06aaa5..1f8e59f625 100755
--- a/ext/extmk.rb
+++ b/ext/extmk.rb
@@ -557,6 +557,7 @@ extend Module.new {
if $static and (target = args.first).include?("/")
base = File.basename(target)
$defs << "-DInit_#{base}=Init_#{target.tr('/', '_')}"
+ $defs << "-DInitVM_#{base}=InitVM_#{target.tr('/', '_')}"
end
return super
end
diff --git a/template/Makefile.in b/template/Makefile.in
index 332d390a84..c4d591d9ad 100644
--- a/template/Makefile.in
+++ b/template/Makefile.in
@@ -325,7 +325,8 @@ $(LIBRUBY_SO):
@-[ -n "$(EXTSTATIC)" ] || $(PRE_LIBRUBY_UPDATE)
$(ECHO) linking shared-library $@
$(Q) $(LDSHARED) $(DLDFLAGS) $(OBJS) $(DLDOBJS) $(SOLIBS) $(EXTSOLIBS) $(OUTFLAG)$@
- -$(Q) $(OBJCOPY) -w -L '$(SYMBOL_PREFIX)Init_*' -L '$(SYMBOL_PREFIX)ruby_static_id_*' \
+ -$(Q) $(OBJCOPY) -w -L '$(SYMBOL_PREFIX)Init_*' -L '$(SYMBOL_PREFIX)InitVM_*' \
+ -L '$(SYMBOL_PREFIX)ruby_static_id_*' \
-L '$(SYMBOL_PREFIX)*_threadptr_*' -L '$(SYMBOL_PREFIX)*_ec_*' $@
$(Q) $(POSTLINK)
@-$(MINIRUBY) -e 'so, *aliases = ARGV; aliases.uniq!; aliases.delete(File.basename(so)); \
diff --git a/version.h b/version.h
index 31a4f79cb2..996107f338 100644
--- a/version.h
+++ b/version.h
@@ -11,7 +11,7 @@
# define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR
#define RUBY_VERSION_TEENY 10
#define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR
-#define RUBY_PATCHLEVEL 199
+#define RUBY_PATCHLEVEL 200
#include "ruby/version.h"
#include "ruby/internal/abi.h"