Created
September 10, 2012 15:10
-
-
Save shirosaki/3691394 to your computer and use it in GitHub Desktop.
Patch for rubenvb-4.7.1-2-release r33830 r33989 r35485 r36247 r36508 r36522 r36544
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/configure.in b/configure.in | |
index be818d4..bd6cf62 100644 | |
--- a/configure.in | |
+++ b/configure.in | |
@@ -479,7 +479,7 @@ if test "$GCC:${warnflags+set}:no" = yes::no; then | |
]) | |
]) | |
done | |
- AS_CASE([" $warnflags "],[*" -Wno-missing-field-initializers "*], [wflag=-Wextra], | |
+ AS_CASE([" $warnflags "],[*" -Wno-missing-field-initializers "*], [wflag="-Wall -Wextra"], | |
[wflag=-Wall]) | |
RUBY_TRY_CFLAGS($wflag, [warnflags="$wflag${warnflags+ $warnflags}"]) | |
# Disable warnflags while conftest. -Werror=* flags might make bad OS capability guess. | |
diff --git a/ext/dl/cfunc.c b/ext/dl/cfunc.c | |
index 61a3aae..8edf102 100644 | |
--- a/ext/dl/cfunc.c | |
+++ b/ext/dl/cfunc.c | |
@@ -366,7 +366,11 @@ rb_dlcfunc_call(VALUE self, VALUE ary) | |
stack[i] = (DLSTACK_TYPE)FIX2LONG(arg); | |
} | |
else if (RB_TYPE_P(arg, T_BIGNUM)) { | |
+#if SIZEOF_VOIDP == SIZEOF_LONG | |
stack[i] = (DLSTACK_TYPE)rb_big2ulong_pack(arg); | |
+#else | |
+ stack[i] = (DLSTACK_TYPE)rb_big2ull(arg); | |
+#endif | |
} | |
else { | |
Check_Type(arg, T_FIXNUM); | |
diff --git a/include/ruby/win32.h b/include/ruby/win32.h | |
index 2badbbc..99382f4 100644 | |
--- a/include/ruby/win32.h | |
+++ b/include/ruby/win32.h | |
@@ -126,6 +126,7 @@ extern DWORD rb_w32_osid(void); | |
#undef fputchar | |
#undef utime | |
#undef lseek | |
+#undef stat | |
#undef fstat | |
#define getc(_stream) rb_w32_getc(_stream) | |
#define getchar() rb_w32_getc(stdin) | |
@@ -755,4 +756,18 @@ uintptr_t rb_w32_asynchronize(asynchronous_func_t func, uintptr_t self, int argc | |
} /* extern "C" { */ | |
#endif | |
+#ifdef __MINGW64__ | |
+/* | |
+ * Use powl() instead of broken pow() of x86_64-w64-mingw32. | |
+ * This workaround will fix test failures in test_bignum.rb, | |
+ * test_fixnum.rb and test_float.rb etc. | |
+ */ | |
+static inline double | |
+rb_w32_pow(double x, double y) | |
+{ | |
+ return powl(x, y); | |
+} | |
+#define pow rb_w32_pow | |
+#endif | |
+ | |
#endif /* RUBY_WIN32_H */ | |
diff --git a/lib/test/unit/parallel.rb b/lib/test/unit/parallel.rb | |
index 7a7c73d..bb95a54 100644 | |
--- a/lib/test/unit/parallel.rb | |
+++ b/lib/test/unit/parallel.rb | |
@@ -152,6 +152,10 @@ if $0 == __FILE__ | |
end | |
end | |
end | |
+ require 'rubygems' | |
+ class Gem::TestCase < MiniTest::Unit::TestCase | |
+ @@project_dir = File.expand_path('../../../..', __FILE__) | |
+ end | |
Test::Unit::Worker.new.run(ARGV) | |
end | |
diff --git a/test/win32ole/test_win32ole_method.rb b/test/win32ole/test_win32ole_method.rb | |
index e4f38ea..2c24004 100644 | |
--- a/test/win32ole/test_win32ole_method.rb | |
+++ b/test/win32ole/test_win32ole_method.rb | |
@@ -109,7 +109,7 @@ if defined?(WIN32OLE_METHOD) | |
end | |
def is_ruby64? | |
- /mswin64|mingw64/ =~ RUBY_PLATFORM | |
+ /mswin64|x64-mingw/ =~ RUBY_PLATFORM | |
end | |
def test_offset_vtbl | |
diff --git a/win32/mkexports.rb b/win32/mkexports.rb | |
index 9b45051..22c0019 100755 | |
--- a/win32/mkexports.rb | |
+++ b/win32/mkexports.rb | |
@@ -112,7 +112,7 @@ class Exports::Mswin < Exports | |
is_data = !$1 | |
if noprefix or /^[@_]/ =~ l | |
next if /(?!^)@.*@/ =~ l || /@[[:xdigit:]]{8,16}$/ =~ l || | |
- /^_(?:Init_|.*_threadptr_|DllMain@)/ =~ l | |
+ /^_?(?:Init_|.*_threadptr_|DllMain\b)/ =~ l | |
l.sub!(/^[@_]/, '') if /@\d+$/ !~ l | |
elsif !l.sub!(/^(\S+) \([^@?\`\']*\)$/, '\1') | |
next | |
@@ -146,7 +146,7 @@ class Exports::Cygwin < Exports | |
def each_export(objs) | |
symprefix = RbConfig::CONFIG["SYMBOL_PREFIX"] | |
symprefix.strip! if symprefix | |
- re = /\s(?:(T)|[[:upper:]])\s#{symprefix}((?!Init_|.*_threadptr_|DllMain@).*)$/ | |
+ re = /\s(?:(T)|[[:upper:]])\s#{symprefix}((?!Init_|.*_threadptr_|DllMain\b).*)$/ | |
objdump(objs) do |l| | |
next if /@.*@/ =~ l | |
yield $2, !$1 if re =~ l |
Thanks @shirosaki, what about make test
itself? Does this solves the threading error?
http://ci.rubyinstaller.org/job/ruby-1_9_3-x64-build/lastFailedBuild/console
make test
also passed. The error was solved.
I think encoding related test failures still exist, though I didn't see these failures with my environment.
These were solved at trunk, but seems not backported.
http://ci.rubyinstaller.org/job/ruby-1_9_3-x86-test-all/8/console
I noticed r33830 would be needed to solve #6407. r33978 was already backported to 1.9.3.
http://bugs.ruby-lang.org/issues/6407
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?revision=33830&view=revision
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ruby 1.9.3p269 (2012-09-09 revision 36939) [x64-mingw32]
10301 tests, 1909277 assertions, 1 failures, 0 errors, 92 skips
make: *** [yes-test-all] Error 1