From 205003b47c54e483ff2b8a9529df1bfbaa754ffc Mon Sep 17 00:00:00 2001 From: nagachika Date: Tue, 28 Oct 2014 13:20:54 +0000 Subject: [PATCH 1/9] * version.h (RUBY_VERSION): bump RUBY_VERSION to 2.1.5. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@48176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ version.h | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 19dbbd025e014c..ef539bb3cddfa2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +火 10 28 22:19:44 2014 CHIKANAGA Tomoyuki + + * version.h (RUBY_VERSION): bump RUBY_VERSION to 2.1.5. + Mon Oct 27 20:20:14 2014 NAKAMURA Usaku * lib/rexml/entity.rb: keep the entity size within the limitation. diff --git a/version.h b/version.h index 794e0d672c676d..8b932f7a8682d7 100644 --- a/version.h +++ b/version.h @@ -1,10 +1,10 @@ -#define RUBY_VERSION "2.1.4" -#define RUBY_RELEASE_DATE "2014-10-27" -#define RUBY_PATCHLEVEL 265 +#define RUBY_VERSION "2.1.5" +#define RUBY_RELEASE_DATE "2014-10-28" +#define RUBY_PATCHLEVEL 266 #define RUBY_RELEASE_YEAR 2014 #define RUBY_RELEASE_MONTH 10 -#define RUBY_RELEASE_DAY 27 +#define RUBY_RELEASE_DAY 28 #include "ruby/version.h" From 35168b8c3ea86448b6cd86bb51f8bbd522ca4bb4 Mon Sep 17 00:00:00 2001 From: nagachika Date: Tue, 28 Oct 2014 13:32:36 +0000 Subject: [PATCH 2/9] merge revision(s) r48174: [Backport #10438] * configure.in: remove apple-gcc4.2 from CC candidates. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@48177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ configure.in | 2 +- version.h | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index ef539bb3cddfa2..3489a0ef19e226 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Tue Oct 28 22:30:21 2014 NARUSE, Yui + + * configure.in: remove apple-gcc4.2 from CC candidates. + 火 10 28 22:19:44 2014 CHIKANAGA Tomoyuki * version.h (RUBY_VERSION): bump RUBY_VERSION to 2.1.5. diff --git a/configure.in b/configure.in index bb1ab8abd84a83..1f25bfbfa3802b 100644 --- a/configure.in +++ b/configure.in @@ -423,7 +423,7 @@ fi RUBY_NACL AS_CASE(["$host_os:$build_os"], [darwin*:darwin*], [ - AC_CHECK_TOOLS(CC, [gcc-4.2 clang gcc cc]) + AC_CHECK_TOOLS(CC, [clang gcc cc]) # Following Apple deployed clang are broken # clang version 1.0 (http://llvm.org/svn/llvm-project/cfe/tags/Apple/clang-23 exported) # Apple clang version 2.0 (tags/Apple/clang-137) (based on LLVM 2.9svn) diff --git a/version.h b/version.h index 8b932f7a8682d7..e23bb70e21ac68 100644 --- a/version.h +++ b/version.h @@ -1,6 +1,6 @@ #define RUBY_VERSION "2.1.5" #define RUBY_RELEASE_DATE "2014-10-28" -#define RUBY_PATCHLEVEL 266 +#define RUBY_PATCHLEVEL 267 #define RUBY_RELEASE_YEAR 2014 #define RUBY_RELEASE_MONTH 10 From ac3ac78ba1e103dd989dd1b4a75360616e611770 Mon Sep 17 00:00:00 2001 From: nagachika Date: Tue, 4 Nov 2014 15:09:38 +0000 Subject: [PATCH 3/9] merge revision(s) r48222: [Backport #10464] [Backport #10465] * bignum.c (bary_mul_balance_with_mulfunc): Fix free work area location. [ruby-dev:48723] [Bug #10464] [ruby-core:66044] [Bug #10465] Reported by Kohji Nishihama. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@48272 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 8 ++++++++ bignum.c | 2 +- version.h | 8 ++++---- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3489a0ef19e226..2182e2584841ad 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Wed Nov 5 00:01:04 2014 Tanaka Akira + + * bignum.c (bary_mul_balance_with_mulfunc): Fix free work area + location. + [ruby-dev:48723] [Bug #10464] + [ruby-core:66044] [Bug #10465] + Reported by Kohji Nishihama. + Tue Oct 28 22:30:21 2014 NARUSE, Yui * configure.in: remove apple-gcc4.2 from CC candidates. diff --git a/bignum.c b/bignum.c index b499c0b9730214..55ee4ce48e51ff 100644 --- a/bignum.c +++ b/bignum.c @@ -1650,7 +1650,7 @@ bary_mul_balance_with_mulfunc(BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t } tds = zds + n; MEMCPY(wds, zds + n, BDIGIT, xn); - mulfunc(tds, tn, xds, xn, yds + n, r, wds-xn, wn-xn); + mulfunc(tds, tn, xds, xn, yds + n, r, wds+xn, wn-xn); bary_add(zds + n, tn, zds + n, tn, wds, xn); diff --git a/version.h b/version.h index e23bb70e21ac68..8637c3331608c0 100644 --- a/version.h +++ b/version.h @@ -1,10 +1,10 @@ #define RUBY_VERSION "2.1.5" -#define RUBY_RELEASE_DATE "2014-10-28" -#define RUBY_PATCHLEVEL 267 +#define RUBY_RELEASE_DATE "2014-11-05" +#define RUBY_PATCHLEVEL 268 #define RUBY_RELEASE_YEAR 2014 -#define RUBY_RELEASE_MONTH 10 -#define RUBY_RELEASE_DAY 28 +#define RUBY_RELEASE_MONTH 11 +#define RUBY_RELEASE_DAY 5 #include "ruby/version.h" From 1d665c3e0f81fa822366f9ebba52f7b95e811be5 Mon Sep 17 00:00:00 2001 From: nagachika Date: Tue, 4 Nov 2014 15:15:04 +0000 Subject: [PATCH 4/9] merge revision(s) r46397: [Backport #10434] envutil.rb: avoid error on OS X 10.10 * test/ruby/envutil.rb (diagnostic_reports): Mac OS X 10.10 may not create plist file with crash file together. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@48273 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/envutil.rb | 2 +- version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/ruby/envutil.rb b/test/ruby/envutil.rb index fa130898d652fd..a6a9f70820051d 100644 --- a/test/ruby/envutil.rb +++ b/test/ruby/envutil.rb @@ -192,7 +192,7 @@ def self.diagnostic_reports(signame, cmd, pid, now) log = File.read(name) rescue next if /\AProcess:\s+#{cmd} \[#{pid}\]$/ =~ log File.unlink(name) - File.unlink("#{path}/.#{File.basename(name)}.plist") + File.unlink("#{path}/.#{File.basename(name)}.plist") rescue nil return log end end diff --git a/version.h b/version.h index 8637c3331608c0..df0266845d5f7d 100644 --- a/version.h +++ b/version.h @@ -1,6 +1,6 @@ #define RUBY_VERSION "2.1.5" #define RUBY_RELEASE_DATE "2014-11-05" -#define RUBY_PATCHLEVEL 268 +#define RUBY_PATCHLEVEL 269 #define RUBY_RELEASE_YEAR 2014 #define RUBY_RELEASE_MONTH 11 From 901dcecca3e2465cf91b390cdf1d6efb86688b59 Mon Sep 17 00:00:00 2001 From: nagachika Date: Tue, 4 Nov 2014 15:27:32 +0000 Subject: [PATCH 5/9] merge revision(s) r48184: [Backport #10272] [Backport #10438] * configure.in (__builtin_setjmp): disable with gcc/clang earlier than 4.3 on Mac OS X. [ruby-core:65174] [Bug #10272] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@48274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ configure.in | 5 +++++ version.h | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 2182e2584841ad..9b5d8d35b00a77 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Nov 5 00:18:22 2014 Nobuyoshi Nakada + + * configure.in (__builtin_setjmp): disable with gcc/clang earlier + than 4.3 on Mac OS X. [ruby-core:65174] [Bug #10272] + Wed Nov 5 00:01:04 2014 Tanaka Akira * bignum.c (bary_mul_balance_with_mulfunc): Fix free work area diff --git a/configure.in b/configure.in index 1f25bfbfa3802b..5968bbdb14a487 100644 --- a/configure.in +++ b/configure.in @@ -453,7 +453,9 @@ if test "$GCC" = yes; then linker_flag=-Wl, : ${optflags=-O3} gcc_major=`echo =__GNUC__ | $CC -E -xc - | sed '/^=/!d;s///'` + gcc_minor=`echo =__GNUC_MINOR__ | $CC -E -xc - | sed '/^=/!d;s///'` test -n "$gcc_major" || gcc_major=0 + test -n "$gcc_minor" || gcc_minor=0 # RUBY_APPEND_OPTIONS(XCFLAGS, ["-include ruby/config.h" "-include ruby/missing.h"]) else linker_flag= @@ -956,6 +958,9 @@ AS_CASE(["$target_os"], ac_cv_type_getgroups=gid_t # getgroups() on Rosetta fills garbage ac_cv_lib_crypt_crypt=no ac_cv_func_fdatasync=no # Mac OS X wrongly reports it has fdatasync() + if test $gcc_major -lt 4 -o \( $gcc_major -eq 4 -a $gcc_minor -lt 3 \); then + ac_cv_func___builtin_setjmp=no + fi AC_CACHE_CHECK(for broken crypt with 8bit chars, rb_cv_broken_crypt, [AC_TRY_RUN([ #include diff --git a/version.h b/version.h index df0266845d5f7d..7e0b9cc1c855f3 100644 --- a/version.h +++ b/version.h @@ -1,6 +1,6 @@ #define RUBY_VERSION "2.1.5" #define RUBY_RELEASE_DATE "2014-11-05" -#define RUBY_PATCHLEVEL 269 +#define RUBY_PATCHLEVEL 270 #define RUBY_RELEASE_YEAR 2014 #define RUBY_RELEASE_MONTH 11 From e5db49cb7c111feeb5542e3cd4a7fc181ac76124 Mon Sep 17 00:00:00 2001 From: nagachika Date: Thu, 6 Nov 2014 13:46:46 +0000 Subject: [PATCH 6/9] merge revision(s) 48288: [Backport #9681] * compile.c (compile_data_alloc): add padding when strict alignment is required for memory access. Currently, the padding is enabled only when the CPU is 32-bit SPARC and the compiler is GCC. [Bug #9681] [ruby-core:61715] * compile.c (STRICT_ALIGNMENT): defined if strict alignment is required * compile.c (ALIGNMENT_SIZE, ALIGNMENT_SIZE_MASK, PADDING_SIZE_MAX): new macros for alignemnt word size, bit mask, max size of padding. * compile.c (calc_padding): new function to calculate padding size. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@48302 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 14 ++++++++++++ compile.c | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- version.h | 6 ++--- 3 files changed, 80 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9b5d8d35b00a77..a5da0bea2930c7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +Thu Nov 6 22:36:55 2014 Naohisa Goto + + * compile.c (compile_data_alloc): add padding when strict alignment + is required for memory access. Currently, the padding is enabled + only when the CPU is 32-bit SPARC and the compiler is GCC. + [Bug #9681] [ruby-core:61715] + + * compile.c (STRICT_ALIGNMENT): defined if strict alignment is required + + * compile.c (ALIGNMENT_SIZE, ALIGNMENT_SIZE_MASK, PADDING_SIZE_MAX): + new macros for alignemnt word size, bit mask, max size of padding. + + * compile.c (calc_padding): new function to calculate padding size. + Wed Nov 5 00:18:22 2014 Nobuyoshi Nakada * configure.in (__builtin_setjmp): disable with gcc/clang earlier diff --git a/compile.c b/compile.c index a76c93be73f409..099c280f75d0c1 100644 --- a/compile.c +++ b/compile.c @@ -583,18 +583,72 @@ rb_iseq_translate_threaded_code(rb_iseq_t *iseq) /* definition of data structure for compiler */ /*********************************************/ +/* + * On 32-bit SPARC, GCC by default generates SPARC V7 code that may require + * 8-byte word alignment. On the other hand, Oracle Solaris Studio seems to + * generate SPARCV8PLUS code with unaligned memory accesss instructions. + * That is why the STRICT_ALIGNMENT is defined only with GCC. + */ +#if defined(__sparc) && SIZEOF_VOIDP == 4 && defined(__GNUC__) + #define STRICT_ALIGNMENT +#endif + +#ifdef STRICT_ALIGNMENT + #if defined(HAVE_TRUE_LONG_LONG) && SIZEOF_LONG_LONG > SIZEOF_VALUE + #define ALIGNMENT_SIZE SIZEOF_LONG_LONG + #else + #define ALIGNMENT_SIZE SIZEOF_VALUE + #endif + #define PADDING_SIZE_MAX ((size_t)((ALIGNMENT_SIZE) - 1)) + #define ALIGNMENT_SIZE_MASK PADDING_SIZE_MAX + /* Note: ALIGNMENT_SIZE == (2 ** N) is expected. */ +#else + #define PADDING_SIZE_MAX 0 +#endif /* STRICT_ALIGNMENT */ + +#ifdef STRICT_ALIGNMENT +/* calculate padding size for aligned memory access */ +static size_t +calc_padding(void *ptr, size_t size) +{ + size_t mis; + size_t padding = 0; + + mis = (size_t)ptr & ALIGNMENT_SIZE_MASK; + if (mis > 0) { + padding = ALIGNMENT_SIZE - mis; + } +/* + * On 32-bit sparc or equivalents, when a single VALUE is requested + * and padding == sizeof(VALUE), it is clear that no padding is needed. + */ +#if ALIGNMENT_SIZE > SIZEOF_VALUE + if (size == sizeof(VALUE) && padding == sizeof(VALUE)) { + padding = 0; + } +#endif + + return padding; +} +#endif /* STRICT_ALIGNMENT */ + static void * compile_data_alloc(rb_iseq_t *iseq, size_t size) { void *ptr = 0; struct iseq_compile_data_storage *storage = iseq->compile_data->storage_current; +#ifdef STRICT_ALIGNMENT + size_t padding = calc_padding((void *)&storage->buff[storage->pos], size); +#else + const size_t padding = 0; /* expected to be optimized by compiler */ +#endif /* STRICT_ALIGNMENT */ - if (storage->pos + size > storage->size) { + if (storage->pos + size + padding > storage->size) { unsigned long alloc_size = storage->size * 2; retry: - if (alloc_size < size) { + if (alloc_size < size + PADDING_SIZE_MAX) { alloc_size *= 2; goto retry; } @@ -606,8 +660,15 @@ compile_data_alloc(rb_iseq_t *iseq, size_t size) storage->pos = 0; storage->size = alloc_size; storage->buff = (char *)(&storage->buff + 1); +#ifdef STRICT_ALIGNMENT + padding = calc_padding((void *)&storage->buff[storage->pos], size); +#endif /* STRICT_ALIGNMENT */ } +#ifdef STRICT_ALIGNMENT + storage->pos += (int)padding; +#endif /* STRICT_ALIGNMENT */ + ptr = (void *)&storage->buff[storage->pos]; storage->pos += size; return ptr; diff --git a/version.h b/version.h index 7e0b9cc1c855f3..a5249a75d99073 100644 --- a/version.h +++ b/version.h @@ -1,10 +1,10 @@ #define RUBY_VERSION "2.1.5" -#define RUBY_RELEASE_DATE "2014-11-05" -#define RUBY_PATCHLEVEL 270 +#define RUBY_RELEASE_DATE "2014-11-06" +#define RUBY_PATCHLEVEL 271 #define RUBY_RELEASE_YEAR 2014 #define RUBY_RELEASE_MONTH 11 -#define RUBY_RELEASE_DAY 5 +#define RUBY_RELEASE_DAY 6 #include "ruby/version.h" From d4239a936874ee459491b562eddbeee661c20fe3 Mon Sep 17 00:00:00 2001 From: nagachika Date: Thu, 6 Nov 2014 14:19:59 +0000 Subject: [PATCH 7/9] merge revision(s) r47860: [Backport #10350] * bignum.c (absint_numwords_generic): set an array element after definition of a variable to fix compile error with older version of fcc (Fujitsu C Compiler) 5.6 on Solaris 10 on Sparc. [Bug #10350] [ruby-dev:48608] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@48303 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 7 +++++++ bignum.c | 4 +++- version.h | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index a5da0bea2930c7..c93aafe75bbd3d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Thu Nov 6 22:57:43 2014 Naohisa Goto + + * bignum.c (absint_numwords_generic): set an array element after + definition of a variable to fix compile error with older version + of fcc (Fujitsu C Compiler) 5.6 on Solaris 10 on Sparc. + [Bug #10350] [ruby-dev:48608] + Thu Nov 6 22:36:55 2014 Naohisa Goto * compile.c (compile_data_alloc): add padding when strict alignment diff --git a/bignum.c b/bignum.c index 55ee4ce48e51ff..27d8d8a6a766e0 100644 --- a/bignum.c +++ b/bignum.c @@ -3294,7 +3294,7 @@ absint_numwords_generic(size_t numbytes, int nlz_bits_in_msbyte, size_t word_num static const BDIGIT char_bit[1] = { CHAR_BIT }; BDIGIT numbytes_bary[bdigit_roomof(sizeof(numbytes))]; BDIGIT val_numbits_bary[bdigit_roomof(sizeof(numbytes) + 1)]; - BDIGIT nlz_bits_in_msbyte_bary[1] = { nlz_bits_in_msbyte }; + BDIGIT nlz_bits_in_msbyte_bary[1]; BDIGIT word_numbits_bary[bdigit_roomof(sizeof(word_numbits))]; BDIGIT div_bary[numberof(val_numbits_bary) + BIGDIVREM_EXTRA_WORDS]; BDIGIT mod_bary[numberof(word_numbits_bary)]; @@ -3304,6 +3304,8 @@ absint_numwords_generic(size_t numbytes, int nlz_bits_in_msbyte, size_t word_num int sign; size_t numwords; + nlz_bits_in_msbyte_bary[0] = nlz_bits_in_msbyte; + /* * val_numbits = numbytes * CHAR_BIT - nlz_bits_in_msbyte * div, mod = val_numbits.divmod(word_numbits) diff --git a/version.h b/version.h index a5249a75d99073..5fd1f5dc9fb26f 100644 --- a/version.h +++ b/version.h @@ -1,6 +1,6 @@ #define RUBY_VERSION "2.1.5" #define RUBY_RELEASE_DATE "2014-11-06" -#define RUBY_PATCHLEVEL 271 +#define RUBY_PATCHLEVEL 272 #define RUBY_RELEASE_YEAR 2014 #define RUBY_RELEASE_MONTH 11 From eac759b97638fccd6ac693d0129f02a48c0e5555 Mon Sep 17 00:00:00 2001 From: nagachika Date: Thu, 13 Nov 2014 13:36:20 +0000 Subject: [PATCH 8/9] merge revision(s) r48402: * lib/rexml/document.rb: add REXML::Document#document. reported by Tomas Hoger and patched by nahi. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@48404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 ++++ lib/rexml/document.rb | 4 +++ lib/rexml/entity.rb | 1 + test/rexml/test_document.rb | 53 ++++++++++++++++++++++++++++++++++++- version.h | 6 ++--- 5 files changed, 65 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index c93aafe75bbd3d..fe76d3d1fb1a83 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Nov 13 22:32:34 2014 CHIKANAGA Tomoyuki + + * lib/rexml/document.rb: add REXML::Document#document. + reported by Tomas Hoger and patched by nahi. + Thu Nov 6 22:57:43 2014 Naohisa Goto * bignum.c (absint_numwords_generic): set an array element after diff --git a/lib/rexml/document.rb b/lib/rexml/document.rb index 1e18263ddaa677..f92eb62d95ff7c 100644 --- a/lib/rexml/document.rb +++ b/lib/rexml/document.rb @@ -278,6 +278,10 @@ def record_entity_expansion end end + def document + self + end + private def build( source ) Parsers::TreeParser.new( source, self ).parse diff --git a/lib/rexml/entity.rb b/lib/rexml/entity.rb index f447202394db2d..3a35ec6b9477a6 100644 --- a/lib/rexml/entity.rb +++ b/lib/rexml/entity.rb @@ -157,6 +157,7 @@ def value # This is a set of entity constants -- the ones defined in the XML # specification. These are +gt+, +lt+, +amp+, +quot+ and +apos+. + # CAUTION: these entities does not have parent and document module EntityConst # +>+ GT = Entity.new( 'gt', '>' ) diff --git a/test/rexml/test_document.rb b/test/rexml/test_document.rb index efdcf66b82eda2..c5ac057e14e547 100644 --- a/test/rexml/test_document.rb +++ b/test/rexml/test_document.rb @@ -47,7 +47,23 @@ def test_new EOF - XML_WITH_NESTED_PARAMETER_ENTITY = < + + + + + + + +]> + +&a; + +EOF + + XML_WITH_NESTED_PARAMETER_ENTITY = < @@ -59,6 +75,20 @@ def test_new ]> +EOF + + XML_WITH_NESTED_EMPTY_PARAMETER_ENTITY = < + + + + + + + +]> + EOF XML_WITH_4_ENTITY_EXPANSION = < Date: Thu, 13 Nov 2014 13:36:50 +0000 Subject: [PATCH 9/9] add tag v2_1_5 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v2_1_5@48405 b2dd03c8-39d4-4d8f-98ff-823fe69b080e