ruby-changes:28663
From: usa <ko1@a...>
Date: Tue, 14 May 2013 11:20:38 +0900 (JST)
Subject: [ruby-changes:28663] usa:r40715 (ruby_1_9_3): merge revision(s) 39958,39989: [Backport #8216]
usa 2013-05-14 11:20:26 +0900 (Tue, 14 May 2013) New Revision: 40715 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=40715 Log: merge revision(s) 39958,39989: [Backport #8216] * 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_1_9_3/ Modified files: branches/ruby_1_9_3/ChangeLog branches/ruby_1_9_3/lib/mkmf.rb branches/ruby_1_9_3/version.h Index: ruby_1_9_3/ChangeLog =================================================================== --- ruby_1_9_3/ChangeLog (revision 40714) +++ ruby_1_9_3/ChangeLog (revision 40715) @@ -1,3 +1,13 @@ https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/ChangeLog#L1 +Tue May 14 10:42:23 2013 Nobuyoshi Nakada <nobu@r...> + + * lib/mkmf.rb (MAIN_DOES_NOTHING): ensure symbols for tests to be + preserved. [ruby-core:53745] [Bug #8169] + +Tue May 14 10:42:23 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] + Tue May 14 10:39:33 2013 NAKAMURA Usaku <usa@r...> * regexec.c (onig_search): fix problem with optimization of \z. Index: ruby_1_9_3/lib/mkmf.rb =================================================================== --- ruby_1_9_3/lib/mkmf.rb (revision 40714) +++ ruby_1_9_3/lib/mkmf.rb (revision 40715) @@ -619,14 +619,14 @@ def try_func(func, libs, headers = nil, https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/lib/mkmf.rb#L619 try_link(<<"SRC", libs, &b) or #{headers} /*top*/ -#{MAIN_DOES_NOTHING} int t() { #{decltype["volatile p"]}; p = (#{decltype[]})#{func}; return 0; } +#{MAIN_DOES_NOTHING "t"} SRC call && try_link(<<"SRC", libs, &b) #{headers} /*top*/ -#{MAIN_DOES_NOTHING} int t() { #{func}(); return 0; } +#{MAIN_DOES_NOTHING "t"} SRC end @@ -636,8 +636,8 @@ def try_var(var, headers = nil, &b) https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/lib/mkmf.rb#L636 try_compile(<<"SRC", &b) #{headers} /*top*/ -#{MAIN_DOES_NOTHING} int t() { const volatile void *volatile p; p = &(&#{var})[0]; return 0; } +#{MAIN_DOES_NOTHING "t"} SRC end @@ -1002,8 +1002,8 @@ def have_struct_member(type, member, hea https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/lib/mkmf.rb#L1002 if try_compile(<<"SRC", &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 @@ -1243,8 +1243,8 @@ def scalar_ptr_type?(type, member = nil, https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/lib/mkmf.rb#L1243 #{cpp_include(headers)} /*top*/ volatile #{type} conftestval; -#{MAIN_DOES_NOTHING} int t() {return (int)(1-*(conftestval#{member ? ".#{member}" : ""}));} +#{MAIN_DOES_NOTHING "t"} SRC end @@ -1255,8 +1255,8 @@ def scalar_type?(type, member = nil, hea https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/lib/mkmf.rb#L1255 #{cpp_include(headers)} /*top*/ volatile #{type} conftestval; -#{MAIN_DOES_NOTHING} int t() {return (int)(1-(conftestval#{member ? ".#{member}" : ""}));} +#{MAIN_DOES_NOTHING "t"} SRC end @@ -2226,6 +2226,19 @@ def mkmf_failed(path) https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/lib/mkmf.rb#L2226 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 + # :startdoc: init_mkmf @@ -2292,7 +2305,7 @@ LINK_SO = config_string('LINK_SO') || https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/lib/mkmf.rb#L2305 LIBPATHFLAG = config_string('LIBPATHFLAG') || ' -L"%s"' RPATHFLAG = config_string('RPATHFLAG') || '' LIBARG = config_string('LIBARG') || '-l%s' -MAIN_DOES_NOTHING = config_string('MAIN_DOES_NOTHING') || 'int main() {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_1_9_3/version.h =================================================================== --- ruby_1_9_3/version.h (revision 40714) +++ ruby_1_9_3/version.h (revision 40715) @@ -1,5 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/version.h#L1 #define RUBY_VERSION "1.9.3" -#define RUBY_PATCHLEVEL 418 +#define RUBY_PATCHLEVEL 419 #define RUBY_RELEASE_DATE "2013-05-14" #define RUBY_RELEASE_YEAR 2013 Property changes on: ruby_1_9_3 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r39958,39989 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/