[前][次][番号順一覧][スレッド一覧]

ruby-changes:37618

From: nobu <ko1@a...>
Date: Mon, 23 Feb 2015 16:05:34 +0900 (JST)
Subject: [ruby-changes:37618] nobu:r49699 (trunk): Makefile.in: make static IDs symbols local

nobu	2015-02-23 16:05:23 +0900 (Mon, 23 Feb 2015)

  New Revision: 49699

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=49699

  Log:
    Makefile.in: make static IDs symbols local
    
    * Makefile.in (LIBRUBY_SO): make symbols for static IDs which
      begin with ruby_static_id_ local too.

  Modified files:
    trunk/Makefile.in
    trunk/common.mk
    trunk/configure.in
    trunk/win32/mkexports.rb
Index: configure.in
===================================================================
--- configure.in	(revision 49698)
+++ configure.in	(revision 49699)
@@ -3516,6 +3516,7 @@ AS_CASE("$enable_shared", [yes], [ https://github.com/ruby/ruby/blob/trunk/configure.in#L3516
 	LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-compatibility_version $(ruby_version)'
 	if test "$visibility_option" = ld; then
 	    LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-Wl,-unexported_symbol,_Init_*'
+	    LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-Wl,-unexported_symbol,_ruby_static_id_*'
 	    LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-Wl,-unexported_symbol,*_threadptr_*'
 	fi
 	LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "' $(XLDFLAGS)'
Index: common.mk
===================================================================
--- common.mk	(revision 49698)
+++ common.mk	(revision 49699)
@@ -234,7 +234,7 @@ $(STATIC_RUBY)$(EXEEXT): $(MAINOBJ) $(DL https://github.com/ruby/ruby/blob/trunk/common.mk#L234
 
 ruby.imp: $(COMMONOBJS)
 	$(Q)$(NM) -Pgp $(COMMONOBJS) | \
-	awk 'BEGIN{print "#!"}; $$2~/^[BDT]$$/&&$$1!~/^(Init_|.*_threadptr_|\.)/{print $$1}' | \
+	awk 'BEGIN{print "#!"}; $$2~/^[BDT]$$/&&$$1!~/^(Init_|ruby_static_id_|.*_threadptr_|\.)/{print $$1}' | \
 	sort -u -o $@
 
 install: install-$(INSTALLDOC)
Index: win32/mkexports.rb
===================================================================
--- win32/mkexports.rb	(revision 49698)
+++ win32/mkexports.rb	(revision 49699)
@@ -7,6 +7,8 @@ module RbConfig https://github.com/ruby/ruby/blob/trunk/win32/mkexports.rb#L7
 end
 
 class Exports
+  PrivateNames = /(?:Init_|ruby_static_id_|.*_threadptr_|DllMain\b)/
+
   @@subclass = []
   def self.inherited(klass)
     @@subclass << [/#{klass.name.sub(/.*::/, '').downcase}/i, klass]
@@ -116,7 +118,7 @@ class Exports::Mswin < Exports https://github.com/ruby/ruby/blob/trunk/win32/mkexports.rb#L118
           is_data = !$1
           if noprefix or /^[@_]/ =~ l
             next if /(?!^)@.*@/ =~ l || /@[[:xdigit:]]{8,32}$/ =~ l ||
-              /^_?(?:Init_|.*_threadptr_|DllMain\b)/ =~ l
+                    /^_?#{PrivateNames}/o =~ l
             l.sub!(/^[@_]/, '') if /@\d+$/ !~ l
           elsif !l.sub!(/^(\S+) \([^@?\`\']*\)$/, '\1')
             next
@@ -150,7 +152,7 @@ class Exports::Cygwin < Exports https://github.com/ruby/ruby/blob/trunk/win32/mkexports.rb#L152
   def each_export(objs)
     symprefix = RbConfig::CONFIG["SYMBOL_PREFIX"]
     symprefix.strip! if symprefix
-    re = /\s(?:(T)|[[:upper:]])\s#{symprefix}((?!Init_|.*_threadptr_|DllMain\b).*)$/
+    re = /\s(?:(T)|[[:upper:]])\s#{symprefix}((?!#{PrivateNames}).*)$/
     objdump(objs) do |l|
       next if /@.*@/ =~ l
       yield $2, !$1 if re =~ l
Index: Makefile.in
===================================================================
--- Makefile.in	(revision 49698)
+++ Makefile.in	(revision 49699)
@@ -239,7 +239,8 @@ $(LIBRUBY_SO): https://github.com/ruby/ruby/blob/trunk/Makefile.in#L239
 		@-$(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)*_threadptr_*' $@
+		-$(Q) $(OBJCOPY) -w -L '$(SYMBOL_PREFIX)Init_*' -L '$(SYMBOL_PREFIX)ruby_static_id_*' \
+			-L '$(SYMBOL_PREFIX)*_threadptr_*' $@
 		$(Q) $(POSTLINK)
 		@-$(MINIRUBY) -e 'ARGV.each{|link| File.delete link rescue nil; \
 						  File.symlink "$(LIBRUBY_SO)", link}' \

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]