-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
404 additions
and
157 deletions.
There are no files selected for viewing
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
12 changes: 12 additions & 0 deletions
12
config/patches/libxslt/libxslt-windows-relocate-1.1.30.patch
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- libxslt-1.1.30/libxslt/Makefile.in.orig 2017-10-25 14:23:01.000000000 +0100 | ||
+++ libxslt-1.1.30/libxslt/Makefile.in 2017-10-25 14:29:06.000000000 +0100 | ||
@@ -457,7 +457,8 @@ | ||
libxslt_la_LDFLAGS = \ | ||
$(WIN32_EXTRA_LDFLAGS) \ | ||
$(LIBXSLT_VERSION_SCRIPT) \ | ||
- -version-info $(LIBXSLT_VERSION_INFO) | ||
+ -version-info $(LIBXSLT_VERSION_INFO) \ | ||
+ -Wl,--image-base,0x6d780000 | ||
|
||
man_MANS = libxslt.3 | ||
EXTRA_DIST = $(man_MANS) trio.h triodef.h libxslt.syms |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
diff --git a/lib/uri/generic.rb b/lib/uri/generic.rb | ||
index dcad27bc3501..e885657d4674 100644 | ||
--- a/lib/uri/generic.rb | ||
+++ b/lib/uri/generic.rb | ||
@@ -1535,10 +1535,10 @@ def find_proxy(env=ENV) | ||
require 'ipaddr' | ||
return nil if | ||
begin | ||
- IPAddr.new(host) | ||
+ IPAddr.new(host).include?(self.host) | ||
rescue IPAddr::InvalidAddressError | ||
next | ||
- end.include?(self.host) | ||
+ end | ||
end | ||
end | ||
} | ||
diff --git a/test/uri/test_generic.rb b/test/uri/test_generic.rb | ||
index b226b2278b83..355b0bac177b 100644 | ||
--- a/test/uri/test_generic.rb | ||
+++ b/test/uri/test_generic.rb | ||
@@ -838,6 +838,7 @@ def test_find_proxy_get | ||
def test_find_proxy_no_proxy | ||
with_proxy_env('http_proxy'=>'http://127.0.0.1:8080', 'no_proxy'=>'192.0.2.2') {|env| | ||
assert_equal(URI('http://127.0.0.1:8080'), URI("http://192.0.2.1/").find_proxy(env)) | ||
+ assert_equal(URI('http://127.0.0.1:8080'), URI("http://example.org/").find_proxy(env)) | ||
assert_nil(URI("http://192.0.2.2/").find_proxy(env)) | ||
} | ||
with_proxy_env('http_proxy'=>'http://127.0.0.1:8080', 'no_proxy'=>'example.org') {|env| |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- template/prelude.c.tmpl.real 2018-01-25 12:12:58.636606731 +0000 | ||
+++ template/prelude.c.tmpl 2018-01-25 12:14:02.802380256 +0000 | ||
@@ -142,7 +142,7 @@ | ||
static void | ||
prelude_eval(VALUE code, VALUE name, int line) | ||
{ | ||
-#ifdef __GNUC__ | ||
+#if defined __GNUC__ && __GNUC__ >= 5 | ||
# pragma GCC diagnostic push | ||
# pragma GCC diagnostic error "-Wmissing-field-initializers" | ||
#endif | ||
@@ -159,7 +159,7 @@ | ||
FALSE, /* unsigned int coverage_enabled; */ | ||
0, /* int debug_level; */ | ||
}; | ||
-#ifdef __GNUC__ | ||
+#if defined __GNUC__ && __GNUC__ >= 5 | ||
# pragma GCC diagnostic pop | ||
#endif | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
diff --git include/ruby/ruby.h include/ruby/ruby.h | ||
index 60cfb1174e..dccfdc763a 100644 | ||
--- include/ruby/ruby.h | ||
+++ include/ruby/ruby.h | ||
@@ -551,27 +551,23 @@ static inline int rb_type(VALUE obj); | ||
((type) == RUBY_T_FLOAT) ? RB_FLOAT_TYPE_P(obj) : \ | ||
(!RB_SPECIAL_CONST_P(obj) && RB_BUILTIN_TYPE(obj) == (type))) | ||
|
||
-/* RB_GC_GUARD_PTR() is an intermediate macro, and has no effect by | ||
- * itself. don't use it directly */ | ||
#ifdef __GNUC__ | ||
-#define RB_GC_GUARD_PTR(ptr) \ | ||
- __extension__ ({volatile VALUE *rb_gc_guarded_ptr = (ptr); rb_gc_guarded_ptr;}) | ||
-#else | ||
-#ifdef _MSC_VER | ||
+#define RB_GC_GUARD(v) \ | ||
+ (*__extension__ ({ \ | ||
+ volatile VALUE *rb_gc_guarded_ptr = &(v); \ | ||
+ __asm__("" : : "m"(rb_gc_guarded_ptr)); \ | ||
+ rb_gc_guarded_ptr; \ | ||
+ })) | ||
+#elif defined _MSC_VER | ||
#pragma optimize("", off) | ||
static inline volatile VALUE *rb_gc_guarded_ptr(volatile VALUE *ptr) {return ptr;} | ||
#pragma optimize("", on) | ||
+#define RB_GC_GUARD(v) (*rb_gc_guarded_ptr(&(v))) | ||
#else | ||
volatile VALUE *rb_gc_guarded_ptr_val(volatile VALUE *ptr, VALUE val); | ||
#define HAVE_RB_GC_GUARDED_PTR_VAL 1 | ||
#define RB_GC_GUARD(v) (*rb_gc_guarded_ptr_val(&(v),(v))) | ||
#endif | ||
-#define RB_GC_GUARD_PTR(ptr) rb_gc_guarded_ptr(ptr) | ||
-#endif | ||
- | ||
-#ifndef RB_GC_GUARD | ||
-#define RB_GC_GUARD(v) (*RB_GC_GUARD_PTR(&(v))) | ||
-#endif | ||
|
||
#ifdef __GNUC__ | ||
#define RB_UNUSED_VAR(x) x __attribute__ ((unused)) | ||
diff --git marshal.c marshal.c | ||
index c56de4af8d..b7274bf3c4 100644 | ||
--- marshal.c | ||
+++ marshal.c | ||
@@ -1022,7 +1022,7 @@ VALUE | ||
rb_marshal_dump_limited(VALUE obj, VALUE port, int limit) | ||
{ | ||
struct dump_arg *arg; | ||
- VALUE wrapper; /* used to avoid memory leak in case of exception */ | ||
+ volatile VALUE wrapper; /* used to avoid memory leak in case of exception */ | ||
|
||
wrapper = TypedData_Make_Struct(rb_cData, struct dump_arg, &dump_arg_data, arg); | ||
arg->dest = 0; | ||
@@ -1051,8 +1051,8 @@ rb_marshal_dump_limited(VALUE obj, VALUE port, int limit) | ||
rb_io_write(arg->dest, arg->str); | ||
rb_str_resize(arg->str, 0); | ||
} | ||
- clear_dump_arg(arg); | ||
- RB_GC_GUARD(wrapper); | ||
+ free_dump_arg(arg); | ||
+ rb_gc_force_recycle(wrapper); | ||
|
||
return port; | ||
} | ||
@@ -2044,7 +2044,7 @@ rb_marshal_load_with_proc(VALUE port, VALUE proc) | ||
{ | ||
int major, minor, infection = 0; | ||
VALUE v; | ||
- VALUE wrapper; /* used to avoid memory leak in case of exception */ | ||
+ volatile VALUE wrapper; /* used to avoid memory leak in case of exception */ | ||
struct load_arg *arg; | ||
|
||
v = rb_check_string_type(port); | ||
@@ -2090,8 +2090,8 @@ rb_marshal_load_with_proc(VALUE port, VALUE proc) | ||
|
||
if (!NIL_P(proc)) arg->proc = proc; | ||
v = r_object(arg); | ||
- clear_load_arg(arg); | ||
- RB_GC_GUARD(wrapper); | ||
+ free_load_arg(arg); | ||
+ rb_gc_force_recycle(wrapper); | ||
|
||
return v; | ||
} | ||
diff --git test/ruby/test_marshal.rb test/ruby/test_marshal.rb | ||
index 6ac5c29991..dc2b8b30dc 100644 | ||
--- test/ruby/test_marshal.rb | ||
+++ test/ruby/test_marshal.rb | ||
@@ -645,6 +645,9 @@ def test_continuation | ||
c = Bug9523.new | ||
assert_raise_with_message(RuntimeError, /Marshal\.dump reentered at marshal_dump/) do | ||
Marshal.dump(c) | ||
+ GC.start | ||
+ 1000.times {"x"*1000} | ||
+ GC.start | ||
c.cc.call | ||
end | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
From fe28339fe58807d93fd78de0fdd6a41a298f8b91 Mon Sep 17 00:00:00 2001 | ||
From: Steven Danna <steve@chef.io> | ||
Date: Mon, 26 Jun 2017 15:20:38 +0100 | ||
Subject: [PATCH] Cast args of __builtin_expect to avoid GCC 4.1 warning | ||
|
||
GCC's -Wconversion will complain about RB_UNLIKELY and RB_LIKELY | ||
without this cast, causing some native gem compilations to | ||
fail. Notably, this was preventing nokogiri from building on EL-5. | ||
|
||
Signed-off-by: Steven Danna <steve@chef.io> | ||
--- | ||
include/ruby/defines.h | 4 ++-- | ||
1 file changed, 2 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/include/ruby/defines.h b/include/ruby/defines.h | ||
index a4da7ea014..70092a90cf 100644 | ||
--- a/include/ruby/defines.h | ||
+++ b/include/ruby/defines.h | ||
@@ -75,8 +75,8 @@ extern "C" { | ||
|
||
/* likely */ | ||
#if __GNUC__ >= 3 | ||
-#define RB_LIKELY(x) (__builtin_expect(!!(x), 1)) | ||
-#define RB_UNLIKELY(x) (__builtin_expect(!!(x), 0)) | ||
+#define RB_LIKELY(x) (__builtin_expect((long int)!!(x), 1L)) | ||
+#define RB_UNLIKELY(x) (__builtin_expect((long int)!!(x), 0L)) | ||
#else /* __GNUC__ >= 3 */ | ||
#define RB_LIKELY(x) (x) | ||
#define RB_UNLIKELY(x) (x) | ||
-- | ||
2.12.2 | ||
|
Oops, something went wrong.