summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Graaff <hans@degraaff.org>2011-07-22 14:05:51 +0200
committerHans de Graaff <hans@degraaff.org>2011-07-22 14:05:51 +0200
commitfbfaa89e0ce6853e67c7e9766d79ae2cb1eb6015 (patch)
treeaa119f664ef0ffb6458fb6c6419f08d4125d6056 /patchsets
parentAdd patches for ruby-1.8.7_p334-r1 that were not committed. (diff)
downloadruby-scripts-fbfaa89e0ce6853e67c7e9766d79ae2cb1eb6015.tar.gz
ruby-scripts-fbfaa89e0ce6853e67c7e9766d79ae2cb1eb6015.tar.bz2
ruby-scripts-fbfaa89e0ce6853e67c7e9766d79ae2cb1eb6015.zip
Patches for ruby 1.8.7_p334-r2
New addition: ppc64 patch from http://redmine.ruby-lang.org/issues/show/4411 Gentoo bug: https://bugs.gentoo.org/show_bug.cgi?id=375075
Diffstat (limited to 'patchsets')
-rw-r--r--patchsets/patches-1.8.7_p334-r2/001_memory_leak.patch59
-rw-r--r--patchsets/patches-1.8.7_p334-r2/002_mkconfig.patch16
-rw-r--r--patchsets/patches-1.8.7_p334-r2/003_mkmf-parallel-install.patch16
-rw-r--r--patchsets/patches-1.8.7_p334-r2/004_berkdb-5.0.patch13
-rw-r--r--patchsets/patches-1.8.7_p334-r2/007_no-undefined-ext.patch13
-rw-r--r--patchsets/patches-1.8.7_p334-r2/008_ppc64.patch42
-rw-r--r--patchsets/patches-1.8.7_p334-r2/013_CVE-2011-0188.patch14
-rw-r--r--patchsets/patches-1.8.7_p334-r2/series7
8 files changed, 180 insertions, 0 deletions
diff --git a/patchsets/patches-1.8.7_p334-r2/001_memory_leak.patch b/patchsets/patches-1.8.7_p334-r2/001_memory_leak.patch
new file mode 100644
index 0000000..98edae0
--- /dev/null
+++ b/patchsets/patches-1.8.7_p334-r2/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_p334-r2/002_mkconfig.patch b/patchsets/patches-1.8.7_p334-r2/002_mkconfig.patch
new file mode 100644
index 0000000..52631e0
--- /dev/null
+++ b/patchsets/patches-1.8.7_p334-r2/002_mkconfig.patch
@@ -0,0 +1,16 @@
+Fix for mkconfig to be able to handle empty continued lines.
+Patch from [ruby-core:20420] via bug 234877.
+
+Index: ruby-1.8.7-p299/mkconfig.rb
+===================================================================
+--- ruby-1.8.7-p299.orig/mkconfig.rb
++++ ruby-1.8.7-p299/mkconfig.rb
+@@ -55,7 +55,7 @@ File.foreach "config.status" do |line|
+ continued_name = name
+ next
+ end
+- when /^"(.+)"\s*(\\)?$/
++ when /^"(.*)"\s*(\\)?$/
+ if continued_line
+ continued_line << $1
+ unless $2
diff --git a/patchsets/patches-1.8.7_p334-r2/003_mkmf-parallel-install.patch b/patchsets/patches-1.8.7_p334-r2/003_mkmf-parallel-install.patch
new file mode 100644
index 0000000..9ecdc9b
--- /dev/null
+++ b/patchsets/patches-1.8.7_p334-r2/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_p334-r2/004_berkdb-5.0.patch b/patchsets/patches-1.8.7_p334-r2/004_berkdb-5.0.patch
new file mode 100644
index 0000000..2516cd3
--- /dev/null
+++ b/patchsets/patches-1.8.7_p334-r2/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_p334-r2/007_no-undefined-ext.patch b/patchsets/patches-1.8.7_p334-r2/007_no-undefined-ext.patch
new file mode 100644
index 0000000..41a7ddb
--- /dev/null
+++ b/patchsets/patches-1.8.7_p334-r2/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_p334-r2/008_ppc64.patch b/patchsets/patches-1.8.7_p334-r2/008_ppc64.patch
new file mode 100644
index 0000000..9a52cd7
--- /dev/null
+++ b/patchsets/patches-1.8.7_p334-r2/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_p334-r2/013_CVE-2011-0188.patch b/patchsets/patches-1.8.7_p334-r2/013_CVE-2011-0188.patch
new file mode 100644
index 0000000..9e29917
--- /dev/null
+++ b/patchsets/patches-1.8.7_p334-r2/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_p334-r2/series b/patchsets/patches-1.8.7_p334-r2/series
new file mode 100644
index 0000000..d24ecbe
--- /dev/null
+++ b/patchsets/patches-1.8.7_p334-r2/series
@@ -0,0 +1,7 @@
+001_memory_leak.patch
+002_mkconfig.patch
+003_mkmf-parallel-install.patch
+004_berkdb-5.0.patch
+007_no-undefined-ext.patch
+008_ppc64.patch
+013_CVE-2011-0188.patch