From fc113dd14014129ac43d604fd367180f480fafd59002717bb60e0c1c04d7c8d6 Mon Sep 17 00:00:00 2001 From: Bernhard Wiedemann Date: Thu, 17 Dec 2020 04:11:04 +0000 Subject: [PATCH 1/3] Update to version 1.4.7 * Improved --long mode * --long now automatically enabled for any window size >= 128MB * Faster decompression of small blocks * CLI improvements + accept parameter through environment variable ZSTD_NBTHREADS + new command --output-dir-mirror + more accurate warning and error messages * New experimental features + Shared Thread Pool + Faster Dictionary Compression + New Sequence Ingestion API * Drop upstream fix-lib-build.patch OBS-URL: https://build.opensuse.org/package/show/Archiving/zstd?expand=0&rev=52 --- fix-lib-build.patch | 37 ------------------------------------- pzstd.1.patch | 12 ++++++------ zstd-1.4.5.tar.gz | 3 --- zstd-1.4.7.tar.gz | 3 +++ zstd.changes | 17 +++++++++++++++++ zstd.spec | 4 +--- 6 files changed, 27 insertions(+), 49 deletions(-) delete mode 100644 fix-lib-build.patch delete mode 100644 zstd-1.4.5.tar.gz create mode 100644 zstd-1.4.7.tar.gz diff --git a/fix-lib-build.patch b/fix-lib-build.patch deleted file mode 100644 index 3c0059f..0000000 --- a/fix-lib-build.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 39a32f40c91c306898d771962aab5bd22235554f Mon Sep 17 00:00:00 2001 -From: Yann Collet -Date: Mon, 25 May 2020 06:50:45 -0700 -Subject: [PATCH] fixed default rule for lib/Makefile - -default rule is `lib-release` - -`lib-release` wasn't working : it was just skipped. - -Removing `lib-release` from the list of .PHONY targets fixes it. - -Same for `lib-mt`. ---- - lib/Makefile | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/lib/Makefile b/lib/Makefile -index e6213ac86..c4305d6f8 100644 ---- a/lib/Makefile -+++ b/lib/Makefile -@@ -220,13 +220,14 @@ libzstd : $(LIBZSTD) - .PHONY: lib - lib : libzstd.a libzstd - --.PHONY: lib-mt -+# note : do not define lib-mt or lib-release as .PHONY -+# make does not consider implicit pattern rule for .PHONY target -+ - %-mt : CPPFLAGS += -DZSTD_MULTITHREAD - %-mt : LDFLAGS += -pthread - %-mt : % - @echo multi-threading build completed - --.PHONY: lib-release - %-release : DEBUGFLAGS := - %-release : % - @echo release build completed diff --git a/pzstd.1.patch b/pzstd.1.patch index ccaca3f..dd97c28 100644 --- a/pzstd.1.patch +++ b/pzstd.1.patch @@ -1,10 +1,10 @@ -Index: zstd-1.4.4/programs/zstd.1 +Index: zstd-1.4.7/programs/zstd.1 =================================================================== ---- zstd-1.4.4.orig/programs/zstd.1 -+++ zstd-1.4.4/programs/zstd.1 -@@ -213,6 +213,12 @@ All arguments after \fB\-\-\fR are treat - .SS "Restricted usage of Environment Variables" - Using environment variables to set parameters has security implications\. Therefore, this avenue is intentionally restricted\. Only \fBZSTD_CLEVEL\fR is supported currently, for setting compression level\. \fBZSTD_CLEVEL\fR can be used to set the level between 1 and 19 (the "normal" range)\. If the value of \fBZSTD_CLEVEL\fR is not a valid integer, it will be ignored with a warning message\. \fBZSTD_CLEVEL\fR just replaces the default compression level (\fB3\fR)\. It can be overridden by corresponding command line arguments\. +--- zstd-1.4.7.orig/programs/zstd.1 ++++ zstd-1.4.7/programs/zstd.1 +@@ -223,6 +223,12 @@ Using environment variables to set param + .P + They can both be overridden by corresponding command line arguments: \fB\-#\fR for compression level and \fB\-T#\fR for number of compression threads\. . +.SH Parallel Zstd OPTIONS +Additional options for the pzstd utility diff --git a/zstd-1.4.5.tar.gz b/zstd-1.4.5.tar.gz deleted file mode 100644 index dacf03d..0000000 --- a/zstd-1.4.5.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:734d1f565c42f691f8420c8d06783ad818060fc390dee43ae0a89f86d0a4f8c2 -size 1987927 diff --git a/zstd-1.4.7.tar.gz b/zstd-1.4.7.tar.gz new file mode 100644 index 0000000..0a1f1a9 --- /dev/null +++ b/zstd-1.4.7.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:085500c8d0b9c83afbc1dc0d8b4889336ad019eba930c5d6a9c6c86c20c769c8 +size 1817193 diff --git a/zstd.changes b/zstd.changes index cf48291..890a227 100644 --- a/zstd.changes +++ b/zstd.changes @@ -1,3 +1,20 @@ +------------------------------------------------------------------- +Thu Dec 17 04:04:42 UTC 2020 - Bernhard Wiedemann + +- Update to version 1.4.7 + * Improved --long mode + * --long now automatically enabled for any window size >= 128MB + * Faster decompression of small blocks + * CLI improvements + + accept parameter through environment variable ZSTD_NBTHREADS + + new command --output-dir-mirror + + more accurate warning and error messages + * New experimental features + + Shared Thread Pool + + Faster Dictionary Compression + + New Sequence Ingestion API + * Drop upstream fix-lib-build.patch + ------------------------------------------------------------------- Wed Jul 8 18:33:04 UTC 2020 - Martin Liška diff --git a/zstd.spec b/zstd.spec index 22ecb67..4e533a0 100644 --- a/zstd.spec +++ b/zstd.spec @@ -19,7 +19,7 @@ %define major 1 %define libname lib%{name}%{major} Name: zstd -Version: %{major}.4.5 +Version: %{major}.4.7 Release: 0 Summary: Zstandard compression tools License: BSD-3-Clause AND GPL-2.0-only @@ -28,7 +28,6 @@ URL: https://github.com/facebook/zstd Source0: https://github.com/facebook/zstd/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz Source99: baselibs.conf Patch1: pzstd.1.patch -Patch2: fix-lib-build.patch BuildRequires: gcc # C++ is needed for pzstd only BuildRequires: gcc-c++ @@ -85,7 +84,6 @@ Needed for compiling programs that link with the library. %prep %setup -q %patch1 -p1 -%patch2 -p1 %build %global _lto_cflags %{_lto_cflags} -ffat-lto-objects From d16a102468832be73fbfb414bb36bf2e8828a564d7f6af93d28486c307a9eb67 Mon Sep 17 00:00:00 2001 From: Bernhard Wiedemann Date: Fri, 18 Dec 2020 06:31:28 +0000 Subject: [PATCH 2/3] Add upstream 2430.patch to fix i586+s390x OBS-URL: https://build.opensuse.org/package/show/Archiving/zstd?expand=0&rev=53 --- 2430.patch | 44 ++++++++++++++++++++++++++++++++++++++++++++ zstd.changes | 5 +++++ zstd.spec | 2 ++ 3 files changed, 51 insertions(+) create mode 100644 2430.patch diff --git a/2430.patch b/2430.patch new file mode 100644 index 0000000..bae80a6 --- /dev/null +++ b/2430.patch @@ -0,0 +1,44 @@ +From ae85676d44baee3d12168a5c929347b3836f2cf2 Mon Sep 17 00:00:00 2001 +From: Nick Terrell +Date: Thu, 17 Dec 2020 14:27:53 -0800 +Subject: [PATCH] Fix alignment of scratchBuffer in HUF_compressWeights() + +The scratch buffer must be 4-byte aligned. This causes test failures in +32-bit systems, where the stack isn't aligned. + +Fixes Issue #2428. +--- + lib/common/fse.h | 5 +++-- + lib/compress/huf_compress.c | 2 +- + 2 files changed, 4 insertions(+), 3 deletions(-) + +diff --git a/lib/common/fse.h b/lib/common/fse.h +index 83a07847a..dd5fc44e8 100644 +--- a/lib/common/fse.h ++++ b/lib/common/fse.h +@@ -335,9 +335,10 @@ size_t FSE_buildCTable_rle (FSE_CTable* ct, unsigned char symbolValue); + + /* FSE_buildCTable_wksp() : + * Same as FSE_buildCTable(), but using an externally allocated scratch buffer (`workSpace`). +- * `wkspSize` must be >= `FSE_BUILD_CTABLE_WORKSPACE_SIZE(maxSymbolValue, tableLog)`. ++ * `wkspSize` must be >= `FSE_BUILD_CTABLE_WORKSPACE_SIZE_U32(maxSymbolValue, tableLog)` of `unsigned`. + */ +-#define FSE_BUILD_CTABLE_WORKSPACE_SIZE(maxSymbolValue, tableLog) (sizeof(unsigned) * (maxSymbolValue + 2) + (1ull << tableLog)) ++#define FSE_BUILD_CTABLE_WORKSPACE_SIZE_U32(maxSymbolValue, tableLog) (maxSymbolValue + 2 + (1ull << (tableLog - 2))) ++#define FSE_BUILD_CTABLE_WORKSPACE_SIZE(maxSymbolValue, tableLog) (sizeof(unsigned) * FSE_BUILD_CTABLE_WORKSPACE_SIZE_U32(maxSymbolValue, tableLog)) + size_t FSE_buildCTable_wksp(FSE_CTable* ct, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize); + + #define FSE_BUILD_DTABLE_WKSP_SIZE(maxTableLog, maxSymbolValue) (sizeof(short) * (maxSymbolValue + 1) + (1ULL << maxTableLog) + 8) +diff --git a/lib/compress/huf_compress.c b/lib/compress/huf_compress.c +index abbcc3192..00c593d7e 100644 +--- a/lib/compress/huf_compress.c ++++ b/lib/compress/huf_compress.c +@@ -69,7 +69,7 @@ static size_t HUF_compressWeights (void* dst, size_t dstSize, const void* weight + U32 tableLog = MAX_FSE_TABLELOG_FOR_HUFF_HEADER; + + FSE_CTable CTable[FSE_CTABLE_SIZE_U32(MAX_FSE_TABLELOG_FOR_HUFF_HEADER, HUF_TABLELOG_MAX)]; +- BYTE scratchBuffer[FSE_BUILD_CTABLE_WORKSPACE_SIZE(HUF_TABLELOG_MAX, MAX_FSE_TABLELOG_FOR_HUFF_HEADER)]; ++ U32 scratchBuffer[FSE_BUILD_CTABLE_WORKSPACE_SIZE_U32(HUF_TABLELOG_MAX, MAX_FSE_TABLELOG_FOR_HUFF_HEADER)]; + + unsigned count[HUF_TABLELOG_MAX+1]; + S16 norm[HUF_TABLELOG_MAX+1]; diff --git a/zstd.changes b/zstd.changes index 890a227..00ee695 100644 --- a/zstd.changes +++ b/zstd.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Dec 18 06:30:18 UTC 2020 - Bernhard Wiedemann + +- Add upstream 2430.patch to fix i586+s390x + ------------------------------------------------------------------- Thu Dec 17 04:04:42 UTC 2020 - Bernhard Wiedemann diff --git a/zstd.spec b/zstd.spec index 4e533a0..d682edc 100644 --- a/zstd.spec +++ b/zstd.spec @@ -28,6 +28,7 @@ URL: https://github.com/facebook/zstd Source0: https://github.com/facebook/zstd/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz Source99: baselibs.conf Patch1: pzstd.1.patch +Patch2: 2430.patch BuildRequires: gcc # C++ is needed for pzstd only BuildRequires: gcc-c++ @@ -84,6 +85,7 @@ Needed for compiling programs that link with the library. %prep %setup -q %patch1 -p1 +%patch2 -p1 %build %global _lto_cflags %{_lto_cflags} -ffat-lto-objects From 48170d5a65dea81d135e64183780b7d72f0093fe421f0f973c5cb65f094e239d Mon Sep 17 00:00:00 2001 From: Bernhard Wiedemann Date: Sat, 19 Dec 2020 04:01:47 +0000 Subject: [PATCH 3/3] Update to version 1.4.8 to fix i586+s390x OBS-URL: https://build.opensuse.org/package/show/Archiving/zstd?expand=0&rev=54 --- 2430.patch | 44 -------------------------------------------- zstd-1.4.7.tar.gz | 3 --- zstd-1.4.8.tar.gz | 3 +++ zstd.changes | 4 ++-- zstd.spec | 4 +--- 5 files changed, 6 insertions(+), 52 deletions(-) delete mode 100644 2430.patch delete mode 100644 zstd-1.4.7.tar.gz create mode 100644 zstd-1.4.8.tar.gz diff --git a/2430.patch b/2430.patch deleted file mode 100644 index bae80a6..0000000 --- a/2430.patch +++ /dev/null @@ -1,44 +0,0 @@ -From ae85676d44baee3d12168a5c929347b3836f2cf2 Mon Sep 17 00:00:00 2001 -From: Nick Terrell -Date: Thu, 17 Dec 2020 14:27:53 -0800 -Subject: [PATCH] Fix alignment of scratchBuffer in HUF_compressWeights() - -The scratch buffer must be 4-byte aligned. This causes test failures in -32-bit systems, where the stack isn't aligned. - -Fixes Issue #2428. ---- - lib/common/fse.h | 5 +++-- - lib/compress/huf_compress.c | 2 +- - 2 files changed, 4 insertions(+), 3 deletions(-) - -diff --git a/lib/common/fse.h b/lib/common/fse.h -index 83a07847a..dd5fc44e8 100644 ---- a/lib/common/fse.h -+++ b/lib/common/fse.h -@@ -335,9 +335,10 @@ size_t FSE_buildCTable_rle (FSE_CTable* ct, unsigned char symbolValue); - - /* FSE_buildCTable_wksp() : - * Same as FSE_buildCTable(), but using an externally allocated scratch buffer (`workSpace`). -- * `wkspSize` must be >= `FSE_BUILD_CTABLE_WORKSPACE_SIZE(maxSymbolValue, tableLog)`. -+ * `wkspSize` must be >= `FSE_BUILD_CTABLE_WORKSPACE_SIZE_U32(maxSymbolValue, tableLog)` of `unsigned`. - */ --#define FSE_BUILD_CTABLE_WORKSPACE_SIZE(maxSymbolValue, tableLog) (sizeof(unsigned) * (maxSymbolValue + 2) + (1ull << tableLog)) -+#define FSE_BUILD_CTABLE_WORKSPACE_SIZE_U32(maxSymbolValue, tableLog) (maxSymbolValue + 2 + (1ull << (tableLog - 2))) -+#define FSE_BUILD_CTABLE_WORKSPACE_SIZE(maxSymbolValue, tableLog) (sizeof(unsigned) * FSE_BUILD_CTABLE_WORKSPACE_SIZE_U32(maxSymbolValue, tableLog)) - size_t FSE_buildCTable_wksp(FSE_CTable* ct, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize); - - #define FSE_BUILD_DTABLE_WKSP_SIZE(maxTableLog, maxSymbolValue) (sizeof(short) * (maxSymbolValue + 1) + (1ULL << maxTableLog) + 8) -diff --git a/lib/compress/huf_compress.c b/lib/compress/huf_compress.c -index abbcc3192..00c593d7e 100644 ---- a/lib/compress/huf_compress.c -+++ b/lib/compress/huf_compress.c -@@ -69,7 +69,7 @@ static size_t HUF_compressWeights (void* dst, size_t dstSize, const void* weight - U32 tableLog = MAX_FSE_TABLELOG_FOR_HUFF_HEADER; - - FSE_CTable CTable[FSE_CTABLE_SIZE_U32(MAX_FSE_TABLELOG_FOR_HUFF_HEADER, HUF_TABLELOG_MAX)]; -- BYTE scratchBuffer[FSE_BUILD_CTABLE_WORKSPACE_SIZE(HUF_TABLELOG_MAX, MAX_FSE_TABLELOG_FOR_HUFF_HEADER)]; -+ U32 scratchBuffer[FSE_BUILD_CTABLE_WORKSPACE_SIZE_U32(HUF_TABLELOG_MAX, MAX_FSE_TABLELOG_FOR_HUFF_HEADER)]; - - unsigned count[HUF_TABLELOG_MAX+1]; - S16 norm[HUF_TABLELOG_MAX+1]; diff --git a/zstd-1.4.7.tar.gz b/zstd-1.4.7.tar.gz deleted file mode 100644 index 0a1f1a9..0000000 --- a/zstd-1.4.7.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:085500c8d0b9c83afbc1dc0d8b4889336ad019eba930c5d6a9c6c86c20c769c8 -size 1817193 diff --git a/zstd-1.4.8.tar.gz b/zstd-1.4.8.tar.gz new file mode 100644 index 0000000..0ae3604 --- /dev/null +++ b/zstd-1.4.8.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f176f0626cb797022fbf257c3c644d71c1c747bb74c32201f9203654da35e9fa +size 1816546 diff --git a/zstd.changes b/zstd.changes index 00ee695..a59d4e0 100644 --- a/zstd.changes +++ b/zstd.changes @@ -1,7 +1,7 @@ ------------------------------------------------------------------- -Fri Dec 18 06:30:18 UTC 2020 - Bernhard Wiedemann +Sat Dec 19 04:01:08 UTC 2020 - Bernhard Wiedemann -- Add upstream 2430.patch to fix i586+s390x +- Update to version 1.4.8 to fix i586+s390x ------------------------------------------------------------------- Thu Dec 17 04:04:42 UTC 2020 - Bernhard Wiedemann diff --git a/zstd.spec b/zstd.spec index d682edc..5bc1197 100644 --- a/zstd.spec +++ b/zstd.spec @@ -19,7 +19,7 @@ %define major 1 %define libname lib%{name}%{major} Name: zstd -Version: %{major}.4.7 +Version: %{major}.4.8 Release: 0 Summary: Zstandard compression tools License: BSD-3-Clause AND GPL-2.0-only @@ -28,7 +28,6 @@ URL: https://github.com/facebook/zstd Source0: https://github.com/facebook/zstd/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz Source99: baselibs.conf Patch1: pzstd.1.patch -Patch2: 2430.patch BuildRequires: gcc # C++ is needed for pzstd only BuildRequires: gcc-c++ @@ -85,7 +84,6 @@ Needed for compiling programs that link with the library. %prep %setup -q %patch1 -p1 -%patch2 -p1 %build %global _lto_cflags %{_lto_cflags} -ffat-lto-objects