diff options
Diffstat (limited to 'app-arch/pixz')
-rw-r--r-- | app-arch/pixz/Manifest | 3 | ||||
-rw-r--r-- | app-arch/pixz/files/pixz-1.0.6-avoid-unaligned-accesses.patch | 44 | ||||
-rw-r--r-- | app-arch/pixz/pixz-1.0.6-r1.ebuild (renamed from app-arch/pixz/pixz-1.0.6.ebuild) | 6 |
3 files changed, 51 insertions, 2 deletions
diff --git a/app-arch/pixz/Manifest b/app-arch/pixz/Manifest index 1dd724d6bd25..4324e1a8f4d2 100644 --- a/app-arch/pixz/Manifest +++ b/app-arch/pixz/Manifest @@ -1,4 +1,5 @@ +AUX pixz-1.0.6-avoid-unaligned-accesses.patch 1253 BLAKE2B e852f1c991bc7ba282b47516598d09a41182f01ceade67276dcfb192767c1bf33a36cf992d5de201bddc24790896af9e22e83f3fcd48a84f3ea3f6c9cfd7e50e SHA512 6390ec34f3d7d07be6ef6842a631d2e2ef87abe54e5f745846a6c08a4c1a7c15d50d3327afae131dd4b64a66ff187ada1d4cdae4f4503c33e249dc238082ce9a DIST pixz-1.0.6.tar.xz 119516 BLAKE2B 758a4985b946284587998ab2a653e51ded9838a7c77c7795c82c15c1693714468b07c2cbfd86a0c7ce7be34d9a5bd8fdc3285d503524ce299ba53179447e60ed SHA512 361a8d8b736c350e4e3fd19b5d36777129a087eb81439d05edc08f9378938583bef8fc70e440ffd22efb6dad1f6494c6c3e532d7dd1ab12c9350b6078aa993d7 -EBUILD pixz-1.0.6.ebuild 1129 BLAKE2B e5ca5eb79990e3131dc834d23d79f4d76e1625da66f167764a679362b032cdd5f900e5f582037765456000bbc0e68781c43323fe6003d917a0f3d465ec255f44 SHA512 a7ba1aca5481d1d92dc35e4e8457a1c5c7a8d65b2df7f31b7cbe845e2f88d247cf5ad9e588b4a017c5d97fe030ac070c0bbcf362f222d0e73596e2581d177f2e +EBUILD pixz-1.0.6-r1.ebuild 1192 BLAKE2B b16efeaccd366807cf0e6d9cea800677b05231397e7de49b11274339fb27b5b8c31935051850fdc43af59fc3c794b0b24cd02ce56b61de1ed6cc244b384ede3a SHA512 b6465574d64efd6a27db3a52b9ae5227ac8c54b192761b5d97041416d6671ec55a4f5608da11e4824d5a3da04feda331dbb94e8be8a46603c6faaf79f6e54686 EBUILD pixz-9999.ebuild 1133 BLAKE2B 1df4240b4409c81ce3a28ac47a276954e3b977c1964411c995e8335da4246fd79350be5c1543b5ab896230fb81a28c6aa8ec7be26b0e5d87d2bf0c45f1cb8a7c SHA512 350b2274074199349d2724816d233df340c015a2fa2efc228bae5bf35838a92ce91150e9d3b0bc86cca7433830288876da11d6217a79bd4495d8e5ae974dab16 MISC metadata.xml 331 BLAKE2B 15bff5a59c7a5ff1dc23d59a9c9acda8ad40691a1b79d992ea05eaab0436e56cf0419f0e70b4e8dbeed37bee33735bb6700a85a2f26d50fd857cb38eb55f152c SHA512 54391cfef5b3719b7ad708cc7367740ba68f3223e0d92ae8ae5992ff127f41291fc1afa0d0bd7a1a02cf53b76c3817a57696a16ae535f8522e9d9249f4ddf401 diff --git a/app-arch/pixz/files/pixz-1.0.6-avoid-unaligned-accesses.patch b/app-arch/pixz/files/pixz-1.0.6-avoid-unaligned-accesses.patch new file mode 100644 index 000000000000..24c53c9acc4a --- /dev/null +++ b/app-arch/pixz/files/pixz-1.0.6-avoid-unaligned-accesses.patch @@ -0,0 +1,44 @@ +https://github.com/vasi/pixz/pull/82 + +From 8b9a198d86e435929ed0c2246217d241ed1e707c Mon Sep 17 00:00:00 2001 +From: Matt Turner <mattst88@gmail.com> +Date: Sun, 1 Sep 2019 23:58:26 -0700 +Subject: [PATCH] Avoid unaligned accesses + +Architectures like SPARC do not allow unaligned accesses. Avoid them by +memcpy()ing the data to an aligned buffer. On x86 systems where +unaligned loads are fast, the memcpy() will be compiled away and the +same code generated as before. +--- + src/endian.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/src/endian.c b/src/endian.c +index 51aea58..122c7da 100644 +--- a/src/endian.c ++++ b/src/endian.c +@@ -13,6 +13,7 @@ void xle64enc(uint8_t *d, uint64_t n) { + #elif defined(__linux__) || defined(__FreeBSD__) + + #include <stdint.h> ++#include <string.h> + #ifdef __linux__ + #include <endian.h> + #include <byteswap.h> +@@ -37,11 +38,14 @@ void xle64enc(uint8_t *d, uint64_t n) { + #endif + + uint64_t xle64dec(const uint8_t *d) { +- return le64toh(*(uint64_t*)d); ++ uint64_t tmp; ++ memcpy(&tmp, d, sizeof(tmp)); ++ return le64toh(tmp); + } + + void xle64enc(uint8_t *d, uint64_t n) { +- *(uint64_t*)d = htole64(n); ++ uint64_t tmp = htole64(n); ++ memcpy(d, &tmp, sizeof(tmp)); + } + + #else diff --git a/app-arch/pixz/pixz-1.0.6.ebuild b/app-arch/pixz/pixz-1.0.6-r1.ebuild index bd8d4125bb53..7e2076596294 100644 --- a/app-arch/pixz/pixz-1.0.6.ebuild +++ b/app-arch/pixz/pixz-1.0.6-r1.ebuild @@ -10,7 +10,7 @@ if [[ ${PV} == "9999" ]] ; then inherit git-r3 autotools else SRC_URI="https://github.com/vasi/pixz/releases/download/v${PV}/${P}.tar.xz" - KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ppc ppc64 ~s390 ~sh ~sparc x86" + KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86" fi DESCRIPTION="Parallel Indexed XZ compressor" @@ -27,6 +27,10 @@ DEPEND="${RDEPEND} static? ( ${LIB_DEPEND} )" [[ ${PV} == "9999" ]] && DEPEND+=" app-text/asciidoc" +PATCHES=( + "${FILESDIR}"/${P}-avoid-unaligned-accesses.patch +) + src_prepare() { default [[ ${PV} == "9999" ]] && eautoreconf |