* [gentoo-commits] proj/ruby-scripts:master commit in: patchsets/patches-1.8.7_p357/
@ 2011-12-28 14:39 Hans de Graaff
0 siblings, 0 replies; only message in thread
From: Hans de Graaff @ 2011-12-28 14:39 UTC (permalink / raw
To: gentoo-commits
commit: b9d4084c9f71972fedca422c03856dcd0c846720
Author: Hans de Graaff <hans <AT> degraaff <DOT> org>
AuthorDate: Wed Dec 28 14:38:45 2011 +0000
Commit: Hans de Graaff <graaff <AT> gentoo <DOT> org>
CommitDate: Wed Dec 28 14:38:45 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/ruby-scripts.git;a=commit;h=b9d4084c
Add patches for ruby 1.8.7p357.
The mkconfig.rb patch has been applied upstream.
---
patchsets/patches-1.8.7_p357/001_memory_leak.patch | 59 ++++++++++++++++++++
.../003_mkmf-parallel-install.patch | 16 +++++
patchsets/patches-1.8.7_p357/004_berkdb-5.0.patch | 13 ++++
.../patches-1.8.7_p357/007_no-undefined-ext.patch | 13 ++++
patchsets/patches-1.8.7_p357/008_ppc64.patch | 42 ++++++++++++++
.../patches-1.8.7_p357/013_CVE-2011-0188.patch | 14 +++++
patchsets/patches-1.8.7_p357/series | 6 ++
7 files changed, 163 insertions(+), 0 deletions(-)
diff --git a/patchsets/patches-1.8.7_p357/001_memory_leak.patch b/patchsets/patches-1.8.7_p357/001_memory_leak.patch
new file mode 100644
index 0000000..98edae0
--- /dev/null
+++ b/patchsets/patches-1.8.7_p357/001_memory_leak.patch
@@ -0,0 +1,59 @@
+Index: ruby-1.8.7-p299/ext/dl/handle.c
+===================================================================
+--- ruby-1.8.7-p299.orig/ext/dl/handle.c
++++ ruby-1.8.7-p299/ext/dl/handle.c
+@@ -10,9 +10,12 @@ VALUE rb_cDLHandle;
+ void
+ dlhandle_free(struct dl_handle *dlhandle)
+ {
++ if (!dlhandle)
++ return;
+ if (dlhandle->ptr && dlhandle->open && dlhandle->enable_close) {
+ dlclose(dlhandle->ptr);
+ }
++ dlfree(dlhandle);
+ }
+
+ VALUE
+Index: ruby-1.8.7-p299/ext/dl/ptr.c
+===================================================================
+--- ruby-1.8.7-p299.orig/ext/dl/ptr.c
++++ ruby-1.8.7-p299/ext/dl/ptr.c
+@@ -45,6 +45,8 @@ rb_dlmem_aref(void *ptr)
+ void
+ dlptr_free(struct ptr_data *data)
+ {
++ if (!data)
++ return;
+ if (data->ptr) {
+ DEBUG_CODE({
+ printf("dlptr_free(): removing the pointer `0x%x' from the MemorySpace\n",
+@@ -61,6 +63,7 @@ dlptr_free(struct ptr_data *data)
+ if (data->stype) dlfree(data->stype);
+ if (data->ssize) dlfree(data->ssize);
+ if (data->ids) dlfree(data->ids);
++ dlfree(data);
+ }
+
+ void
+Index: ruby-1.8.7-p299/ext/dl/sym.c
+===================================================================
+--- ruby-1.8.7-p299.orig/ext/dl/sym.c
++++ ruby-1.8.7-p299/ext/dl/sym.c
+@@ -57,6 +57,8 @@ char2type(int ch)
+ void
+ dlsym_free(struct sym_data *data)
+ {
++ if(!data)
++ return;
+ if( data->name ){
+ DEBUG_CODE({
+ printf("dlsym_free(): free(data->name:%s)\n",data->name);
+@@ -69,6 +71,7 @@ dlsym_free(struct sym_data *data)
+ });
+ free(data->type);
+ }
++ dlfree(data);
+ }
+
+ VALUE
diff --git a/patchsets/patches-1.8.7_p357/003_mkmf-parallel-install.patch b/patchsets/patches-1.8.7_p357/003_mkmf-parallel-install.patch
new file mode 100644
index 0000000..9ecdc9b
--- /dev/null
+++ b/patchsets/patches-1.8.7_p357/003_mkmf-parallel-install.patch
@@ -0,0 +1,16 @@
+ Patch for bug 239101 by Matsuu Takuto, via Redmine issue 1337 (yes, really).
+ Backported for 1.8.* by Alex Legler.
+
+Index: ruby-1.8.7-p299/lib/mkmf.rb
+===================================================================
+--- ruby-1.8.7-p299.orig/lib/mkmf.rb
++++ ruby-1.8.7-p299/lib/mkmf.rb
+@@ -1523,7 +1523,7 @@ static: $(STATIC_LIB)#{$extout ? " inst
+ dest = "#{dir}/#{f}"
+ mfile.puts dir, "install-so: #{dest}"
+ unless $extout
+- mfile.print "#{dest}: #{f}\n"
++ mfile.print "#{dest}: #{dir} #{f}\n"
+ if (sep = config_string('BUILD_FILE_SEPARATOR'))
+ f.gsub!("/", sep)
+ dir.gsub!("/", sep)
diff --git a/patchsets/patches-1.8.7_p357/004_berkdb-5.0.patch b/patchsets/patches-1.8.7_p357/004_berkdb-5.0.patch
new file mode 100644
index 0000000..2516cd3
--- /dev/null
+++ b/patchsets/patches-1.8.7_p357/004_berkdb-5.0.patch
@@ -0,0 +1,13 @@
+Index: ruby-1.8.7-p299/ext/dbm/extconf.rb
+===================================================================
+--- ruby-1.8.7-p299.orig/ext/dbm/extconf.rb
++++ ruby-1.8.7-p299/ext/dbm/extconf.rb
+@@ -26,7 +26,7 @@ def headers.db_check(db)
+ case db
+ when /^db2?$/
+ db_prefix = "__db_n"
+- hsearch = "-DDB_DBM_HSEARCH "
++ hsearch = "-DDB_DBM_HSEARCH -DHAVE_DBM "
+ when "gdbm"
+ have_gdbm = true
+ when "gdbm_compat"
diff --git a/patchsets/patches-1.8.7_p357/007_no-undefined-ext.patch b/patchsets/patches-1.8.7_p357/007_no-undefined-ext.patch
new file mode 100644
index 0000000..41a7ddb
--- /dev/null
+++ b/patchsets/patches-1.8.7_p357/007_no-undefined-ext.patch
@@ -0,0 +1,13 @@
+Index: ruby-1.8.7-p299/configure.in
+===================================================================
+--- ruby-1.8.7-p299.orig/configure.in
++++ ruby-1.8.7-p299/configure.in
+@@ -1223,7 +1223,7 @@ if test "$with_dln_a_out" != yes; then
+ linux* | gnu* | k*bsd*-gnu | netbsd* | bsdi*)
+ : ${LDSHARED='${CC} -shared'}
+ if test "$rb_cv_binary_elf" = yes; then
+- LDFLAGS="$LDFLAGS -Wl,-export-dynamic"
++ LDFLAGS="$LDFLAGS -Wl,-export-dynamic -Wl,--no-undefined"
+ fi
+ rb_cv_dlopen=yes ;;
+ interix*) : ${LDSHARED="$CC -shared"}
diff --git a/patchsets/patches-1.8.7_p357/008_ppc64.patch b/patchsets/patches-1.8.7_p357/008_ppc64.patch
new file mode 100644
index 0000000..9a52cd7
--- /dev/null
+++ b/patchsets/patches-1.8.7_p357/008_ppc64.patch
@@ -0,0 +1,42 @@
+ diff --git a/eval.c b/eval.c
+ index a54fdce..e25ee24 100644
+ --- a/eval.c
+ +++ b/eval.c
+ @@ -188,6 +188,9 @@ int function_call_may_return_twice_false_2 = 0;
+ (function_call_may_return_twice_false_2 ? \
+ setjmp(function_call_may_return_twice_jmp_buf) : \
+ 0)
+ +# elif defined(__PPC64__)
+ +# define JUST_BEFORE_SETJMP(extra_save, j) ((void)0)
+ +# define JUST_AFTER_SETJMP(extra_save, j) ((j)->status ? (void)0 : (extra_save))
+ # elif defined(__FreeBSD__) && __FreeBSD__ < 7
+ /*
+ * workaround for FreeBSD/i386 getcontext/setcontext bug.
+ @@ -205,16 +208,23 @@ static int volatile freebsd_clear_carry_flag = 0;
+ # ifndef POST_GETCONTEXT
+ # define POST_GETCONTEXT 0
+ # endif
+ +# ifndef JUST_BEFORE_SETJMP
+ +# define JUST_BEFORE_SETJMP(extra_save, j) (extra_save)
+ +# endif
+ +# ifndef JUST_AFTER_SETJMP
+ +# define JUST_AFTER_SETJMP(extra_save, j) ((void)0)
+ +# endif
+ # define ruby_longjmp(env, val) rb_jump_context(env, val)
+ -# define ruby_setjmp(just_before_setjmp, j) ((j)->status = 0, \
+ - (just_before_setjmp), \
+ +# define ruby_setjmp(extra_save, j) ((j)->status = 0, \
+ + JUST_BEFORE_SETJMP(extra_save, j), \
+ PRE_GETCONTEXT, \
+ getcontext(&(j)->context), \
+ POST_GETCONTEXT, \
+ + JUST_AFTER_SETJMP(extra_save, j), \
+ (j)->status)
+ #else
+ -# define ruby_setjmp(just_before_setjmp, env) \
+ - ((just_before_setjmp), RUBY_SETJMP(env))
+ +# define ruby_setjmp(extra_save, env) \
+ + ((extra_save), RUBY_SETJMP(env))
+ # define ruby_longjmp(env,val) RUBY_LONGJMP(env,val)
+ # ifdef __CYGWIN__
+ # ifndef _setjmp
diff --git a/patchsets/patches-1.8.7_p357/013_CVE-2011-0188.patch b/patchsets/patches-1.8.7_p357/013_CVE-2011-0188.patch
new file mode 100644
index 0000000..9e29917
--- /dev/null
+++ b/patchsets/patches-1.8.7_p357/013_CVE-2011-0188.patch
@@ -0,0 +1,14 @@
+Patch backported from upstream revision 30993 by a3li@gentoo.org.
+
+diff -Naur ruby-1.8.7-p334.orig/ext/bigdecimal/bigdecimal.c ruby-1.8.7-p334/ext/bigdecimal/bigdecimal.c
+--- ruby-1.8.7-p334.orig/ext/bigdecimal/bigdecimal.c 2010-06-08 09:49:18.000000000 +0200
++++ ruby-1.8.7-p334/ext/bigdecimal/bigdecimal.c 2011-05-31 20:53:23.268999218 +0200
+@@ -2032,7 +2032,7 @@
+ VP_EXPORT void *
+ VpMemAlloc(U_LONG mb)
+ {
+- void *p = xmalloc((unsigned int)mb);
++ void *p = xmalloc(mb);
+ if(!p) {
+ VpException(VP_EXCEPTION_MEMORY,"failed to allocate memory",1);
+ }
diff --git a/patchsets/patches-1.8.7_p357/series b/patchsets/patches-1.8.7_p357/series
new file mode 100644
index 0000000..9634e25
--- /dev/null
+++ b/patchsets/patches-1.8.7_p357/series
@@ -0,0 +1,6 @@
+001_memory_leak.patch
+003_mkmf-parallel-install.patch
+004_berkdb-5.0.patch
+007_no-undefined-ext.patch
+008_ppc64.patch
+013_CVE-2011-0188.patch
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2011-12-28 14:39 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-28 14:39 [gentoo-commits] proj/ruby-scripts:master commit in: patchsets/patches-1.8.7_p357/ Hans de Graaff
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox