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

ruby-changes:28237

From: nagachika <ko1@a...>
Date: Sun, 14 Apr 2013 23:39:46 +0900 (JST)
Subject: [ruby-changes:28237] nagachika:r40289 (ruby_2_0_0): merge revision(s) 39958,39989: [Backport #8169]

nagachika	2013-04-14 23:39:13 +0900 (Sun, 14 Apr 2013)

  New Revision: 40289

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

  Log:
    merge revision(s) 39958,39989: [Backport #8169]
    
    * lib/mkmf.rb (MAIN_DOES_NOTHING): force to refer symbols for tests
      to be preserved.  [ruby-core:53745] [Bug #8169]
    
    * lib/mkmf.rb (MAIN_DOES_NOTHING): ensure symbols for tests to be
      preserved.  [ruby-core:53745] [Bug #8169]

  Modified directories:
    branches/ruby_2_0_0/
  Modified files:
    branches/ruby_2_0_0/ChangeLog
    branches/ruby_2_0_0/lib/mkmf.rb
    branches/ruby_2_0_0/version.h

Index: ruby_2_0_0/ChangeLog
===================================================================
--- ruby_2_0_0/ChangeLog	(revision 40288)
+++ ruby_2_0_0/ChangeLog	(revision 40289)
@@ -1,3 +1,13 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ChangeLog#L1
+Sun Apr 14 23:19:55 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* lib/mkmf.rb (MAIN_DOES_NOTHING): ensure symbols for tests to be
+	  preserved.  [ruby-core:53745] [Bug #8169]
+
+Sun Apr 14 23:19:55 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* lib/mkmf.rb (MAIN_DOES_NOTHING): force to refer symbols for tests
+	  to be preserved.  [ruby-core:53745] [Bug #8169]
+
 Sun Apr 14 03:00:51 2013  Naohisa Goto  <ngotogenome@g...>
 
 	* configure.in (AC_CHECK_HEADERS): atomic.h for Solaris atomic_ops.
Index: ruby_2_0_0/lib/mkmf.rb
===================================================================
--- ruby_2_0_0/lib/mkmf.rb	(revision 40288)
+++ ruby_2_0_0/lib/mkmf.rb	(revision 40289)
@@ -717,16 +717,16 @@ int main() {printf("%"PRI_CONFTEST_PREFI https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/lib/mkmf.rb#L717
     decltype && try_link(<<"SRC", opt, &b) or
 #{headers}
 /*top*/
-#{MAIN_DOES_NOTHING}
 extern int t(void);
 int t(void) { #{decltype["volatile p"]}; p = (#{decltype[]})#{func}; return 0; }
+#{MAIN_DOES_NOTHING "t"}
 SRC
     call && try_link(<<"SRC", opt, &b)
 #{headers}
 /*top*/
-#{MAIN_DOES_NOTHING}
 extern int t(void);
 int t(void) { #{call}; return 0; }
+#{MAIN_DOES_NOTHING "t"}
 SRC
   end
 
@@ -736,9 +736,9 @@ SRC https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/lib/mkmf.rb#L736
     try_compile(<<"SRC", opt, &b)
 #{headers}
 /*top*/
-#{MAIN_DOES_NOTHING}
 extern int t(void);
 int t(void) { const volatile void *volatile p; p = &(&#{var})[0]; return 0; }
+#{MAIN_DOES_NOTHING "t"}
 SRC
   end
 
@@ -1120,8 +1120,8 @@ SRC https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/lib/mkmf.rb#L1120
       if try_compile(<<"SRC", opt, &b)
 #{cpp_include(headers)}
 /*top*/
-#{MAIN_DOES_NOTHING}
 int s = (char *)&((#{type}*)0)->#{member} - (char *)0;
+#{MAIN_DOES_NOTHING "s"}
 SRC
         $defs.push(format("-DHAVE_%s_%s", type.tr_cpp, member.tr_cpp))
         $defs.push(format("-DHAVE_ST_%s", member.tr_cpp)) # backward compatibility
@@ -1374,9 +1374,9 @@ SRC https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/lib/mkmf.rb#L1374
 #{cpp_include(headers)}
 /*top*/
 volatile #{type} conftestval;
-#{MAIN_DOES_NOTHING}
 extern int t(void);
 int t(void) {return (int)(1-*(conftestval#{member ? ".#{member}" : ""}));}
+#{MAIN_DOES_NOTHING "t"}
 SRC
   end
 
@@ -1387,9 +1387,9 @@ SRC https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/lib/mkmf.rb#L1387
 #{cpp_include(headers)}
 /*top*/
 volatile #{type} conftestval;
-#{MAIN_DOES_NOTHING}
 extern int t(void);
 int t(void) {return (int)(1-(conftestval#{member ? ".#{member}" : ""}));}
+#{MAIN_DOES_NOTHING "t"}
 SRC
   end
 
@@ -2388,6 +2388,19 @@ MESSAGE https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/lib/mkmf.rb#L2388
     end
   end
 
+  def MAIN_DOES_NOTHING(*refs)
+    src = MAIN_DOES_NOTHING
+    unless refs.empty?
+      src = src.sub(/\{/) do
+        $& +
+          "\n  if (argc > 1000000) {\n" +
+          refs.map {|n|"    printf(\"%p\", &#{n});\n"}.join("") +
+          "  }\n"
+      end
+    end
+    src
+  end
+
   extend self
   init_mkmf
 
@@ -2495,7 +2508,7 @@ MESSAGE https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/lib/mkmf.rb#L2508
   ##
   # A C main function which does no work
 
-  MAIN_DOES_NOTHING = config_string('MAIN_DOES_NOTHING') || 'int main(void) {return 0;}'
+  MAIN_DOES_NOTHING = config_string('MAIN_DOES_NOTHING') || "int main(int argc, char **argv)\n{\n  return 0;\n}"
   UNIVERSAL_INTS = config_string('UNIVERSAL_INTS') {|s| Shellwords.shellwords(s)} ||
     %w[int short long long\ long]
 
Index: ruby_2_0_0/version.h
===================================================================
--- ruby_2_0_0/version.h	(revision 40288)
+++ ruby_2_0_0/version.h	(revision 40289)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/version.h#L1
 #define RUBY_VERSION "2.0.0"
 #define RUBY_RELEASE_DATE "2013-04-14"
-#define RUBY_PATCHLEVEL 124
+#define RUBY_PATCHLEVEL 125
 
 #define RUBY_RELEASE_YEAR 2013
 #define RUBY_RELEASE_MONTH 4

Property changes on: ruby_2_0_0
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r39958,39989


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

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