Gentoo Archives: gentoo-commits

From: Ian Stakenvicius <axs@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/mozilla:master commit in: dev-libs/jemalloc/files/, dev-libs/jemalloc/
Date: Mon, 28 Mar 2016 14:58:01
Message-Id: 1459176981.a9a0530441182f298ed9091d09fe5987d60e8a7e.axs@gentoo
1 commit: a9a0530441182f298ed9091d09fe5987d60e8a7e
2 Author: Ian Stakenvicius <axs <AT> gentoo <DOT> org>
3 AuthorDate: Mon Mar 28 14:56:15 2016 +0000
4 Commit: Ian Stakenvicius <axs <AT> gentoo <DOT> org>
5 CommitDate: Mon Mar 28 14:56:21 2016 +0000
6 URL: https://gitweb.gentoo.org/proj/mozilla.git/commit/?id=a9a05304
7
8 version bump to jemalloc-4.1.0
9
10 Included upstream commit 33184bf69813087 as requested by rust dev's
11 to allow system jemalloc to be used with rust/llvm.
12
13 dev-libs/jemalloc/Manifest | 2 +-
14 .../files/jemalloc-4.1-fix_stack_corruption.patch | 70 ++++++++++++++++++++++
15 ...jemalloc-4.0.4.ebuild => jemalloc-4.1.0.ebuild} | 16 +++--
16 3 files changed, 78 insertions(+), 10 deletions(-)
17
18 diff --git a/dev-libs/jemalloc/Manifest b/dev-libs/jemalloc/Manifest
19 index 0d48e6d..e9bbcdc 100644
20 --- a/dev-libs/jemalloc/Manifest
21 +++ b/dev-libs/jemalloc/Manifest
22 @@ -1 +1 @@
23 -DIST jemalloc-4.0.4.tar.bz2 391483 SHA256 3fda8d8d7fcd041aa0bebbecd45c46b28873cf37bd36c56bf44961b36d0f42d0 SHA512 93be0551a80d5f5dc3a1044ef3d5f06c5ce65f3c1fd753743ee64340b841fc2d7902178774ab71eaa633f68abad44109870eb84159679fdc8ce6d93db3a53112 WHIRLPOOL c8bc1a81555b30ff519fda90bfbcfcdb6c9e370ba7478bca17058e58e08c36d20a1995ab12d5374d4edb9cdd2469748517a6f1795a24667c5f798c4c0c756a9c
24 +DIST jemalloc-4.1.0.tar.bz2 412900 SHA256 fad06d714f72adb4265783bc169c6d98eeb032d57ba02d87d1dcb4a2d933ec8e SHA512 12433101936a104115d8d93991b4849daf897bd39d6c28b1235215c7abc627163a70d19259fb1f2eeb0cdd66cfe889c2e40eb77dccee6debd73b1a4313d0de73 WHIRLPOOL 0305d1cc715c565749c5e9c2de396d349c0d79513da80b461324c82f880c6a070a932cea19802ac809810fe01690dcb24047914f937ddf167a990cf7b4110f0c
25
26 diff --git a/dev-libs/jemalloc/files/jemalloc-4.1-fix_stack_corruption.patch b/dev-libs/jemalloc/files/jemalloc-4.1-fix_stack_corruption.patch
27 new file mode 100644
28 index 0000000..f36c188
29 --- /dev/null
30 +++ b/dev-libs/jemalloc/files/jemalloc-4.1-fix_stack_corruption.patch
31 @@ -0,0 +1,70 @@
32 +From 33184bf69813087bf1885b0993685f9d03320c69 Mon Sep 17 00:00:00 2001
33 +From: Dmitri Smirnov <dmitrism@×××××××××.com>
34 +Date: Mon, 29 Feb 2016 14:30:19 -0800
35 +Subject: [PATCH] Fix stack corruption and uninitialized var warning
36 +
37 +Stack corruption happens in x64 bit
38 +
39 +This resolves #347.
40 +---
41 + src/arena.c | 2 +-
42 + test/unit/hash.c | 13 +++++++------
43 + 2 files changed, 8 insertions(+), 7 deletions(-)
44 +
45 +diff --git a/src/arena.c b/src/arena.c
46 +index 99e20fd..965c0fe 100644
47 +--- a/src/arena.c
48 ++++ b/src/arena.c
49 +@@ -2423,7 +2423,7 @@ arena_malloc_large(tsd_t *tsd, arena_t *arena, szind_t binind, bool zero)
50 + uintptr_t random_offset;
51 + arena_run_t *run;
52 + arena_chunk_map_misc_t *miscelm;
53 +- UNUSED bool idump;
54 ++ UNUSED bool idump JEMALLOC_CC_SILENCE_INIT(false);
55 +
56 + /* Large allocation. */
57 + usize = index2size(binind);
58 +diff --git a/test/unit/hash.c b/test/unit/hash.c
59 +index f50ba81..010c9d7 100644
60 +--- a/test/unit/hash.c
61 ++++ b/test/unit/hash.c
62 +@@ -64,14 +64,15 @@ static void
63 + hash_variant_verify_key(hash_variant_t variant, uint8_t *key)
64 + {
65 + const int hashbytes = hash_variant_bits(variant) / 8;
66 +- VARIABLE_ARRAY(uint8_t, hashes, hashbytes * 256);
67 ++ const int hashes_size = hashbytes * 256;
68 ++ VARIABLE_ARRAY(uint8_t, hashes, hashes_size);
69 + VARIABLE_ARRAY(uint8_t, final, hashbytes);
70 + unsigned i;
71 + uint32_t computed, expected;
72 +
73 + memset(key, 0, KEY_SIZE);
74 +- memset(hashes, 0, sizeof(hashes));
75 +- memset(final, 0, sizeof(final));
76 ++ memset(hashes, 0, hashes_size);
77 ++ memset(final, 0, hashbytes);
78 +
79 + /*
80 + * Hash keys of the form {0}, {0,1}, {0,1,2}, ..., {0,1,...,255} as the
81 +@@ -102,17 +103,17 @@ hash_variant_verify_key(hash_variant_t variant, uint8_t *key)
82 + /* Hash the result array. */
83 + switch (variant) {
84 + case hash_variant_x86_32: {
85 +- uint32_t out = hash_x86_32(hashes, hashbytes*256, 0);
86 ++ uint32_t out = hash_x86_32(hashes, hashes_size, 0);
87 + memcpy(final, &out, sizeof(out));
88 + break;
89 + } case hash_variant_x86_128: {
90 + uint64_t out[2];
91 +- hash_x86_128(hashes, hashbytes*256, 0, out);
92 ++ hash_x86_128(hashes, hashes_size, 0, out);
93 + memcpy(final, out, sizeof(out));
94 + break;
95 + } case hash_variant_x64_128: {
96 + uint64_t out[2];
97 +- hash_x64_128(hashes, hashbytes*256, 0, out);
98 ++ hash_x64_128(hashes, hashes_size, 0, out);
99 + memcpy(final, out, sizeof(out));
100 + break;
101 + } default: not_reached();
102
103 diff --git a/dev-libs/jemalloc/jemalloc-4.0.4.ebuild b/dev-libs/jemalloc/jemalloc-4.1.0.ebuild
104 similarity index 88%
105 rename from dev-libs/jemalloc/jemalloc-4.0.4.ebuild
106 rename to dev-libs/jemalloc/jemalloc-4.1.0.ebuild
107 index 5cbaa8d..28ecefb 100644
108 --- a/dev-libs/jemalloc/jemalloc-4.0.4.ebuild
109 +++ b/dev-libs/jemalloc/jemalloc-4.1.0.ebuild
110 @@ -2,9 +2,9 @@
111 # Distributed under the terms of the GNU General Public License v2
112 # $Id$
113
114 -EAPI=5
115 +EAPI=6
116
117 -inherit autotools-multilib eutils
118 +inherit autotools toolchain-funcs multilib-build
119
120 DESCRIPTION="Jemalloc is a general-purpose scalable concurrent allocator"
121 HOMEPAGE="http://www.canonware.com/jemalloc/"
122 @@ -17,18 +17,18 @@ IUSE="debug static-libs stats"
123 HTML_DOCS=( doc/jemalloc.html )
124 PATCHES=( "${FILESDIR}/${PN}-3.5.1-strip-optimization.patch"
125 "${FILESDIR}/${PN}-3.5.1_fix_html_install.patch"
126 + "${FILESDIR}/${PN}-4.1-fix_stack_corruption.patch"
127 )
128 MULTILIB_WRAPPED_HEADERS=( /usr/include/jemalloc/jemalloc.h )
129 # autotools-utils.eclass auto-adds configure options when static-libs is in IUSE
130 # but jemalloc doesn't implement them in its configure; need this here to
131 # supress the warnings until automagic is removed from the eclass
132 QA_CONFIGURE_OPTIONS="--enable-static --disable-static --enable-shared --disable-shared"
133 -src_configure() {
134 - myeconfargs=(
135 +
136 +multilib_src_configure() {
137 + ECONF_SOURCE="${S}" econf \
138 $(use_enable debug)
139 $(use_enable stats)
140 - )
141 - autotools-multilib_src_configure
142 }
143
144 multilib_src_install() {
145 @@ -37,9 +37,7 @@ multilib_src_install() {
146 emake DESTDIR="${D}" install
147 }
148
149 -src_install() {
150 - autotools-multilib_src_install
151 -
152 +multilib_src_install_all() {
153 if [[ ${CHOST} == *-darwin* ]] ; then
154 # fixup install_name, #437362
155 install_name_tool \