diff options
author | Jonne Haß | 2017-06-04 14:44:50 +0200 |
---|---|---|
committer | Jonne Haß | 2017-06-04 14:44:50 +0200 |
commit | 430327db2253390f9d722d34d4cfd1db20791cdb (patch) | |
tree | eaaabc5aa457ac0a2bd64d9ba879d2aa7ce5f350 | |
parent | e67dc71721c6201b0f6cdbe651822f0f9356fd60 (diff) | |
download | aur-430327db2253390f9d722d34d4cfd1db20791cdb.tar.gz |
ruby2.2: fix build against GCC 7
-rw-r--r-- | .SRCINFO | 4 | ||||
-rw-r--r-- | PKGBUILD | 12 | ||||
-rw-r--r-- | gcc7.patch | 52 |
3 files changed, 64 insertions, 4 deletions
@@ -1,7 +1,7 @@ pkgbase = ruby2.2 pkgdesc = An object-oriented language for quick and easy programming pkgver = 2.2.7 - pkgrel = 2 + pkgrel = 3 url = http://www.ruby-lang.org/en/ arch = i686 arch = x86_64 @@ -24,7 +24,9 @@ pkgbase = ruby2.2 optdepends = tk: for Ruby/TK options = !emptydirs source = https://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.7.tar.xz + source = gcc7.patch sha256sums = 234c8aee6543da9efd67008e6e7ee740d41ed57a52e797f65043c3b5ec3bcb53 + sha256sums = 9647f5c9755358d2997a14c6fce17bd3ee898dc1ad22b5f93dcf51d9d630ad1f pkgname = ruby2.2 @@ -7,7 +7,7 @@ pkgname=ruby2.2 pkgver=2.2.7 pkgdesc='An object-oriented language for quick and easy programming' -pkgrel=2 +pkgrel=3 arch=(i686 x86_64) url='http://www.ruby-lang.org/en/' license=(BSD custom) @@ -15,7 +15,12 @@ depends=(gdbm openssl-1.0 libffi libyaml gmp zlib) optdepends=('tk: for Ruby/TK') makedepends=(gdbm openssl libffi doxygen graphviz libyaml ttf-dejavu tk) options=(!emptydirs) -source=(https://cache.ruby-lang.org/pub/ruby/${pkgver:0:3}/ruby-${pkgver}.tar.xz) +source=(https://cache.ruby-lang.org/pub/ruby/${pkgver:0:3}/ruby-${pkgver}.tar.xz gcc7.patch) + +prepare() { + cd ruby-${pkgver} + patch -p1 < ../gcc7.patch +} build() { cd ruby-${pkgver} @@ -59,4 +64,5 @@ package() { install -D -m644 COPYING "${pkgdir}/usr/share/licenses/$pkgname/LICENSE" install -D -m644 BSDL "${pkgdir}/usr/share/licenses/$pkgname/BSDL" } -sha256sums=('234c8aee6543da9efd67008e6e7ee740d41ed57a52e797f65043c3b5ec3bcb53') +sha256sums=('234c8aee6543da9efd67008e6e7ee740d41ed57a52e797f65043c3b5ec3bcb53' + '9647f5c9755358d2997a14c6fce17bd3ee898dc1ad22b5f93dcf51d9d630ad1f') diff --git a/gcc7.patch b/gcc7.patch new file mode 100644 index 000000000000..caa44ae4f106 --- /dev/null +++ b/gcc7.patch @@ -0,0 +1,52 @@ +diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h +index 6e430da179..bcc407045b 100644 +--- a/include/ruby/ruby.h ++++ b/include/ruby/ruby.h +@@ -512,7 +512,10 @@ static inline int rb_type(VALUE obj); + * 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;}) ++ __extension__ ({volatile VALUE *rb_gc_guarded_ptr = (ptr); \ ++ __asm__("" : : "m"(rb_gc_guarded_ptr)); \ ++ rb_gc_guarded_ptr; \ ++ }) + #else + #ifdef _MSC_VER + #pragma optimize("", off) +diff --git a/marshal.c b/marshal.c +index d322e3a5ba..a21d5f8ef2 100644 +--- a/marshal.c ++++ b/marshal.c +@@ -1014,7 +1014,7 @@ marshal_dump(int argc, VALUE *argv) + else if (NIL_P(a1)) io_needed(); + else port = a1; + } +- wrapper = TypedData_Make_Struct(rb_cData, struct dump_arg, &dump_arg_data, arg); ++ wrapper = TypedData_Make_Struct(0, struct dump_arg, &dump_arg_data, arg); + arg->dest = 0; + arg->symbols = st_init_numtable(); + arg->data = rb_init_identtable(); +@@ -2038,7 +2038,7 @@ marshal_load(int argc, VALUE *argv) + else { + io_needed(); + } +- wrapper = TypedData_Make_Struct(rb_cData, struct load_arg, &load_arg_data, arg); ++ wrapper = TypedData_Make_Struct(0, struct load_arg, &load_arg_data, arg); + arg->infection = infection; + arg->src = port; + arg->offset = 0; +diff --git a/test/ruby/test_marshal.rb b/test/ruby/test_marshal.rb +index 1dc9850d25..e89dd31d22 100644 +--- a/test/ruby/test_marshal.rb ++++ b/test/ruby/test_marshal.rb +@@ -644,6 +644,9 @@ class TestMarshal < Test::Unit::TestCase + 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 |