Gentoo Archives: gentoo-commits

From: Matt Turner <mattst88@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-arch/lbzip2/files/, app-arch/lbzip2/
Date: Wed, 07 Aug 2019 19:13:57
Message-Id: 1565205222.cec154c3438eee983aa3eccbb2c9ebc072d781b0.mattst88@gentoo
1 commit: cec154c3438eee983aa3eccbb2c9ebc072d781b0
2 Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
3 AuthorDate: Wed Aug 7 19:02:07 2019 +0000
4 Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
5 CommitDate: Wed Aug 7 19:13:42 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cec154c3
7
8 app-arch/lbzip2: Add patch to fix unaligned access
9
10 Also remove unnecessary eautoreconf since Whissi was nice enough to run
11 make dist when he made the snapshot tarball.
12
13 Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>
14
15 .../files/lbzip2-2.5_p20181227-fix-unaligned.patch | 33 ++++++++++++++++++++++
16 ...81227.ebuild => lbzip2-2.5_p20181227-r1.ebuild} | 9 +-----
17 2 files changed, 34 insertions(+), 8 deletions(-)
18
19 diff --git a/app-arch/lbzip2/files/lbzip2-2.5_p20181227-fix-unaligned.patch b/app-arch/lbzip2/files/lbzip2-2.5_p20181227-fix-unaligned.patch
20 new file mode 100644
21 index 00000000000..c23d1afc4ca
22 --- /dev/null
23 +++ b/app-arch/lbzip2/files/lbzip2-2.5_p20181227-fix-unaligned.patch
24 @@ -0,0 +1,33 @@
25 +https://github.com/kjn/lbzip2/pull/25
26 +
27 +From d570020ade2add591b97e61927545a005a2d4a6f Mon Sep 17 00:00:00 2001
28 +From: Matt Turner <mattst88@×××××.com>
29 +Date: Wed, 7 Aug 2019 11:47:04 -0700
30 +Subject: [PATCH] Align zero-length array to avoid unaligned accesses
31 +
32 +When make_tree() creates the left-justified base table (uint64_t *B)
33 +it does so with 64-bit stores:
34 +
35 + B[k] = sofar;
36 +
37 +But B points to memory in the zero-length array "uint32_t tt[0]" at the
38 +end of struct decoder_state. Since tt's type is uint32_t, it is only
39 +aligned to a four byte boundary, and so the 64-bit store in make_tree()
40 +causes an unaligned trap on strict platforms like sparc.
41 +---
42 + src/decode.h | 2 +-
43 + 1 file changed, 1 insertion(+), 1 deletion(-)
44 +
45 +diff --git a/src/decode.h b/src/decode.h
46 +index c9a9086..7c0ca3f 100644
47 +--- a/src/decode.h
48 ++++ b/src/decode.h
49 +@@ -62,7 +62,7 @@ struct decoder_state {
50 + uint8_t rle_char; /* current character */
51 + uint8_t rle_prev; /* prevoius character */
52 +
53 +- uint32_t tt[0];
54 ++ uint32_t tt[0] __attribute__((aligned (8)));
55 + };
56 +
57 +
58
59 diff --git a/app-arch/lbzip2/lbzip2-2.5_p20181227.ebuild b/app-arch/lbzip2/lbzip2-2.5_p20181227-r1.ebuild
60 similarity index 92%
61 rename from app-arch/lbzip2/lbzip2-2.5_p20181227.ebuild
62 rename to app-arch/lbzip2/lbzip2-2.5_p20181227-r1.ebuild
63 index 04fa9267b15..7dc8fcd267f 100644
64 --- a/app-arch/lbzip2/lbzip2-2.5_p20181227.ebuild
65 +++ b/app-arch/lbzip2/lbzip2-2.5_p20181227-r1.ebuild
66 @@ -3,8 +3,6 @@
67
68 EAPI="7"
69
70 -inherit autotools
71 -
72 DESCRIPTION="Parallel bzip2 utility"
73 HOMEPAGE="https://github.com/kjn/lbzip2/"
74 SRC_URI="https://dev.gentoo.org/~whissi/dist/${PN}/${P}.tar.gz"
75 @@ -19,14 +17,9 @@ DEPEND=""
76
77 PATCHES=(
78 "${FILESDIR}"/${PN}-2.3-s_isreg.patch
79 + "${FILESDIR}"/${P}-fix-unaligned.patch
80 )
81
82 -src_prepare() {
83 - default
84 -
85 - eautoreconf
86 -}
87 -
88 src_configure() {
89 local myeconfargs=(
90 --disable-silent-rules