From 197b2f9bc19989084a8b6e1785791bdbc72b286f Mon Sep 17 00:00:00 2001 From: bket Date: Sat, 9 Jun 2018 18:38:18 +0000 Subject: [PATCH] Update to zopfli-1.0.2. This version should build, and work on m88k. jca@ gave it a try on sparc64, where it crashes (SIGBUS), and fixed the issue. Thanks! OK jca@ --- archivers/zopfli/Makefile | 7 ++--- archivers/zopfli/distinfo | 4 +-- archivers/zopfli/patches/patch-Makefile | 11 ++++---- .../zopfli/patches/patch-src_zopfli_lz77_c | 26 +++++++++++++++++++ 4 files changed, 36 insertions(+), 12 deletions(-) create mode 100644 archivers/zopfli/patches/patch-src_zopfli_lz77_c diff --git a/archivers/zopfli/Makefile b/archivers/zopfli/Makefile index 9718d019adf..03f7cac6883 100644 --- a/archivers/zopfli/Makefile +++ b/archivers/zopfli/Makefile @@ -1,13 +1,10 @@ -# $OpenBSD: Makefile,v 1.4 2017/04/18 13:09:23 sthen Exp $ - -# __builtin_clz -NOT_FOR_ARCHS= ${GCC3_ARCHS} +# $OpenBSD: Makefile,v 1.5 2018/06/09 18:38:18 bket Exp $ COMMENT = deflate-compatible compression format GH_ACCOUNT = google GH_PROJECT = zopfli -GH_TAGNAME = zopfli-1.0.1 +GH_TAGNAME = zopfli-1.0.2 DISTNAME = ${GH_TAGNAME} CATEGORIES = archivers diff --git a/archivers/zopfli/distinfo b/archivers/zopfli/distinfo index ed7f54774de..30d16eb4424 100644 --- a/archivers/zopfli/distinfo +++ b/archivers/zopfli/distinfo @@ -1,2 +1,2 @@ -SHA256 (zopfli-1.0.1.tar.gz) = KXQ9cnpODs0bk+C/iUds7rZi6AmrLmqwB6CwNEgA6bQ= -SIZE (zopfli-1.0.1.tar.gz) = 128178 +SHA256 (zopfli-1.0.2.tar.gz) = SlcDB8NxctiU7E75O26OOqzEAeeMvMUc+FshLbw3mlU= +SIZE (zopfli-1.0.2.tar.gz) = 136035 diff --git a/archivers/zopfli/patches/patch-Makefile b/archivers/zopfli/patches/patch-Makefile index 87e2fb08f1f..7e12193785e 100644 --- a/archivers/zopfli/patches/patch-Makefile +++ b/archivers/zopfli/patches/patch-Makefile @@ -1,13 +1,14 @@ -$OpenBSD: patch-Makefile,v 1.1 2017/04/18 13:09:23 sthen Exp $ ---- Makefile.orig Tue Apr 18 14:06:16 2017 -+++ Makefile Tue Apr 18 14:06:23 2017 +$OpenBSD: patch-Makefile,v 1.2 2018/06/09 18:38:18 bket Exp $ +Index: Makefile +--- Makefile.orig ++++ Makefile @@ -1,8 +1,8 @@ CC = gcc CXX = g++ --CFLAGS = -W -Wall -Wextra -ansi -pedantic -lm -O2 +-CFLAGS = -W -Wall -Wextra -ansi -pedantic -lm -O2 -Wno-unused-function -CXXFLAGS = -W -Wall -Wextra -ansi -pedantic -O2 -+CFLAGS = -W -Wall -Wextra -ansi -pedantic -lm $(COPTFLAGS) ++CFLAGS = -W -Wall -Wextra -ansi -pedantic -lm $(COPTFLAGS) -Wno-unused-function +CXXFLAGS = -W -Wall -Wextra -ansi -pedantic $(COPTFLAGS) ZOPFLILIB_SRC = src/zopfli/blocksplitter.c src/zopfli/cache.c\ diff --git a/archivers/zopfli/patches/patch-src_zopfli_lz77_c b/archivers/zopfli/patches/patch-src_zopfli_lz77_c new file mode 100644 index 00000000000..de070ef18df --- /dev/null +++ b/archivers/zopfli/patches/patch-src_zopfli_lz77_c @@ -0,0 +1,26 @@ +$OpenBSD: patch-src_zopfli_lz77_c,v 1.1 2018/06/09 18:38:18 bket Exp $ + +Unbreak on architectures with strict alignement requirements. + +Index: src/zopfli/lz77.c +--- src/zopfli/lz77.c.orig ++++ src/zopfli/lz77.c +@@ -299,6 +299,7 @@ static const unsigned char* GetMatch(const unsigned ch + const unsigned char* end, + const unsigned char* safe_end) { + ++#ifndef __STRICT_ALIGNMENT + if (sizeof(size_t) == 8) { + /* 8 checks at once per array bounds check (size_t is 64-bit). */ + while (scan < safe_end && *((size_t*)scan) == *((size_t*)match)) { +@@ -312,7 +313,9 @@ static const unsigned char* GetMatch(const unsigned ch + scan += 4; + match += 4; + } +- } else { ++ } else ++#endif /* ! __STRICT_ALIGNMENT */ ++ { + /* do 8 checks at once per array bounds check. */ + while (scan < safe_end && *scan == *match && *++scan == *++match + && *++scan == *++match && *++scan == *++match