Hello community, here is the log from the commit of package ruby2.2 for openSUSE:Factory checked in at 2017-03-31 15:00:52 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ruby2.2 (Old) and /work/SRC/openSUSE:Factory/.ruby2.2.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "ruby2.2" Fri Mar 31 15:00:52 2017 rev:8 rq:481787 version:2.2.6 Changes: -------- --- /work/SRC/openSUSE:Factory/ruby2.2/ruby2.2.changes 2017-01-10 10:34:51.840268789 +0100 +++ /work/SRC/openSUSE:Factory/.ruby2.2.new/ruby2.2.changes 2017-03-31 15:00:54.545149069 +0200 @@ -1,0 +2,25 @@ +Tue Mar 21 12:40:39 UTC 2017 - mrueckert@suse.de + +- added patch by rguenther@ to fix building with GCC7: + 0005-RB_GC_GUARD-stronger-than-gcc7.patch + +------------------------------------------------------------------- +Thu Mar 16 15:53:48 UTC 2017 - mrueckert@suse.de + +- switched to git branch based patching. we replace all patches in + this round: + removed: + - 0001-GC-Use-__builtin_ppc_get_timebase-for-POWER-arch.patch + - make-gem-build-reproducible.patch + - ruby-1.9.2p290_tcl_no_stupid_rpaths.patch + + - ruby2.2.x_rbinstall_gem_buildroot.patch (unused) + - rubygems-1.5.0_buildroot.patch (unused) + added: + - 0001-tcl-no-stupid-rpaths.patch + - 0002-make-gem-build-reproducible.patch + - 0003-gc.c-tick-for-POWER-arch.patch +- added 0004-manual-backport-for-CVE-2016-2339.patch + CVE-2016-2339 (boo#1018808) + +------------------------------------------------------------------- Old: ---- 0001-GC-Use-__builtin_ppc_get_timebase-for-POWER-arch.patch make-gem-build-reproducible.patch ruby-1.9.2p290_tcl_no_stupid_rpaths.patch ruby2.2.x_rbinstall_gem_buildroot.patch rubygems-1.5.0_buildroot.patch New: ---- 0001-tcl-no-stupid-rpaths.patch 0002-make-gem-build-reproducible.patch 0003-gc.c-tick-for-POWER-arch.patch 0004-manual-backport-for-CVE-2016-2339.patch 0005-RB_GC_GUARD-stronger-than-gcc7.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ruby2.2.spec ++++++ --- /var/tmp/diff_new_pack.i8Kh2D/_old 2017-03-31 15:00:56.508871472 +0200 +++ /var/tmp/diff_new_pack.i8Kh2D/_new 2017-03-31 15:00:56.512870907 +0200 @@ -114,13 +114,11 @@ Source3: %{name}-default.macros Source99: %{name}-rpmlintrc -# to be regenerated patches? -Source100: rubygems-1.5.0_buildroot.patch -Source101: ruby2.2.x_rbinstall_gem_buildroot.patch - -Patch0: ruby-1.9.2p290_tcl_no_stupid_rpaths.patch -Patch1: make-gem-build-reproducible.patch -Patch2: 0001-GC-Use-__builtin_ppc_get_timebase-for-POWER-arch.patch +Patch01: 0001-tcl-no-stupid-rpaths.patch +Patch02: 0002-make-gem-build-reproducible.patch +Patch03: 0003-gc.c-tick-for-POWER-arch.patch +Patch04: 0004-manual-backport-for-CVE-2016-2339.patch +Patch05: 0005-RB_GC_GUARD-stronger-than-gcc7.patch # Summary: An Interpreted Object-Oriented Scripting Language License: BSD-2-Clause or Ruby @@ -297,9 +295,11 @@ %prep %setup -q -n ruby-%{pkg_version} -%patch0 -%patch1 -p1 -%patch2 -p1 +%patch01 -p1 +%patch02 -p1 +%patch03 -p1 +%patch04 -p1 +%patch05 -p1 find sample -type f -print0 | xargs -r0 chmod a-x grep -Erl '^#! */' benchmark bootstraptest ext lib sample test \ | xargs -r perl -p -i -e 's|^#!\s*\S+(\s+.*)?$|#!/usr/bin/ruby%{rb_binary_suffix} $1|' ++++++ 0001-tcl-no-stupid-rpaths.patch ++++++
From bdcc1e3113b2595e531d785c3fcb57898cc4843b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcus=20R=C3=BCckert?= <mrueckert@suse.de> Date: Wed, 8 Mar 2017 17:56:36 +0100 Subject: [PATCH 1/5] tcl no stupid rpaths
--- ext/tk/extconf.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ext/tk/extconf.rb b/ext/tk/extconf.rb index c6a2dd52ff..c29d8541fe 100644 --- a/ext/tk/extconf.rb +++ b/ext/tk/extconf.rb @@ -224,9 +224,7 @@ def get_shlib_path_head else [ - '/opt', '/pkg', '/share', - '/usr/local/opt', '/usr/local/pkg', '/usr/local/share', '/usr/local', - '/usr/opt', '/usr/pkg', '/usr/share', '/usr/contrib', '/usr' + '/usr' ].each{|dir| next unless File.directory?(dir) -- 2.12.0 ++++++ 0002-make-gem-build-reproducible.patch ++++++
From e955cdc91a10ee969e7400e4ebcb24c8b75b953e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcus=20R=C3=BCckert?= <mrueckert@suse.de> Date: Wed, 8 Mar 2017 17:56:58 +0100 Subject: [PATCH 2/5] make gem build reproducible
--- lib/rubygems/package.rb | 4 ++++ lib/rubygems/package/tar_writer.rb | 9 ++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/rubygems/package.rb b/lib/rubygems/package.rb index e8b8b38b06..b5a876c1be 100644 --- a/lib/rubygems/package.rb +++ b/lib/rubygems/package.rb @@ -108,9 +108,12 @@ class Gem::Package def self.build spec, skip_validation=false gem_file = spec.file_name + spec_file = spec.loaded_from + spec_file = "Gemfile" if spec_file.nil? || spec_file.empty? package = new gem_file package.spec = spec + package.build_time = File.stat(spec_file).mtime.to_i package.build skip_validation gem_file @@ -187,6 +190,7 @@ class Gem::Package digests = tar.add_file_signed 'data.tar.gz', 0444, @signer do |io| gzip_to io do |gz_io| Gem::Package::TarWriter.new gz_io do |data_tar| + data_tar.mtime = @build_time add_files data_tar end end diff --git a/lib/rubygems/package/tar_writer.rb b/lib/rubygems/package/tar_writer.rb index dfd635724b..3a49cf7f81 100644 --- a/lib/rubygems/package/tar_writer.rb +++ b/lib/rubygems/package/tar_writer.rb @@ -90,12 +90,15 @@ class Gem::Package::TarWriter nil end + attr_accessor :mtime + ## # Creates a new TarWriter that will write to +io+ def initialize(io) @io = io @closed = false + @mtime = Time.now end ## @@ -124,7 +127,7 @@ class Gem::Package::TarWriter header = Gem::Package::TarHeader.new :name => name, :mode => mode, :size => size, :prefix => prefix, - :mtime => Time.now + :mtime => mtime @io.write header @io.pos = final_pos @@ -217,7 +220,7 @@ class Gem::Package::TarWriter header = Gem::Package::TarHeader.new(:name => name, :mode => mode, :size => size, :prefix => prefix, - :mtime => Time.now).to_s + :mtime => mtime).to_s @io.write header os = BoundedStream.new @io, size @@ -279,7 +282,7 @@ class Gem::Package::TarWriter header = Gem::Package::TarHeader.new :name => name, :mode => mode, :typeflag => "5", :size => 0, :prefix => prefix, - :mtime => Time.now + :mtime => mtime @io.write header -- 2.12.0 ++++++ 0003-gc.c-tick-for-POWER-arch.patch ++++++
From dd01286860e6bcd9a6b7ac050a75605f832efc6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcus=20R=C3=BCckert?= <mrueckert@suse.de> Date: Wed, 8 Mar 2017 17:57:11 +0100 Subject: [PATCH 3/5] gc.c tick for POWER arch
--- gc.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gc.c b/gc.c index 51872f26dd..9037760ab8 100644 --- a/gc.c +++ b/gc.c @@ -871,6 +871,18 @@ tick(void) return ((unsigned long long)lo)|( ((unsigned long long)hi)<<32); } +#elif defined(__powerpc64__) && \ + ( __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)) +typedef unsigned long long tick_t; +#define PRItick "llu" + +static __inline__ tick_t +tick(void) +{ + unsigned long long val = __builtin_ppc_get_timebase(); + return val; +} + #elif defined(_WIN32) && defined(_MSC_VER) #include <intrin.h> typedef unsigned __int64 tick_t; -- 2.12.0 ++++++ 0004-manual-backport-for-CVE-2016-2339.patch ++++++
From 82c431b6285e279398bb744e07bf68d334ab8d88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcus=20R=C3=BCckert?= <mrueckert@suse.de> Date: Thu, 9 Mar 2017 17:05:41 +0100 Subject: [PATCH 4/5] manual backport for CVE-2016-2339
--- ext/fiddle/function.c | 49 +++++++++++++++++++++++++++++++++---------------- 1 file changed, 33 insertions(+), 16 deletions(-) diff --git a/ext/fiddle/function.c b/ext/fiddle/function.c index e0da8b69cb..5203fd5e9a 100644 --- a/ext/fiddle/function.c +++ b/ext/fiddle/function.c @@ -14,12 +14,16 @@ VALUE cFiddleFunction; #define MAX_ARGS (SIZE_MAX / (sizeof(void *) + sizeof(fiddle_generic)) - 1) #define Check_Max_Args(name, len) \ + Check_Max_Args_(name, len, "") +#define Check_Max_Args_Long(name, len) \ + Check_Max_Args_(name, len, "l") +#define Check_Max_Args_(name, len, fmt) \ if ((size_t)(len) < MAX_ARGS) { \ /* OK */ \ } \ else { \ rb_raise(rb_eTypeError, \ - name" is so large that it can cause integer overflow (%d)", \ + name" is so large that it can cause integer overflow (%"fmt"d)", \ (len)); \ } @@ -87,16 +91,34 @@ static VALUE initialize(int argc, VALUE argv[], VALUE self) { ffi_cif * cif; - ffi_type **arg_types; + ffi_type **arg_types, *rtype; ffi_status result; - VALUE ptr, args, ret_type, abi, kwds; - int i; + VALUE ptr, args, ret_type, abi, kwds, ary; + int i, len; + int nabi; + void *cfunc; rb_scan_args(argc, argv, "31:", &ptr, &args, &ret_type, &abi, &kwds); - if(NIL_P(abi)) abi = INT2NUM(FFI_DEFAULT_ABI); + ptr = rb_Integer(ptr); + cfunc = NUM2PTR(ptr); + PTR2NUM(cfunc); + nabi = NIL_P(abi) ? FFI_DEFAULT_ABI : NUM2INT(abi); + abi = INT2FIX(nabi); + i = NUM2INT(ret_type); + rtype = INT2FFI_TYPE(i); + ret_type = INT2FIX(i); Check_Type(args, T_ARRAY); - Check_Max_Args("args", RARRAY_LENINT(args)); + len = RARRAY_LENINT(args); + Check_Max_Args("args", len); + ary = rb_ary_subseq(args, 0, len); + for (i = 0; i < RARRAY_LEN(args); i++) { + VALUE a = RARRAY_PTR(args)[i]; + int type = NUM2INT(a); + (void)INT2FFI_TYPE(type); /* raise */ + if (INT2FIX(type) != a) rb_ary_store(ary, i, INT2FIX(type)); + } + OBJ_FREEZE(ary); rb_iv_set(self, "@ptr", ptr); rb_iv_set(self, "@args", args); @@ -107,20 +129,15 @@ initialize(int argc, VALUE argv[], VALUE self) TypedData_Get_Struct(self, ffi_cif, &function_data_type, cif); - arg_types = xcalloc(RARRAY_LEN(args) + 1, sizeof(ffi_type *)); + arg_types = xcalloc(len + 1, sizeof(ffi_type *)); for (i = 0; i < RARRAY_LEN(args); i++) { - int type = NUM2INT(RARRAY_PTR(args)[i]); + int type = NUM2INT(RARRAY_AREF(args, i)); arg_types[i] = INT2FFI_TYPE(type); } - arg_types[RARRAY_LEN(args)] = NULL; - - result = ffi_prep_cif ( - cif, - NUM2INT(abi), - RARRAY_LENINT(args), - INT2FFI_TYPE(NUM2INT(ret_type)), - arg_types); + arg_types[len] = NULL; + + result = ffi_prep_cif(cif, nabi, len, rtype, arg_types); if (result) rb_raise(rb_eRuntimeError, "error creating CIF %d", result); -- 2.12.0 ++++++ 0005-RB_GC_GUARD-stronger-than-gcc7.patch ++++++
From cb85d94f376a5d4fca33f7f7e2822dc30c1cfe66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcus=20R=C3=BCckert?= <mrueckert@suse.de> Date: Tue, 21 Mar 2017 13:33:40 +0100 Subject: [PATCH 5/5] RB_GC_GUARD stronger than gcc7
From 9eb54f7fb4672a4b0f39772be819965a4b7088f5 Mon Sep 17 00:00:00 2001 From: nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> Date: Mon, 13 Feb 2017 08:14:19 +0000 Subject: [PATCH] ruby.h: RB_GC_GUARD stronger than gcc7
* include/ruby/ruby.h (RB_GC_GUARD): prevent guarded pointer from optimization by using as an input to inline asm. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57619 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- include/ruby/ruby.h | 6 +++++- marshal.c | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) --- include/ruby/ruby.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index 6e430da179..84b6ff8d99 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -512,7 +512,7 @@ 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__("### RB_GC_GUARD" : : "m"(rb_gc_guarded_ptr)); rb_gc_guarded_ptr;}) #else #ifdef _MSC_VER #pragma optimize("", off) -- 2.12.0