From e6303b59b60b2f4d5899e18e30bbad83bcab1fa4 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 23 Jul 2021 22:23:23 +0000 Subject: [PATCH 01/29] - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- zstd.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zstd.spec b/zstd.spec index bc73c6c..5b3b7c1 100644 --- a/zstd.spec +++ b/zstd.spec @@ -13,7 +13,7 @@ Name: zstd Version: 1.5.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Zstd compression library License: BSD and GPLv2 @@ -121,6 +121,9 @@ install -D -m644 programs/%{name}.1 %{buildroot}%{_mandir}/man1/p%{name}.1 %ldconfig_scriptlets -n lib%{name} %changelog +* Fri Jul 23 2021 Fedora Release Engineering - 1.5.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + * Sun May 16 2021 Pádraig Brady - 1.5.0-2 - Latest upstream From c821aeb74418c7166b39de9f4c160ab013c8919c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= Date: Thu, 23 Dec 2021 00:21:18 +0000 Subject: [PATCH 02/29] latest upstream (1.5.1) --- .gitignore | 1 + pzstd.1.patch | 16 ++++++++-------- sources | 2 +- zstd.spec | 7 +++++-- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 2f51990..9a46aab 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ /zstd-1.4.7.tar.gz /zstd-1.4.9.tar.gz /zstd-1.5.0.tar.gz +/zstd-1.5.1.tar.gz diff --git a/pzstd.1.patch b/pzstd.1.patch index f86e8d8..d4e3a1f 100644 --- a/pzstd.1.patch +++ b/pzstd.1.patch @@ -1,9 +1,9 @@ -diff -Naur zstd-1.4.7.orig/programs/zstd.1 zstd-1.4.7/programs/zstd.1 ---- zstd-1.4.7.orig/programs/zstd.1 2020-12-16 23:00:18.000000000 +0000 -+++ zstd-1.4.7/programs/zstd.1 2020-12-17 15:15:22.586152398 +0000 -@@ -208,6 +208,14 @@ - . - .IP "\(bu" 4 +diff -Naur zstd-1.5.1.orig/programs/zstd.1 zstd-1.5.1/programs/zstd.1 +--- zstd-1.5.1.orig/programs/zstd.1 2021-12-20 22:49:18.000000000 +0000 ++++ zstd-1.5.1/programs/zstd.1 2021-12-22 16:49:17.160850340 +0000 +@@ -146,6 +146,14 @@ + \fB\-\-show\-default\-cparams\fR: Shows the default compression parameters that will be used for a particular src file\. If the provided src file is not a regular file (eg\. named pipe), the cli will just output the default parameters\. That is, the parameters that are used when the src size is unknown\. + .IP "\[ci]" 4 \fB\-\-\fR: All arguments after \fB\-\-\fR are treated as files + +.SH Parallel Zstd OPTIONS @@ -13,6 +13,6 @@ diff -Naur zstd-1.4.7.orig/programs/zstd.1 zstd-1.4.7/programs/zstd.1 + number of threads to use for (de)compression (default:4) + + - . .IP "" 0 - . + .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 and \fBZSTD_NBTHREADS\fR are currently supported\. They set the compression level and number of threads to use during compression, respectively\. diff --git a/sources b/sources index c2fe8e6..8d53d3a 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (zstd-1.5.0.tar.gz) = b322fc1b89a556827b7fece2fb0f34c83bf65bb85b2468c791d6d9178a65c81e21f4171b7533cbf12bc1dfb2fd323d3e8c34d86167b157645c27f65186eec659 +SHA512 (zstd-1.5.1.tar.gz) = 00c7f5f6f6a2b51557f3ede56026d54d8e023c85f9824496f4522524ce8ced495e88d56452e3510df6ec1bf53e659b2633cdcc84d016bcdbfdcc76e142d3620f diff --git a/zstd.spec b/zstd.spec index 5b3b7c1..964c3c7 100644 --- a/zstd.spec +++ b/zstd.spec @@ -12,8 +12,8 @@ %endif Name: zstd -Version: 1.5.0 -Release: 2%{?dist} +Version: 1.5.1 +Release: 1%{?dist} Summary: Zstd compression library License: BSD and GPLv2 @@ -121,6 +121,9 @@ install -D -m644 programs/%{name}.1 %{buildroot}%{_mandir}/man1/p%{name}.1 %ldconfig_scriptlets -n lib%{name} %changelog +* Wed Dec 22 2021 Pádraig Brady - 1.5.1-1 +- Latest upstream + * Fri Jul 23 2021 Fedora Release Engineering - 1.5.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild From 9ea2179ffc181014f196ea247663bafcaecd79bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 28 Dec 2021 17:37:11 +0100 Subject: [PATCH 03/29] Disable amd64 assembly on non-intel architectures All builds would include an .S file which contains a pre-processor directive that makes the file effectively empty on non-amd64 architectures. Objects built from assembly get an executable stack by default. The file has a stanza to make the stack non-executable, but on non-amd64 architectures this stanza is skipped together with the rest of the file. Nevertheless, it seems that even the empty file causes an executable stack to be created. To avoid the issue, do a build with the assembler file explicitly skipped. --- zstd.spec | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/zstd.spec b/zstd.spec index 964c3c7..145a3e5 100644 --- a/zstd.spec +++ b/zstd.spec @@ -4,10 +4,12 @@ %else %ifarch %{ix86} x86_64 %bcond_without pzstd +%bcond_without asm %else # aarch64 and armv7hl at least currently segfault # in ThreadPool test for the pzstd util %bcond_with pzstd +%bcond_with asm %endif %endif @@ -22,11 +24,12 @@ Source0: https://github.com/facebook/zstd/archive/v%{version}.tar.gz#/%{n Patch1: pzstd.1.patch -BuildRequires: make +BuildRequires: make BuildRequires: gcc gtest-devel %if %{with pzstd} BuildRequires: gcc-c++ %endif +BuildRequires: execstack %description Zstd, short for Zstandard, is a fast lossless compression algorithm, @@ -62,14 +65,16 @@ find -name .gitignore -delete %build export CFLAGS="$RPM_OPT_FLAGS" export LDFLAGS="$RPM_LD_FLAGS" -%make_build -C lib lib-mt -%make_build -C programs +%make_build -C lib lib-mt %{!?with_asm:ZSTD_NO_ASM=1} +%make_build -C programs %{!?with_asm:ZSTD_NO_ASM=1} %if %{with pzstd} export CXXFLAGS="$RPM_OPT_FLAGS" -%make_build -C contrib/pzstd +%make_build -C contrib/pzstd %{!?with_asm:ZSTD_NO_ASM=1} %endif %check +execstack lib/libzstd.so.1 + export CFLAGS="$RPM_OPT_FLAGS" export LDFLAGS="$RPM_LD_FLAGS" make -C tests test-zstd @@ -121,6 +126,10 @@ install -D -m644 programs/%{name}.1 %{buildroot}%{_mandir}/man1/p%{name}.1 %ldconfig_scriptlets -n lib%{name} %changelog +* Tue Dec 28 2021 Zbigniew Jędrzejewski-Szmek - 1.5.1-1 +- Disable amd64 assembly on non-intel architectures (#2035802): + this should avoid the issue where an executable stack is created. + * Wed Dec 22 2021 Pádraig Brady - 1.5.1-1 - Latest upstream From 1862b14f48f6a3736659ee88ac4a82e974742b2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 28 Dec 2021 17:39:12 +0100 Subject: [PATCH 04/29] Bump release --- zstd.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zstd.spec b/zstd.spec index 145a3e5..88a01ae 100644 --- a/zstd.spec +++ b/zstd.spec @@ -15,7 +15,7 @@ Name: zstd Version: 1.5.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Zstd compression library License: BSD and GPLv2 @@ -126,7 +126,7 @@ install -D -m644 programs/%{name}.1 %{buildroot}%{_mandir}/man1/p%{name}.1 %ldconfig_scriptlets -n lib%{name} %changelog -* Tue Dec 28 2021 Zbigniew Jędrzejewski-Szmek - 1.5.1-1 +* Tue Dec 28 2021 Zbigniew Jędrzejewski-Szmek - 1.5.1-2 - Disable amd64 assembly on non-intel architectures (#2035802): this should avoid the issue where an executable stack is created. From c6408fa04eccec1244ce9aa785279a9757df6bcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= Date: Wed, 29 Dec 2021 21:06:39 +0000 Subject: [PATCH 05/29] avoid executable stack on i686 also --- zstd.spec | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/zstd.spec b/zstd.spec index 88a01ae..f4f4b62 100644 --- a/zstd.spec +++ b/zstd.spec @@ -4,18 +4,25 @@ %else %ifarch %{ix86} x86_64 %bcond_without pzstd -%bcond_without asm %else # aarch64 and armv7hl at least currently segfault # in ThreadPool test for the pzstd util %bcond_with pzstd -%bcond_with asm %endif %endif +%ifarch x86_64 +%bcond_without asm +%else +# Disable asm to ensure non excutable stack +# used on archs where asm not actually used +# https://github.com/facebook/zstd/issues/2963 +%bcond_with asm +%endif + Name: zstd Version: 1.5.1 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Zstd compression library License: BSD and GPLv2 @@ -126,6 +133,9 @@ install -D -m644 programs/%{name}.1 %{buildroot}%{_mandir}/man1/p%{name}.1 %ldconfig_scriptlets -n lib%{name} %changelog +* Wed Dec 29 2021 Pádraig Brady - 1.5.1-3 +- Avoid executable stack on i686 also. + * Tue Dec 28 2021 Zbigniew Jędrzejewski-Szmek - 1.5.1-2 - Disable amd64 assembly on non-intel architectures (#2035802): this should avoid the issue where an executable stack is created. From 5358a3f27e2169db37759a29fd6c0d2885133ba8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= Date: Mon, 3 Jan 2022 16:05:48 +0000 Subject: [PATCH 06/29] fix prefix in generated pkgconfig file This is now generated at build, rather than install time Addresses https://bugzilla.redhat.com/2036667 --- zstd.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/zstd.spec b/zstd.spec index f4f4b62..7ba508d 100644 --- a/zstd.spec +++ b/zstd.spec @@ -22,7 +22,7 @@ Name: zstd Version: 1.5.1 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Zstd compression library License: BSD and GPLv2 @@ -72,6 +72,8 @@ find -name .gitignore -delete %build export CFLAGS="$RPM_OPT_FLAGS" export LDFLAGS="$RPM_LD_FLAGS" +export PREFIX="%{_prefix}" +export LIBDIR="%{_libdir}" %make_build -C lib lib-mt %{!?with_asm:ZSTD_NO_ASM=1} %make_build -C programs %{!?with_asm:ZSTD_NO_ASM=1} %if %{with pzstd} @@ -133,6 +135,9 @@ install -D -m644 programs/%{name}.1 %{buildroot}%{_mandir}/man1/p%{name}.1 %ldconfig_scriptlets -n lib%{name} %changelog +* Mon Jan 03 2022 Pádraig Brady - 1.5.1-4 +- Use correct prefix for pkgconfig. + * Wed Dec 29 2021 Pádraig Brady - 1.5.1-3 - Avoid executable stack on i686 also. From d34ec991911b3009a96b40c56152dc35b5416798 Mon Sep 17 00:00:00 2001 From: Michel Alexandre Salim Date: Thu, 6 Jan 2022 11:25:25 -0800 Subject: [PATCH 07/29] Enable gz support Signed-off-by: Michel Alexandre Salim --- zstd.spec | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/zstd.spec b/zstd.spec index 7ba508d..79fa74f 100644 --- a/zstd.spec +++ b/zstd.spec @@ -1,3 +1,12 @@ +# enable .lz4 support by default +%bcond_without lz4 + +# enable .xz/.lzma support by default +%bcond_without lzma + +# enable .gz support by default +%bcond_without zlib + %if 0%{?rhel} && 0%{?rhel} <= 6 # gcc-4.4 is currently too old to compile pzstd %bcond_with pzstd @@ -22,7 +31,7 @@ Name: zstd Version: 1.5.1 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Zstd compression library License: BSD and GPLv2 @@ -33,9 +42,18 @@ Patch1: pzstd.1.patch BuildRequires: make BuildRequires: gcc gtest-devel +%if %{with lz4} +BuildRequires: lz4-devel +%endif +%if %{with lzma} +BuildRequires: xz-devel +%endif %if %{with pzstd} BuildRequires: gcc-c++ %endif +%if %{with zlib} +BuildRequires: zlib-devel +%endif BuildRequires: execstack %description @@ -135,6 +153,9 @@ install -D -m644 programs/%{name}.1 %{buildroot}%{_mandir}/man1/p%{name}.1 %ldconfig_scriptlets -n lib%{name} %changelog +* Fri Jan 07 2022 Michel Alexandre Salim - 1.5.1-5 +- Enable gz, .xz/.lzma and .lz4 support + * Mon Jan 03 2022 Pádraig Brady - 1.5.1-4 - Use correct prefix for pkgconfig. From 43bd23e45a39f0e025042aa03dda73ff1a48ce52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= Date: Tue, 11 Jan 2022 18:26:05 +0000 Subject: [PATCH 08/29] re-enable CET protections --- enable-CET.patch | 38 ++++++++++++++++++++++++++++++++++++++ zstd.spec | 7 ++++++- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 enable-CET.patch diff --git a/enable-CET.patch b/enable-CET.patch new file mode 100644 index 0000000..335e95d --- /dev/null +++ b/enable-CET.patch @@ -0,0 +1,38 @@ +From cd7620a730413a48843e175d34dc408c152f8125 Mon Sep 17 00:00:00 2001 +From: "H.J. Lu" +Date: Tue, 11 Jan 2022 07:28:25 -0800 +Subject: [PATCH] x86-64: Enable Intel CET + +Intel Control-flow Enforcement Technology (CET): + +https://en.wikipedia.org/wiki/Control-flow_integrity#Intel_Control-flow_Enforcement_Technology + +requires that on Linux, all linker input files are marked as CET enabled +in .note.gnu.property section. For high-level language source codes, +.note.gnu.property section is added by compiler with the -fcf-protection +option. For assembly sources, include to add .note.gnu.property +section. +--- + lib/common/portability_macros.h | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/lib/common/portability_macros.h b/lib/common/portability_macros.h +index 627ef9eed4..6ac4b05510 100644 +--- a/lib/common/portability_macros.h ++++ b/lib/common/portability_macros.h +@@ -128,4 +128,15 @@ + # define ZSTD_ENABLE_ASM_X86_64_BMI2 0 + #endif + ++/* ++ * For x86 ELF targets, add .note.gnu.property section for Intel CET in ++ * assembly sources when CET is enabled. ++ */ ++#if defined(__ELF__) && (defined(__x86_64__) || defined(__i386__)) \ ++ && defined(__has_include) ++# if __has_include() ++# include ++# endif ++#endif ++ + #endif /* ZSTD_PORTABILITY_MACROS_H */ diff --git a/zstd.spec b/zstd.spec index 79fa74f..1dceeb5 100644 --- a/zstd.spec +++ b/zstd.spec @@ -31,7 +31,7 @@ Name: zstd Version: 1.5.1 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Zstd compression library License: BSD and GPLv2 @@ -39,6 +39,7 @@ URL: https://github.com/facebook/zstd Source0: https://github.com/facebook/zstd/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz Patch1: pzstd.1.patch +Patch2: enable-CET.patch BuildRequires: make BuildRequires: gcc gtest-devel @@ -86,6 +87,7 @@ find -name .gitignore -delete %if %{with pzstd} %patch1 -p1 %endif +%patch2 -p1 %build export CFLAGS="$RPM_OPT_FLAGS" @@ -153,6 +155,9 @@ install -D -m644 programs/%{name}.1 %{buildroot}%{_mandir}/man1/p%{name}.1 %ldconfig_scriptlets -n lib%{name} %changelog +* Tue Jan 11 2022 Pádraig Brady - 1.5.1-6 +- Re-enable CET protections (#2039353) + * Fri Jan 07 2022 Michel Alexandre Salim - 1.5.1-5 - Enable gz, .xz/.lzma and .lz4 support From 50c2ef6dcd3bd0a6f84f8736392d889267ed90f3 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 22 Jan 2022 05:57:12 +0000 Subject: [PATCH 09/29] - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- zstd.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zstd.spec b/zstd.spec index 1dceeb5..4b3e84a 100644 --- a/zstd.spec +++ b/zstd.spec @@ -31,7 +31,7 @@ Name: zstd Version: 1.5.1 -Release: 6%{?dist} +Release: 7%{?dist} Summary: Zstd compression library License: BSD and GPLv2 @@ -155,6 +155,9 @@ install -D -m644 programs/%{name}.1 %{buildroot}%{_mandir}/man1/p%{name}.1 %ldconfig_scriptlets -n lib%{name} %changelog +* Sat Jan 22 2022 Fedora Release Engineering - 1.5.1-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + * Tue Jan 11 2022 Pádraig Brady - 1.5.1-6 - Re-enable CET protections (#2039353) From 670726ba7614b4af9a1c17b65bfa83c33e2e8310 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= Date: Sat, 22 Jan 2022 16:22:20 +0000 Subject: [PATCH 10/29] latest upstream (1.5.2) --- .gitignore | 1 + pzstd.1.patch | 17 ++++++++--------- sources | 2 +- zstd.spec | 19 ++++++++----------- 4 files changed, 18 insertions(+), 21 deletions(-) diff --git a/.gitignore b/.gitignore index 9a46aab..f474108 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ /zstd-1.4.9.tar.gz /zstd-1.5.0.tar.gz /zstd-1.5.1.tar.gz +/zstd-1.5.2.tar.gz diff --git a/pzstd.1.patch b/pzstd.1.patch index d4e3a1f..30243d4 100644 --- a/pzstd.1.patch +++ b/pzstd.1.patch @@ -1,9 +1,9 @@ -diff -Naur zstd-1.5.1.orig/programs/zstd.1 zstd-1.5.1/programs/zstd.1 ---- zstd-1.5.1.orig/programs/zstd.1 2021-12-20 22:49:18.000000000 +0000 -+++ zstd-1.5.1/programs/zstd.1 2021-12-22 16:49:17.160850340 +0000 -@@ -146,6 +146,14 @@ - \fB\-\-show\-default\-cparams\fR: Shows the default compression parameters that will be used for a particular src file\. If the provided src file is not a regular file (eg\. named pipe), the cli will just output the default parameters\. That is, the parameters that are used when the src size is unknown\. - .IP "\[ci]" 4 +diff -Naur zstd-1.5.2.orig/programs/zstd.1 zstd-1.5.2/programs/zstd.1 +--- zstd-1.5.2.orig/programs/zstd.1 2022-01-20 21:17:18.000000000 +0000 ++++ zstd-1.5.2/programs/zstd.1 2022-01-22 17:40:54.130314058 +0000 +@@ -214,6 +214,13 @@ + . + .IP "\(bu" 4 \fB\-\-\fR: All arguments after \fB\-\-\fR are treated as files + +.SH Parallel Zstd OPTIONS @@ -12,7 +12,6 @@ diff -Naur zstd-1.5.1.orig/programs/zstd.1 zstd-1.5.1/programs/zstd.1 +.BR \-p ", " --processes + number of threads to use for (de)compression (default:4) + -+ + . .IP "" 0 - .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 and \fBZSTD_NBTHREADS\fR are currently supported\. They set the compression level and number of threads to use during compression, respectively\. + . diff --git a/sources b/sources index 8d53d3a..964fe72 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (zstd-1.5.1.tar.gz) = 00c7f5f6f6a2b51557f3ede56026d54d8e023c85f9824496f4522524ce8ced495e88d56452e3510df6ec1bf53e659b2633cdcc84d016bcdbfdcc76e142d3620f +SHA512 (zstd-1.5.2.tar.gz) = 96dbd2eb6623e3564a0fd36489b61bc3cb27758a584fdc9f064f3985d2e8b5605d7022890d00a6d15464d3cd0707d7e75d8cf6210323782d0af406b90a6d6784 diff --git a/zstd.spec b/zstd.spec index 4b3e84a..330ddf5 100644 --- a/zstd.spec +++ b/zstd.spec @@ -1,3 +1,6 @@ +# enable asm implementations by default +%bcond_without asm + # enable .lz4 support by default %bcond_without lz4 @@ -20,18 +23,9 @@ %endif %endif -%ifarch x86_64 -%bcond_without asm -%else -# Disable asm to ensure non excutable stack -# used on archs where asm not actually used -# https://github.com/facebook/zstd/issues/2963 -%bcond_with asm -%endif - Name: zstd -Version: 1.5.1 -Release: 7%{?dist} +Version: 1.5.2 +Release: 1%{?dist} Summary: Zstd compression library License: BSD and GPLv2 @@ -155,6 +149,9 @@ install -D -m644 programs/%{name}.1 %{buildroot}%{_mandir}/man1/p%{name}.1 %ldconfig_scriptlets -n lib%{name} %changelog +* Sat Jan 22 2022 Pádraig Brady - 1.5.2-1 +- Latest upstream + * Sat Jan 22 2022 Fedora Release Engineering - 1.5.1-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild From cabed16e08080d759c7d2d6cd00da763bfec3f39 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Thu, 19 May 2022 10:14:55 +0100 Subject: [PATCH 11/29] Build pzst on all arches The pzst build works now on ARMv7/aarch64 as well as POWER and Z-Series. Also RHEL-6 is EOL so drop all pzst exceptions and just build it everywhere, but leave the conditionals so it can still be adjusted for specific cases if necessary. --- zstd.spec | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/zstd.spec b/zstd.spec index 330ddf5..4379e40 100644 --- a/zstd.spec +++ b/zstd.spec @@ -10,22 +10,12 @@ # enable .gz support by default %bcond_without zlib -%if 0%{?rhel} && 0%{?rhel} <= 6 -# gcc-4.4 is currently too old to compile pzstd -%bcond_with pzstd -%else -%ifarch %{ix86} x86_64 +# enable pzstd support by default %bcond_without pzstd -%else -# aarch64 and armv7hl at least currently segfault -# in ThreadPool test for the pzstd util -%bcond_with pzstd -%endif -%endif Name: zstd Version: 1.5.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Zstd compression library License: BSD and GPLv2 @@ -149,6 +139,9 @@ install -D -m644 programs/%{name}.1 %{buildroot}%{_mandir}/man1/p%{name}.1 %ldconfig_scriptlets -n lib%{name} %changelog +* Thu May 19 2022 Peter Robinson - 1.5.2-2 +- ThreadPool segfault fixed so build pzst everywhere + * Sat Jan 22 2022 Pádraig Brady - 1.5.2-1 - Latest upstream From 8151519d6452b379731831f1056d93fd2dd0383e Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 23 Jul 2022 14:01:14 +0000 Subject: [PATCH 12/29] Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- zstd.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zstd.spec b/zstd.spec index 4379e40..f8b38d4 100644 --- a/zstd.spec +++ b/zstd.spec @@ -15,7 +15,7 @@ Name: zstd Version: 1.5.2 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Zstd compression library License: BSD and GPLv2 @@ -139,6 +139,9 @@ install -D -m644 programs/%{name}.1 %{buildroot}%{_mandir}/man1/p%{name}.1 %ldconfig_scriptlets -n lib%{name} %changelog +* Sat Jul 23 2022 Fedora Release Engineering - 1.5.2-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + * Thu May 19 2022 Peter Robinson - 1.5.2-2 - ThreadPool segfault fixed so build pzst everywhere From 92d17ea9c7158f892c2a860faa8d892b7744c0e3 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 21 Jan 2023 08:21:58 +0000 Subject: [PATCH 13/29] Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- zstd.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zstd.spec b/zstd.spec index f8b38d4..69bdeb1 100644 --- a/zstd.spec +++ b/zstd.spec @@ -15,7 +15,7 @@ Name: zstd Version: 1.5.2 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Zstd compression library License: BSD and GPLv2 @@ -139,6 +139,9 @@ install -D -m644 programs/%{name}.1 %{buildroot}%{_mandir}/man1/p%{name}.1 %ldconfig_scriptlets -n lib%{name} %changelog +* Sat Jan 21 2023 Fedora Release Engineering - 1.5.2-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + * Sat Jul 23 2022 Fedora Release Engineering - 1.5.2-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild From f0d571d4350708caa918703dbdb34b7e4385e6f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= Date: Mon, 13 Feb 2023 12:41:06 +0000 Subject: [PATCH 14/29] latest upstream (1.5.4) --- .gitignore | 1 + enable-CET.patch | 38 -------------------------------------- pzstd.1.patch | 16 ++++++++-------- sources | 2 +- zstd.spec | 9 +++++---- 5 files changed, 15 insertions(+), 51 deletions(-) delete mode 100644 enable-CET.patch diff --git a/.gitignore b/.gitignore index f474108..ed3ca1e 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ /zstd-1.5.0.tar.gz /zstd-1.5.1.tar.gz /zstd-1.5.2.tar.gz +/zstd-1.5.4.tar.gz diff --git a/enable-CET.patch b/enable-CET.patch deleted file mode 100644 index 335e95d..0000000 --- a/enable-CET.patch +++ /dev/null @@ -1,38 +0,0 @@ -From cd7620a730413a48843e175d34dc408c152f8125 Mon Sep 17 00:00:00 2001 -From: "H.J. Lu" -Date: Tue, 11 Jan 2022 07:28:25 -0800 -Subject: [PATCH] x86-64: Enable Intel CET - -Intel Control-flow Enforcement Technology (CET): - -https://en.wikipedia.org/wiki/Control-flow_integrity#Intel_Control-flow_Enforcement_Technology - -requires that on Linux, all linker input files are marked as CET enabled -in .note.gnu.property section. For high-level language source codes, -.note.gnu.property section is added by compiler with the -fcf-protection -option. For assembly sources, include to add .note.gnu.property -section. ---- - lib/common/portability_macros.h | 11 +++++++++++ - 1 file changed, 11 insertions(+) - -diff --git a/lib/common/portability_macros.h b/lib/common/portability_macros.h -index 627ef9eed4..6ac4b05510 100644 ---- a/lib/common/portability_macros.h -+++ b/lib/common/portability_macros.h -@@ -128,4 +128,15 @@ - # define ZSTD_ENABLE_ASM_X86_64_BMI2 0 - #endif - -+/* -+ * For x86 ELF targets, add .note.gnu.property section for Intel CET in -+ * assembly sources when CET is enabled. -+ */ -+#if defined(__ELF__) && (defined(__x86_64__) || defined(__i386__)) \ -+ && defined(__has_include) -+# if __has_include() -+# include -+# endif -+#endif -+ - #endif /* ZSTD_PORTABILITY_MACROS_H */ diff --git a/pzstd.1.patch b/pzstd.1.patch index 30243d4..e6016c7 100644 --- a/pzstd.1.patch +++ b/pzstd.1.patch @@ -1,9 +1,9 @@ -diff -Naur zstd-1.5.2.orig/programs/zstd.1 zstd-1.5.2/programs/zstd.1 ---- zstd-1.5.2.orig/programs/zstd.1 2022-01-20 21:17:18.000000000 +0000 -+++ zstd-1.5.2/programs/zstd.1 2022-01-22 17:40:54.130314058 +0000 -@@ -214,6 +214,13 @@ - . - .IP "\(bu" 4 +diff -Naur zstd-1.5.4/programs/zstd.1 zstd-1.5.4.new/programs/zstd.1 +--- zstd-1.5.4/programs/zstd.1 2023-02-10 00:41:50.000000000 +0000 ++++ zstd-1.5.4.new/programs/zstd.1 2023-02-13 12:44:01.575160149 +0000 +@@ -162,6 +162,13 @@ + \fB\-\-show\-default\-cparams\fR: shows the default compression parameters that will be used for a particular input file, based on the provided compression level and the input size\. If the provided file is not a regular file (e\.g\. a pipe), this flag will output the parameters used for inputs of unknown size\. + .IP "\[ci]" 4 \fB\-\-\fR: All arguments after \fB\-\-\fR are treated as files + +.SH Parallel Zstd OPTIONS @@ -12,6 +12,6 @@ diff -Naur zstd-1.5.2.orig/programs/zstd.1 zstd-1.5.2/programs/zstd.1 +.BR \-p ", " --processes + number of threads to use for (de)compression (default:4) + - . .IP "" 0 - . + .SS "gzip Operation Modifiers" + When invoked via a \fBgzip\fR symlink, \fBzstd\fR will support further options that intend to mimic the \fBgzip\fR behavior: diff --git a/sources b/sources index 964fe72..1350cae 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (zstd-1.5.2.tar.gz) = 96dbd2eb6623e3564a0fd36489b61bc3cb27758a584fdc9f064f3985d2e8b5605d7022890d00a6d15464d3cd0707d7e75d8cf6210323782d0af406b90a6d6784 +SHA512 (zstd-1.5.4.tar.gz) = 2896a6dd6b60cc251720356babcbab6018c874eb2149121b26e28041496fc355a9cb5fd1b39c91558fcfbafb789b3d721264a0f9b5734f893d5f3cdf97016394 diff --git a/zstd.spec b/zstd.spec index 69bdeb1..51dcbe9 100644 --- a/zstd.spec +++ b/zstd.spec @@ -14,8 +14,8 @@ %bcond_without pzstd Name: zstd -Version: 1.5.2 -Release: 4%{?dist} +Version: 1.5.4 +Release: 1%{?dist} Summary: Zstd compression library License: BSD and GPLv2 @@ -23,7 +23,6 @@ URL: https://github.com/facebook/zstd Source0: https://github.com/facebook/zstd/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz Patch1: pzstd.1.patch -Patch2: enable-CET.patch BuildRequires: make BuildRequires: gcc gtest-devel @@ -71,7 +70,6 @@ find -name .gitignore -delete %if %{with pzstd} %patch1 -p1 %endif -%patch2 -p1 %build export CFLAGS="$RPM_OPT_FLAGS" @@ -139,6 +137,9 @@ install -D -m644 programs/%{name}.1 %{buildroot}%{_mandir}/man1/p%{name}.1 %ldconfig_scriptlets -n lib%{name} %changelog +* Mon Feb 13 2023 Pádraig Brady - 1.5.4-1 +- Latest upstream + * Sat Jan 21 2023 Fedora Release Engineering - 1.5.2-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild From 2961884099301e6cfd23d958683dc80581197638 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= Date: Wed, 5 Apr 2023 13:24:11 +0100 Subject: [PATCH 15/29] latest upstream (1.5.5) --- .gitignore | 1 + sources | 2 +- zstd.spec | 5 ++++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index ed3ca1e..dfa152b 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ /zstd-1.5.1.tar.gz /zstd-1.5.2.tar.gz /zstd-1.5.4.tar.gz +/zstd-1.5.5.tar.gz diff --git a/sources b/sources index 1350cae..076932c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (zstd-1.5.4.tar.gz) = 2896a6dd6b60cc251720356babcbab6018c874eb2149121b26e28041496fc355a9cb5fd1b39c91558fcfbafb789b3d721264a0f9b5734f893d5f3cdf97016394 +SHA512 (zstd-1.5.5.tar.gz) = 99109ec0e07fa65c2101c9cb36be56b672bbd0ee69d265f924718e61f9192ae8385c8d9e4d0c318be9edfa6d849fd3d60e5f164fa120961449429ea3c5dab6b6 diff --git a/zstd.spec b/zstd.spec index 51dcbe9..168b2f1 100644 --- a/zstd.spec +++ b/zstd.spec @@ -14,7 +14,7 @@ %bcond_without pzstd Name: zstd -Version: 1.5.4 +Version: 1.5.5 Release: 1%{?dist} Summary: Zstd compression library @@ -137,6 +137,9 @@ install -D -m644 programs/%{name}.1 %{buildroot}%{_mandir}/man1/p%{name}.1 %ldconfig_scriptlets -n lib%{name} %changelog +* Wed Apr 05 2023 Pádraig Brady - 1.5.5-1 +- Latest upstream + * Mon Feb 13 2023 Pádraig Brady - 1.5.4-1 - Latest upstream From 5d222742bf9a2e1a70faf7faca8fe633c3af0f32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zaoral?= Date: Thu, 13 Apr 2023 15:06:18 +0200 Subject: [PATCH 16/29] migrate to SPDX license format --- zstd.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/zstd.spec b/zstd.spec index 168b2f1..e414091 100644 --- a/zstd.spec +++ b/zstd.spec @@ -15,10 +15,10 @@ Name: zstd Version: 1.5.5 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Zstd compression library -License: BSD and GPLv2 +License: BSD-3-Clause AND GPL-2.0-only URL: https://github.com/facebook/zstd Source0: https://github.com/facebook/zstd/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz @@ -137,6 +137,9 @@ install -D -m644 programs/%{name}.1 %{buildroot}%{_mandir}/man1/p%{name}.1 %ldconfig_scriptlets -n lib%{name} %changelog +* Thu Apr 13 2023 Lukáš Zaoral - 1.5.5-2 +- migrate to SPDX license format + * Wed Apr 05 2023 Pádraig Brady - 1.5.5-1 - Latest upstream From 8eb76c98836767951a1c9772cc483c88c0b27869 Mon Sep 17 00:00:00 2001 From: Jiri Kucera Date: Thu, 22 Jun 2023 13:09:22 +0200 Subject: [PATCH 17/29] Drop gtest on ELN/RHEL --- zstd.spec | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/zstd.spec b/zstd.spec index e414091..76c851e 100644 --- a/zstd.spec +++ b/zstd.spec @@ -13,9 +13,12 @@ # enable pzstd support by default %bcond_without pzstd +# Disable gtest on RHEL +%bcond gtest %[ !0%{?rhel} ] + Name: zstd Version: 1.5.5 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Zstd compression library License: BSD-3-Clause AND GPL-2.0-only @@ -25,7 +28,7 @@ Source0: https://github.com/facebook/zstd/archive/v%{version}.tar.gz#/%{n Patch1: pzstd.1.patch BuildRequires: make -BuildRequires: gcc gtest-devel +BuildRequires: gcc %{?with_gtest:gtest-devel} %if %{with lz4} BuildRequires: lz4-devel %endif @@ -89,7 +92,7 @@ execstack lib/libzstd.so.1 export CFLAGS="$RPM_OPT_FLAGS" export LDFLAGS="$RPM_LD_FLAGS" make -C tests test-zstd -%if %{with pzstd} +%if %{with pzstd} && %{with gtest} export CXXFLAGS="$RPM_OPT_FLAGS" make -C contrib/pzstd test %endif @@ -137,6 +140,9 @@ install -D -m644 programs/%{name}.1 %{buildroot}%{_mandir}/man1/p%{name}.1 %ldconfig_scriptlets -n lib%{name} %changelog +* Thu Jun 22 2023 Jiří Kučera - 1.5.5-3 +- Drop gtest on RHEL (c9s backport) + * Thu Apr 13 2023 Lukáš Zaoral - 1.5.5-2 - migrate to SPDX license format From 2edb511140d8b2cca51248548e74aa9d5af9cd25 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 22 Jul 2023 19:48:12 +0000 Subject: [PATCH 18/29] Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- zstd.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zstd.spec b/zstd.spec index 76c851e..807dec2 100644 --- a/zstd.spec +++ b/zstd.spec @@ -18,7 +18,7 @@ Name: zstd Version: 1.5.5 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Zstd compression library License: BSD-3-Clause AND GPL-2.0-only @@ -140,6 +140,9 @@ install -D -m644 programs/%{name}.1 %{buildroot}%{_mandir}/man1/p%{name}.1 %ldconfig_scriptlets -n lib%{name} %changelog +* Sat Jul 22 2023 Fedora Release Engineering - 1.5.5-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + * Thu Jun 22 2023 Jiří Kučera - 1.5.5-3 - Drop gtest on RHEL (c9s backport) From d18a56dca7cf81a38aad3ec963127fdb439bf6e7 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 27 Jan 2024 11:18:52 +0000 Subject: [PATCH 19/29] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- zstd.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zstd.spec b/zstd.spec index 807dec2..0201bd7 100644 --- a/zstd.spec +++ b/zstd.spec @@ -18,7 +18,7 @@ Name: zstd Version: 1.5.5 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Zstd compression library License: BSD-3-Clause AND GPL-2.0-only @@ -140,6 +140,9 @@ install -D -m644 programs/%{name}.1 %{buildroot}%{_mandir}/man1/p%{name}.1 %ldconfig_scriptlets -n lib%{name} %changelog +* Sat Jan 27 2024 Fedora Release Engineering - 1.5.5-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Sat Jul 22 2023 Fedora Release Engineering - 1.5.5-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild From 4174c35b40e994e9abf6911756e60481ff43e395 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= Date: Fri, 29 Mar 2024 11:40:02 +0000 Subject: [PATCH 20/29] latest upstream (1.5.6) Also remove the pzstd patch to the man page as zstd has inbuilt parallelism support now (and associated options). --- .gitignore | 1 + pzstd.1.patch | 17 ----------------- sources | 2 +- zstd.spec | 12 +++++------- 4 files changed, 7 insertions(+), 25 deletions(-) delete mode 100644 pzstd.1.patch diff --git a/.gitignore b/.gitignore index dfa152b..a140781 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ /zstd-1.5.2.tar.gz /zstd-1.5.4.tar.gz /zstd-1.5.5.tar.gz +/zstd-1.5.6.tar.gz diff --git a/pzstd.1.patch b/pzstd.1.patch deleted file mode 100644 index e6016c7..0000000 --- a/pzstd.1.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff -Naur zstd-1.5.4/programs/zstd.1 zstd-1.5.4.new/programs/zstd.1 ---- zstd-1.5.4/programs/zstd.1 2023-02-10 00:41:50.000000000 +0000 -+++ zstd-1.5.4.new/programs/zstd.1 2023-02-13 12:44:01.575160149 +0000 -@@ -162,6 +162,13 @@ - \fB\-\-show\-default\-cparams\fR: shows the default compression parameters that will be used for a particular input file, based on the provided compression level and the input size\. If the provided file is not a regular file (e\.g\. a pipe), this flag will output the parameters used for inputs of unknown size\. - .IP "\[ci]" 4 - \fB\-\-\fR: All arguments after \fB\-\-\fR are treated as files -+ -+.SH Parallel Zstd OPTIONS -+Additional options for the pzstd utility -+.TP -+.BR \-p ", " --processes -+ number of threads to use for (de)compression (default:4) -+ - .IP "" 0 - .SS "gzip Operation Modifiers" - When invoked via a \fBgzip\fR symlink, \fBzstd\fR will support further options that intend to mimic the \fBgzip\fR behavior: diff --git a/sources b/sources index 076932c..bb186a9 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (zstd-1.5.5.tar.gz) = 99109ec0e07fa65c2101c9cb36be56b672bbd0ee69d265f924718e61f9192ae8385c8d9e4d0c318be9edfa6d849fd3d60e5f164fa120961449429ea3c5dab6b6 +SHA512 (zstd-1.5.6.tar.gz) = 54a578f2484da0520a6e9a24f501b9540a3fe3806785d6bc9db79fc095b7c142a7c121387c7eecd460ca71446603584ef1ba4d29a33ca90873338c9ffbd04f14 diff --git a/zstd.spec b/zstd.spec index 0201bd7..fde96ed 100644 --- a/zstd.spec +++ b/zstd.spec @@ -17,16 +17,14 @@ %bcond gtest %[ !0%{?rhel} ] Name: zstd -Version: 1.5.5 -Release: 5%{?dist} +Version: 1.5.6 +Release: 1%{?dist} Summary: Zstd compression library License: BSD-3-Clause AND GPL-2.0-only URL: https://github.com/facebook/zstd Source0: https://github.com/facebook/zstd/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz -Patch1: pzstd.1.patch - BuildRequires: make BuildRequires: gcc %{?with_gtest:gtest-devel} %if %{with lz4} @@ -70,9 +68,6 @@ Static variant of the Zstd library. %prep %setup -q find -name .gitignore -delete -%if %{with pzstd} -%patch1 -p1 -%endif %build export CFLAGS="$RPM_OPT_FLAGS" @@ -140,6 +135,9 @@ install -D -m644 programs/%{name}.1 %{buildroot}%{_mandir}/man1/p%{name}.1 %ldconfig_scriptlets -n lib%{name} %changelog +* Fri Mar 29 2024 Pádraig Brady - 1.5.6-1 +- latest upstream + * Sat Jan 27 2024 Fedora Release Engineering - 1.5.5-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From 06f7838ffd972244437ba2a47fa59cd6166485be Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 20 Jul 2024 10:58:02 +0000 Subject: [PATCH 21/29] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild --- zstd.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zstd.spec b/zstd.spec index fde96ed..cd0afa3 100644 --- a/zstd.spec +++ b/zstd.spec @@ -18,7 +18,7 @@ Name: zstd Version: 1.5.6 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Zstd compression library License: BSD-3-Clause AND GPL-2.0-only @@ -135,6 +135,9 @@ install -D -m644 programs/%{name}.1 %{buildroot}%{_mandir}/man1/p%{name}.1 %ldconfig_scriptlets -n lib%{name} %changelog +* Sat Jul 20 2024 Fedora Release Engineering - 1.5.6-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + * Fri Mar 29 2024 Pádraig Brady - 1.5.6-1 - latest upstream From 455fd9fd6cdd2156a25d9f6a466a37c48f74a4ba Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sun, 19 Jan 2025 16:53:31 +0000 Subject: [PATCH 22/29] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild --- zstd.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zstd.spec b/zstd.spec index cd0afa3..2f77c8a 100644 --- a/zstd.spec +++ b/zstd.spec @@ -18,7 +18,7 @@ Name: zstd Version: 1.5.6 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Zstd compression library License: BSD-3-Clause AND GPL-2.0-only @@ -135,6 +135,9 @@ install -D -m644 programs/%{name}.1 %{buildroot}%{_mandir}/man1/p%{name}.1 %ldconfig_scriptlets -n lib%{name} %changelog +* Sun Jan 19 2025 Fedora Release Engineering - 1.5.6-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + * Sat Jul 20 2024 Fedora Release Engineering - 1.5.6-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild From b4c68c5f7793750290e1dd3eb612731efab56440 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= Date: Thu, 20 Feb 2025 11:44:31 +0000 Subject: [PATCH 23/29] latest upstream (1.5.7) --- .gitignore | 1 + man-pages-1.5.7.patch | 805 ++++++++++++++++++++++++++++++++++++++++++ sources | 2 +- zstd.spec | 10 +- 4 files changed, 815 insertions(+), 3 deletions(-) create mode 100644 man-pages-1.5.7.patch diff --git a/.gitignore b/.gitignore index a140781..c5a18e0 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ /zstd-1.5.4.tar.gz /zstd-1.5.5.tar.gz /zstd-1.5.6.tar.gz +/zstd-1.5.7.tar.gz diff --git a/man-pages-1.5.7.patch b/man-pages-1.5.7.patch new file mode 100644 index 0000000..7ef0a5a --- /dev/null +++ b/man-pages-1.5.7.patch @@ -0,0 +1,805 @@ +From 6af3842118ea5325480b403213b2a9fbed3d3d74 Mon Sep 17 00:00:00 2001 +From: Yann Collet +Date: Wed, 19 Feb 2025 16:25:00 -0800 +Subject: [PATCH] updated man pages and manual + +fixes #4301 +--- + doc/zstd_manual.html | 55 +++++---- + programs/zstd.1 | 260 +++++++++++++++++++++++++++++++++++++------ + programs/zstdgrep.1 | 2 +- + programs/zstdless.1 | 2 +- + 4 files changed, 257 insertions(+), 62 deletions(-) + +diff --git a/doc/zstd_manual.html b/doc/zstd_manual.html +index 485d5eafbe9..89f0761f492 100644 +--- a/doc/zstd_manual.html ++++ b/doc/zstd_manual.html +@@ -110,6 +110,7 @@

Decompression helper functions


+ - ZSTD_CONTENTSIZE_UNKNOWN if the size cannot be determined + - ZSTD_CONTENTSIZE_ERROR if an error occurred (e.g. invalid magic number, srcSize too small) + note 1 : a 0 return value means the frame is valid but "empty". ++ When invoking this method on a skippable frame, it will return 0. + note 2 : decompressed size is an optional field, it may not be present (typically in streaming mode). + When `return==ZSTD_CONTENTSIZE_UNKNOWN`, data to decompress could be any size. + In which case, it's necessary to use streaming mode to decompress data. +@@ -128,9 +129,8 @@

Decompression helper functions


+


+ +
ZSTD_DEPRECATED("Replaced by ZSTD_getFrameContentSize")
+-ZSTDLIB_API
+ unsigned long long ZSTD_getDecompressedSize(const void* src, size_t srcSize);
+-

NOTE: This function is now obsolete, in favor of ZSTD_getFrameContentSize(). ++

This function is now obsolete, in favor of ZSTD_getFrameContentSize(). + Both functions work the same way, but ZSTD_getDecompressedSize() blends + "empty", "unknown" and "error" results to the same return value (0), + while ZSTD_getFrameContentSize() gives them separate return values. +@@ -142,7 +142,12 @@

Decompression helper functions


+ `srcSize` must be >= first frame size + @return : the compressed size of the first frame starting at `src`, + suitable to pass as `srcSize` to `ZSTD_decompress` or similar, +- or an error code if input is invalid ++ or an error code if input is invalid ++ Note 1: this method is called _find*() because it's not enough to read the header, ++ it may have to scan through the frame's content, to reach its end. ++ Note 2: this method also works with Skippable Frames. In which case, ++ it returns the size of the complete skippable frame, ++ which is always equal to its content size + 8 bytes for headers. +


+ +

Compression helper functions


+@@ -166,8 +171,7 @@

Compression helper functions


+ +


+ +-

Error helper functions

#include "zstd_errors.h" /* list of errors */
+-/* ZSTD_isError() :
++

Error helper functions

/* ZSTD_isError() :
+  * Most ZSTD_* functions returning a size_t value can be tested for error,
+  * using ZSTD_isError().
+  * @return 1 if error, 0 otherwise
+@@ -1239,7 +1243,7 @@ 

Streaming decompression functions


+


+ +
ZSTDLIB_STATIC_API size_t ZSTD_frameHeaderSize(const void* src, size_t srcSize);
+-

srcSize must be >= ZSTD_FRAMEHEADERSIZE_PREFIX. ++

srcSize must be large enough, aka >= ZSTD_FRAMEHEADERSIZE_PREFIX. + @return : size of the Frame Header, + or an error code (if srcSize is too small) +


+@@ -1252,20 +1256,20 @@

Streaming decompression functions


+ unsigned blockSizeMax; + ZSTD_FrameType_e frameType;
/* if == ZSTD_skippableFrame, frameContentSize is the size of skippable content */ + unsigned headerSize; +- unsigned dictID; ++ unsigned dictID; /* for ZSTD_skippableFrame, contains the skippable magic variant [0-15] */ + unsigned checksumFlag; + unsigned _reserved1; + unsigned _reserved2; +-} ZSTD_frameHeader; ++} ZSTD_FrameHeader; +

+-
ZSTDLIB_STATIC_API size_t ZSTD_getFrameHeader(ZSTD_FrameHeader* zfhPtr, const void* src, size_t srcSize);   /**< doesn't consume input */
++
ZSTDLIB_STATIC_API size_t ZSTD_getFrameHeader(ZSTD_FrameHeader* zfhPtr, const void* src, size_t srcSize);
+ /*! ZSTD_getFrameHeader_advanced() :
+  *  same as ZSTD_getFrameHeader(),
+  *  with added capability to select a format (like ZSTD_f_zstd1_magicless) */
+ ZSTDLIB_STATIC_API size_t ZSTD_getFrameHeader_advanced(ZSTD_FrameHeader* zfhPtr, const void* src, size_t srcSize, ZSTD_format_e format);
+-

decode Frame Header, or requires larger `srcSize`. +- @return : 0, `zfhPtr` is correctly filled, +- >0, `srcSize` is too small, value is wanted `srcSize` amount, ++

decode Frame Header into `zfhPtr`, or requires larger `srcSize`. ++ @return : 0 => header is complete, `zfhPtr` is correctly filled, ++ >0 => `srcSize` is too small, @return value is the wanted `srcSize` amount, `zfhPtr` is not filled, + or an error code, which can be tested using ZSTD_isError() +


+ +@@ -1421,7 +1425,7 @@

Streaming decompression functions


+ ZSTD_compressSequencesAndLiterals(ZSTD_CCtx* cctx, + void* dst, size_t dstCapacity, + const ZSTD_Sequence* inSeqs, size_t nbSequences, +- const void* literals, size_t litSize, size_t litCapacity, ++ const void* literals, size_t litSize, size_t litBufCapacity, + size_t decompressedSize); +

This is a variant of ZSTD_compressSequences() which, + instead of receiving (src,srcSize) as input parameter, receives (literals,litSize), +@@ -1435,20 +1439,22 @@

Streaming decompression functions


+ - Not compatible with frame checksum, which must be disabled + - If any block is incompressible, will fail and return an error + - @litSize must be == sum of all @.litLength fields in @inSeqs. Any discrepancy will generate an error. +- - the buffer @literals must have a size @litCapacity which is larger than @litSize by at least 8 bytes. ++ - @litBufCapacity is the size of the underlying buffer into which literals are written, starting at address @literals. ++ @litBufCapacity must be at least 8 bytes larger than @litSize. + - @decompressedSize must be correct, and correspond to the sum of all Sequences. Any discrepancy will generate an error. + @return : final compressed size, or a ZSTD error code. + +


+ +
ZSTDLIB_STATIC_API size_t ZSTD_writeSkippableFrame(void* dst, size_t dstCapacity,
+-                                const void* src, size_t srcSize, unsigned magicVariant);
++                                 const void* src, size_t srcSize,
++                                       unsigned magicVariant);
+ 

Generates a zstd skippable frame containing data given by src, and writes it to dst buffer. + + Skippable frames begin with a 4-byte magic number. There are 16 possible choices of magic number, + ranging from ZSTD_MAGIC_SKIPPABLE_START to ZSTD_MAGIC_SKIPPABLE_START+15. +- As such, the parameter magicVariant controls the exact skippable frame magic number variant used, so +- the magic number used will be ZSTD_MAGIC_SKIPPABLE_START + magicVariant. ++ As such, the parameter magicVariant controls the exact skippable frame magic number variant used, ++ so the magic number used will be ZSTD_MAGIC_SKIPPABLE_START + magicVariant. + + Returns an error if destination buffer is not large enough, if the source size is not representable + with a 4-byte unsigned int, or if the parameter magicVariant is greater than 15 (and therefore invalid). +@@ -1457,13 +1463,14 @@

Streaming decompression functions


+ +


+ +-
size_t ZSTD_readSkippableFrame(void* dst, size_t dstCapacity, unsigned* magicVariant,
+-                                const void* src, size_t srcSize);
+-

Retrieves a zstd skippable frame containing data given by src, and writes it to dst buffer. ++

ZSTDLIB_STATIC_API size_t ZSTD_readSkippableFrame(void* dst, size_t dstCapacity,
++                                      unsigned* magicVariant,
++                                      const void* src, size_t srcSize);
++

Retrieves the content of a zstd skippable frame starting at @src, and writes it to @dst buffer. + +- The parameter magicVariant will receive the magicVariant that was supplied when the frame was written, +- i.e. magicNumber - ZSTD_MAGIC_SKIPPABLE_START. This can be NULL if the caller is not interested +- in the magicVariant. ++ The parameter @magicVariant will receive the magicVariant that was supplied when the frame was written, ++ i.e. magicNumber - ZSTD_MAGIC_SKIPPABLE_START. ++ This can be NULL if the caller is not interested in the magicVariant. + + Returns an error if destination buffer is not large enough, or if the frame is not skippable. + +@@ -1471,7 +1478,7 @@

Streaming decompression functions


+ +


+ +-
unsigned ZSTD_isSkippableFrame(const void* buffer, size_t size);
++
ZSTDLIB_STATIC_API unsigned ZSTD_isSkippableFrame(const void* buffer, size_t size);
+ 

Tells if the content of `buffer` starts with a valid Frame Identifier for a skippable frame. + +


+diff --git a/programs/zstd.1 b/programs/zstd.1 +index 5f1519f3323..5503a5b86f4 100644 +--- a/programs/zstd.1 ++++ b/programs/zstd.1 +@@ -1,392 +1,580 @@ +-.TH "ZSTD" "1" "October 2024" "zstd 1.5.6" "User Commands" ++. ++.TH "ZSTD" "1" "February 2025" "zstd 1.5.7" "User Commands" ++. + .SH "NAME" + \fBzstd\fR \- zstd, zstdmt, unzstd, zstdcat \- Compress or decompress \.zst files ++. + .SH "SYNOPSIS" +-.TS +-allbox; +-\fBzstd\fR [\fIOPTIONS\fR] [\- \fIINPUT\-FILE\fR] [\-o \fIOUTPUT\-FILE\fR] +-.TE ++\fBzstd\fR [\fIOPTIONS\fR] [\-|\fIINPUT\-FILE\fR] [\-o \fIOUTPUT\-FILE\fR] ++. + .P + \fBzstdmt\fR is equivalent to \fBzstd \-T0\fR ++. + .P + \fBunzstd\fR is equivalent to \fBzstd \-d\fR ++. + .P + \fBzstdcat\fR is equivalent to \fBzstd \-dcf\fR ++. + .SH "DESCRIPTION" + \fBzstd\fR is a fast lossless compression algorithm and data compression tool, with command line syntax similar to \fBgzip\fR(1) and \fBxz\fR(1)\. It is based on the \fBLZ77\fR family, with further FSE & huff0 entropy stages\. \fBzstd\fR offers highly configurable compression speed, from fast modes at > 200 MB/s per core, to strong modes with excellent compression ratios\. It also features a very fast decoder, with speeds > 500 MB/s per core, which remains roughly stable at all compression settings\. ++. + .P + \fBzstd\fR command line syntax is generally similar to gzip, but features the following few differences: ++. + .IP "\(bu" 4 +-Source files are preserved by default\. It's possible to remove them automatically by using the \fB\-\-rm\fR command\. ++Source files are preserved by default\. It\'s possible to remove them automatically by using the \fB\-\-rm\fR command\. ++. + .IP "\(bu" 4 + When compressing a single file, \fBzstd\fR displays progress notifications and result summary by default\. Use \fB\-q\fR to turn them off\. ++. + .IP "\(bu" 4 + \fBzstd\fR displays a short help page when command line is an error\. Use \fB\-q\fR to turn it off\. ++. + .IP "\(bu" 4 +-\fBzstd\fR does not accept input from console, though it does accept \fBstdin\fR when it's not the console\. ++\fBzstd\fR does not accept input from console, though it does accept \fBstdin\fR when it\'s not the console\. ++. + .IP "\(bu" 4 +-\fBzstd\fR does not store the input's filename or attributes, only its contents\. ++\fBzstd\fR does not store the input\'s filename or attributes, only its contents\. ++. + .IP "" 0 ++. + .P + \fBzstd\fR processes each \fIfile\fR according to the selected operation mode\. If no \fIfiles\fR are given or \fIfile\fR is \fB\-\fR, \fBzstd\fR reads from standard input and writes the processed data to standard output\. \fBzstd\fR will refuse to write compressed data to standard output if it is a terminal: it will display an error message and skip the file\. Similarly, \fBzstd\fR will refuse to read compressed data from standard input if it is a terminal\. ++. + .P + Unless \fB\-\-stdout\fR or \fB\-o\fR is specified, \fIfiles\fR are written to a new file whose name is derived from the source \fIfile\fR name: ++. + .IP "\(bu" 4 + When compressing, the suffix \fB\.zst\fR is appended to the source filename to get the target filename\. ++. + .IP "\(bu" 4 + When decompressing, the \fB\.zst\fR suffix is removed from the source filename to get the target filename ++. + .IP "" 0 ++. + .SS "Concatenation with \.zst Files" + It is possible to concatenate multiple \fB\.zst\fR files\. \fBzstd\fR will decompress such agglomerated file as if it was a single \fB\.zst\fR file\. ++. + .SH "OPTIONS" ++. + .SS "Integer Suffixes and Special Values" + In most places where an integer argument is expected, an optional suffix is supported to easily indicate large integers\. There must be no space between the integer and the suffix\. ++. + .TP + \fBKiB\fR +-Multiply the integer by 1,024 (2\e^10)\. \fBKi\fR, \fBK\fR, and \fBKB\fR are accepted as synonyms for \fBKiB\fR\. ++Multiply the integer by 1,024 (2^10)\. \fBKi\fR, \fBK\fR, and \fBKB\fR are accepted as synonyms for \fBKiB\fR\. ++. + .TP + \fBMiB\fR +-Multiply the integer by 1,048,576 (2\e^20)\. \fBMi\fR, \fBM\fR, and \fBMB\fR are accepted as synonyms for \fBMiB\fR\. ++Multiply the integer by 1,048,576 (2^20)\. \fBMi\fR, \fBM\fR, and \fBMB\fR are accepted as synonyms for \fBMiB\fR\. ++. + .SS "Operation Mode" + If multiple operation mode options are given, the last one takes effect\. ++. + .TP + \fB\-z\fR, \fB\-\-compress\fR + Compress\. This is the default operation mode when no operation mode option is specified and no other operation mode is implied from the command name (for example, \fBunzstd\fR implies \fB\-\-decompress\fR)\. ++. + .TP + \fB\-d\fR, \fB\-\-decompress\fR, \fB\-\-uncompress\fR + Decompress\. ++. + .TP + \fB\-t\fR, \fB\-\-test\fR + Test the integrity of compressed \fIfiles\fR\. This option is equivalent to \fB\-\-decompress \-\-stdout > /dev/null\fR, decompressed data is discarded and checksummed for errors\. No files are created or removed\. ++. + .TP + \fB\-b#\fR + Benchmark file(s) using compression level \fI#\fR\. See \fIBENCHMARK\fR below for a description of this operation\. ++. + .TP + \fB\-\-train FILES\fR + Use \fIFILES\fR as a training set to create a dictionary\. The training set should contain a lot of small files (> 100)\. See \fIDICTIONARY BUILDER\fR below for a description of this operation\. ++. + .TP + \fB\-l\fR, \fB\-\-list\fR +-Display information related to a zstd compressed file, such as size, ratio, and checksum\. Some of these fields may not be available\. This command's output can be augmented with the \fB\-v\fR modifier\. ++Display information related to a zstd compressed file, such as size, ratio, and checksum\. Some of these fields may not be available\. This command\'s output can be augmented with the \fB\-v\fR modifier\. ++. + .SS "Operation Modifiers" ++. + .IP "\(bu" 4 +-\fB\-#\fR: selects \fB#\fR compression level [1\-19] (default: 3)\. Higher compression levels \fIgenerally\fR produce higher compression ratio at the expense of speed and memory\. A rough rule of thumb is that compression speed is expected to be divided by 2 every 2 levels\. Technically, each level is mapped to a set of advanced parameters (that can also be modified individually, see below)\. Because the compressor's behavior highly depends on the content to compress, there's no guarantee of a smooth progression from one level to another\. ++\fB\-#\fR: selects \fB#\fR compression level [1\-19] (default: 3)\. Higher compression levels \fIgenerally\fR produce higher compression ratio at the expense of speed and memory\. A rough rule of thumb is that compression speed is expected to be divided by 2 every 2 levels\. Technically, each level is mapped to a set of advanced parameters (that can also be modified individually, see below)\. Because the compressor\'s behavior highly depends on the content to compress, there\'s no guarantee of a smooth progression from one level to another\. ++. + .IP "\(bu" 4 + \fB\-\-ultra\fR: unlocks high compression levels 20+ (maximum 22), using a lot more memory\. Note that decompression will also require more memory when using these levels\. ++. + .IP "\(bu" 4 + \fB\-\-fast[=#]\fR: switch to ultra\-fast compression levels\. If \fB=#\fR is not present, it defaults to \fB1\fR\. The higher the value, the faster the compression speed, at the cost of some compression ratio\. This setting overwrites compression level if one was set previously\. Similarly, if a compression level is set after \fB\-\-fast\fR, it overrides it\. ++. + .IP "\(bu" 4 + \fB\-T#\fR, \fB\-\-threads=#\fR: Compress using \fB#\fR working threads (default: 1)\. If \fB#\fR is 0, attempt to detect and use the number of physical CPU cores\. In all cases, the nb of threads is capped to \fBZSTDMT_NBWORKERS_MAX\fR, which is either 64 in 32\-bit mode, or 256 for 64\-bit environments\. This modifier does nothing if \fBzstd\fR is compiled without multithread support\. ++. + .IP "\(bu" 4 + \fB\-\-single\-thread\fR: Use a single thread for both I/O and compression\. As compression is serialized with I/O, this can be slightly slower\. Single\-thread mode features significantly lower memory usage, which can be useful for systems with limited amount of memory, such as 32\-bit systems\. ++. + .IP + Note 1: this mode is the only available one when multithread support is disabled\. ++. + .IP + Note 2: this mode is different from \fB\-T1\fR, which spawns 1 compression thread in parallel with I/O\. Final compressed result is also slightly different from \fB\-T1\fR\. ++. + .IP "\(bu" 4 + \fB\-\-auto\-threads={physical,logical} (default: physical)\fR: When using a default amount of threads via \fB\-T0\fR, choose the default based on the number of detected physical or logical cores\. ++. + .IP "\(bu" 4 + \fB\-\-adapt[=min=#,max=#]\fR: \fBzstd\fR will dynamically adapt compression level to perceived I/O conditions\. Compression level adaptation can be observed live by using command \fB\-v\fR\. Adaptation can be constrained between supplied \fBmin\fR and \fBmax\fR levels\. The feature works when combined with multi\-threading and \fB\-\-long\fR mode\. It does not work with \fB\-\-single\-thread\fR\. It sets window size to 8 MiB by default (can be changed manually, see \fBwlog\fR)\. Due to the chaotic nature of dynamic adaptation, compressed result is not reproducible\. ++. + .IP + \fINote\fR: at the time of this writing, \fB\-\-adapt\fR can remain stuck at low speed when combined with multiple worker threads (>=2)\. ++. + .IP "\(bu" 4 + \fB\-\-long[=#]\fR: enables long distance matching with \fB#\fR \fBwindowLog\fR, if \fB#\fR is not present it defaults to \fB27\fR\. This increases the window size (\fBwindowLog\fR) and memory usage for both the compressor and decompressor\. This setting is designed to improve the compression ratio for files with long matches at a large distance\. ++. + .IP + Note: If \fBwindowLog\fR is set to larger than 27, \fB\-\-long=windowLog\fR or \fB\-\-memory=windowSize\fR needs to be passed to the decompressor\. ++. ++.IP "\(bu" 4 ++\fB\-\-max\fR: set advanced parameters to maximum compression\. warning: this setting is very slow and uses a lot of resources\. It\'s inappropriate for 32\-bit mode and therefore disabled in this mode\. ++. + .IP "\(bu" 4 + \fB\-D DICT\fR: use \fBDICT\fR as Dictionary to compress or decompress FILE(s) ++. + .IP "\(bu" 4 +-\fB\-\-patch\-from FILE\fR: Specify the file to be used as a reference point for zstd's diff engine\. This is effectively dictionary compression with some convenient parameter selection, namely that \fIwindowSize\fR > \fIsrcSize\fR\. ++\fB\-\-patch\-from FILE\fR: Specify the file to be used as a reference point for zstd\'s diff engine\. This is effectively dictionary compression with some convenient parameter selection, namely that \fIwindowSize\fR > \fIsrcSize\fR\. ++. + .IP + Note: cannot use both this and \fB\-D\fR together\. ++. + .IP + Note: \fB\-\-long\fR mode will be automatically activated if \fIchainLog\fR < \fIfileLog\fR (\fIfileLog\fR being the \fIwindowLog\fR required to cover the whole file)\. You can also manually force it\. ++. + .IP +-Note: up to level 15, you can use \fB\-\-patch\-from\fR in \fB\-\-single\-thread\fR mode to improve compression ratio marginally at the cost of speed\. Using '\-\-single\-thread' above level 15 will lead to lower compression ratios\. ++Note: up to level 15, you can use \fB\-\-patch\-from\fR in \fB\-\-single\-thread\fR mode to improve compression ratio marginally at the cost of speed\. Using \'\-\-single\-thread\' above level 15 will lead to lower compression ratios\. ++. + .IP + Note: for level 19, you can get increased compression ratio at the cost of speed by specifying \fB\-\-zstd=targetLength=\fR to be something large (i\.e\. 4096), and by setting a large \fB\-\-zstd=chainLog=\fR\. ++. + .IP "\(bu" 4 +-\fB\-\-rsyncable\fR: \fBzstd\fR will periodically synchronize the compression state to make the compressed file more rsync\-friendly\. There is a negligible impact to compression ratio, and a potential impact to compression speed, perceptible at higher speeds, for example when combining \fB\-\-rsyncable\fR with many parallel worker threads\. This feature does not work with \fB\-\-single\-thread\fR\. You probably don't want to use it with long range mode, since it will decrease the effectiveness of the synchronization points, but your mileage may vary\. ++\fB\-\-rsyncable\fR: \fBzstd\fR will periodically synchronize the compression state to make the compressed file more rsync\-friendly\. There is a negligible impact to compression ratio, and a potential impact to compression speed, perceptible at higher speeds, for example when combining \fB\-\-rsyncable\fR with many parallel worker threads\. This feature does not work with \fB\-\-single\-thread\fR\. You probably don\'t want to use it with long range mode, since it will decrease the effectiveness of the synchronization points, but your mileage may vary\. ++. + .IP "\(bu" 4 + \fB\-C\fR, \fB\-\-[no\-]check\fR: add integrity check computed from uncompressed data (default: enabled) ++. + .IP "\(bu" 4 + \fB\-\-[no\-]content\-size\fR: enable / disable whether or not the original size of the file is placed in the header of the compressed file\. The default option is \fB\-\-content\-size\fR (meaning that the original size will be placed in the header)\. ++. + .IP "\(bu" 4 +-\fB\-\-no\-dictID\fR: do not store dictionary ID within frame header (dictionary compression)\. The decoder will have to rely on implicit knowledge about which dictionary to use, it won't be able to check if it's correct\. ++\fB\-\-no\-dictID\fR: do not store dictionary ID within frame header (dictionary compression)\. The decoder will have to rely on implicit knowledge about which dictionary to use, it won\'t be able to check if it\'s correct\. ++. + .IP "\(bu" 4 + \fB\-M#\fR, \fB\-\-memory=#\fR: Set a memory usage limit\. By default, \fBzstd\fR uses 128 MiB for decompression as the maximum amount of memory the decompressor is allowed to use, but you can override this manually if need be in either direction (i\.e\. you can increase or decrease it)\. ++. + .IP + This is also used during compression when using with \fB\-\-patch\-from=\fR\. In this case, this parameter overrides that maximum size allowed for a dictionary\. (128 MiB)\. ++. + .IP + Additionally, this can be used to limit memory for dictionary training\. This parameter overrides the default limit of 2 GiB\. zstd will load training samples up to the memory limit and ignore the rest\. ++. + .IP "\(bu" 4 + \fB\-\-stream\-size=#\fR: Sets the pledged source size of input coming from a stream\. This value must be exact, as it will be included in the produced frame header\. Incorrect stream sizes will cause an error\. This information will be used to better optimize compression parameters, resulting in better and potentially faster compression, especially for smaller source sizes\. ++. + .IP "\(bu" 4 + \fB\-\-size\-hint=#\fR: When handling input from a stream, \fBzstd\fR must guess how large the source size will be when optimizing compression parameters\. If the stream size is relatively small, this guess may be a poor one, resulting in a higher compression ratio than expected\. This feature allows for controlling the guess when needed\. Exact guesses result in better compression ratios\. Overestimates result in slightly degraded compression ratios, while underestimates may result in significant degradation\. ++. + .IP "\(bu" 4 + \fB\-\-target\-compressed\-block\-size=#\fR: Attempt to produce compressed blocks of approximately this size\. This will split larger blocks in order to approach this target\. This feature is notably useful for improved latency, when the receiver can leverage receiving early incomplete data\. This parameter defines a loose target: compressed blocks will target this size "on average", but individual blocks can still be larger or smaller\. Enabling this feature can decrease compression speed by up to ~10% at level 1\. Higher levels will see smaller relative speed regression, becoming invisible at higher settings\. ++. + .IP "\(bu" 4 + \fB\-f\fR, \fB\-\-force\fR: disable input and output checks\. Allows overwriting existing files, input from console, output to stdout, operating on links, block devices, etc\. During decompression and when the output destination is stdout, pass\-through unrecognized formats as\-is\. ++. + .IP "\(bu" 4 + \fB\-c\fR, \fB\-\-stdout\fR: write to standard output (even if it is the console); keep original files (disable \fB\-\-rm\fR)\. ++. + .IP "\(bu" 4 + \fB\-o FILE\fR: save result into \fBFILE\fR\. Note that this operation is in conflict with \fB\-c\fR\. If both operations are present on the command line, the last expressed one wins\. ++. + .IP "\(bu" 4 + \fB\-\-[no\-]sparse\fR: enable / disable sparse FS support, to make files with many zeroes smaller on disk\. Creating sparse files may save disk space and speed up decompression by reducing the amount of disk I/O\. default: enabled when output is into a file, and disabled when output is stdout\. This setting overrides default and can force sparse mode over stdout\. ++. + .IP "\(bu" 4 + \fB\-\-[no\-]pass\-through\fR enable / disable passing through uncompressed files as\-is\. During decompression when pass\-through is enabled, unrecognized formats will be copied as\-is from the input to the output\. By default, pass\-through will occur when the output destination is stdout and the force (\fB\-f\fR) option is set\. ++. + .IP "\(bu" 4 + \fB\-\-rm\fR: remove source file(s) after successful compression or decompression\. This command is silently ignored if output is \fBstdout\fR\. If used in combination with \fB\-o\fR, triggers a confirmation prompt (which can be silenced with \fB\-f\fR), as this is a destructive operation\. ++. + .IP "\(bu" 4 + \fB\-k\fR, \fB\-\-keep\fR: keep source file(s) after successful compression or decompression\. This is the default behavior\. ++. + .IP "\(bu" 4 + \fB\-r\fR: operate recursively on directories\. It selects all files in the named directory and all its subdirectories\. This can be useful both to reduce command line typing, and to circumvent shell expansion limitations, when there are a lot of files and naming breaks the maximum size of a command line\. ++. + .IP "\(bu" 4 + \fB\-\-filelist FILE\fR read a list of files to process as content from \fBFILE\fR\. Format is compatible with \fBls\fR output, with one file per line\. ++. + .IP "\(bu" 4 + \fB\-\-output\-dir\-flat DIR\fR: resulting files are stored into target \fBDIR\fR directory, instead of same directory as origin file\. Be aware that this command can introduce name collision issues, if multiple files, from different directories, end up having the same name\. Collision resolution ensures first file with a given name will be present in \fBDIR\fR, while in combination with \fB\-f\fR, the last file will be present instead\. ++. + .IP "\(bu" 4 + \fB\-\-output\-dir\-mirror DIR\fR: similar to \fB\-\-output\-dir\-flat\fR, the output files are stored underneath target \fBDIR\fR directory, but this option will replicate input directory hierarchy into output \fBDIR\fR\. ++. + .IP + If input directory contains "\.\.", the files in this directory will be ignored\. If input directory is an absolute directory (i\.e\. "/var/tmp/abc"), it will be stored into the "output\-dir/var/tmp/abc"\. If there are multiple input files or directories, name collision resolution will follow the same rules as \fB\-\-output\-dir\-flat\fR\. ++. + .IP "\(bu" 4 + \fB\-\-format=FORMAT\fR: compress and decompress in other formats\. If compiled with support, zstd can compress to or decompress from other compression algorithm formats\. Possibly available options are \fBzstd\fR, \fBgzip\fR, \fBxz\fR, \fBlzma\fR, and \fBlz4\fR\. If no such format is provided, \fBzstd\fR is the default\. ++. + .IP "\(bu" 4 + \fB\-h\fR/\fB\-H\fR, \fB\-\-help\fR: display help/long help and exit ++. + .IP "\(bu" 4 + \fB\-V\fR, \fB\-\-version\fR: display version number and immediately exit\. note that, since it exits, flags specified after \fB\-V\fR are effectively ignored\. Advanced: \fB\-vV\fR also displays supported formats\. \fB\-vvV\fR also displays POSIX support\. \fB\-qV\fR will only display the version number, suitable for machine reading\. ++. + .IP "\(bu" 4 + \fB\-v\fR, \fB\-\-verbose\fR: verbose mode, display more information ++. + .IP "\(bu" 4 + \fB\-q\fR, \fB\-\-quiet\fR: suppress warnings, interactivity, and notifications\. specify twice to suppress errors too\. ++. + .IP "\(bu" 4 + \fB\-\-no\-progress\fR: do not display the progress bar, but keep all other messages\. ++. + .IP "\(bu" 4 + \fB\-\-show\-default\-cparams\fR: shows the default compression parameters that will be used for a particular input file, based on the provided compression level and the input size\. If the provided file is not a regular file (e\.g\. a pipe), this flag will output the parameters used for inputs of unknown size\. ++. + .IP "\(bu" 4 + \fB\-\-exclude\-compressed\fR: only compress files that are not already compressed\. ++. + .IP "\(bu" 4 + \fB\-\-\fR: All arguments after \fB\-\-\fR are treated as files ++. + .IP "" 0 ++. + .SS "gzip Operation Modifiers" + When invoked via a \fBgzip\fR symlink, \fBzstd\fR will support further options that intend to mimic the \fBgzip\fR behavior: ++. + .TP + \fB\-n\fR, \fB\-\-no\-name\fR + do not store the original filename and timestamps when compressing a file\. This is the default behavior and hence a no\-op\. ++. + .TP + \fB\-\-best\fR + alias to the option \fB\-9\fR\. ++. + .SS "Environment Variables" + Employing environment variables to set parameters has security implications\. Therefore, this avenue is intentionally limited\. Only \fBZSTD_CLEVEL\fR and \fBZSTD_NBTHREADS\fR are currently supported\. They set the default compression level and number of threads to use during compression, respectively\. ++. + .P + \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)\. ++. + .P +-\fBZSTD_NBTHREADS\fR can be used to set the number of threads \fBzstd\fR will attempt to use during compression\. If the value of \fBZSTD_NBTHREADS\fR is not a valid unsigned integer, it will be ignored with a warning message\. \fBZSTD_NBTHREADS\fR has a default value of (\fB1\fR), and is capped at ZSTDMT_NBWORKERS_MAX==200\. \fBzstd\fR must be compiled with multithread support for this variable to have any effect\. ++\fBZSTD_NBTHREADS\fR can be used to set the number of threads \fBzstd\fR will attempt to use during compression\. If the value of \fBZSTD_NBTHREADS\fR is not a valid unsigned integer, it will be ignored with a warning message\. \fBZSTD_NBTHREADS\fR has a default value of \fBmax(1, min(4, nbCores/4))\fR, and is capped at ZSTDMT_NBWORKERS_MAX==200\. \fBzstd\fR must be compiled with multithread support for this variable to have any effect\. ++. + .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 "ADVANCED COMPRESSION OPTIONS" + \fBzstd\fR provides 22 predefined regular compression levels plus the fast levels\. A compression level is translated internally into multiple advanced parameters that control the behavior of the compressor (one can observe the result of this translation with \fB\-\-show\-default\-cparams\fR)\. These advanced parameters can be overridden using advanced compression options\. ++. + .SS "\-\-zstd[=options]:" + The \fIoptions\fR are provided as a comma\-separated list\. You may specify only the options you want to change and the rest will be taken from the selected or default compression level\. The list of available \fIoptions\fR: ++. + .TP + \fBstrategy\fR=\fIstrat\fR, \fBstrat\fR=\fIstrat\fR + Specify a strategy used by a match finder\. ++. + .IP + There are 9 strategies numbered from 1 to 9, from fastest to strongest: 1=\fBZSTD_fast\fR, 2=\fBZSTD_dfast\fR, 3=\fBZSTD_greedy\fR, 4=\fBZSTD_lazy\fR, 5=\fBZSTD_lazy2\fR, 6=\fBZSTD_btlazy2\fR, 7=\fBZSTD_btopt\fR, 8=\fBZSTD_btultra\fR, 9=\fBZSTD_btultra2\fR\. ++. + .TP + \fBwindowLog\fR=\fIwlog\fR, \fBwlog\fR=\fIwlog\fR + Specify the maximum number of bits for a match distance\. ++. + .IP + The higher number of increases the chance to find a match which usually improves compression ratio\. It also increases memory requirements for the compressor and decompressor\. The minimum \fIwlog\fR is 10 (1 KiB) and the maximum is 30 (1 GiB) on 32\-bit platforms and 31 (2 GiB) on 64\-bit platforms\. ++. + .IP + Note: If \fBwindowLog\fR is set to larger than 27, \fB\-\-long=windowLog\fR or \fB\-\-memory=windowSize\fR needs to be passed to the decompressor\. ++. + .TP + \fBhashLog\fR=\fIhlog\fR, \fBhlog\fR=\fIhlog\fR + Specify the maximum number of bits for a hash table\. ++. + .IP + Bigger hash tables cause fewer collisions which usually makes compression faster, but requires more memory during compression\. ++. + .IP + The minimum \fIhlog\fR is 6 (64 entries / 256 B) and the maximum is 30 (1B entries / 4 GiB)\. ++. + .TP + \fBchainLog\fR=\fIclog\fR, \fBclog\fR=\fIclog\fR + Specify the maximum number of bits for the secondary search structure, whose form depends on the selected \fBstrategy\fR\. ++. + .IP + Higher numbers of bits increases the chance to find a match which usually improves compression ratio\. It also slows down compression speed and increases memory requirements for compression\. This option is ignored for the \fBZSTD_fast\fR \fBstrategy\fR, which only has the primary hash table\. ++. + .IP + The minimum \fIclog\fR is 6 (64 entries / 256 B) and the maximum is 29 (512M entries / 2 GiB) on 32\-bit platforms and 30 (1B entries / 4 GiB) on 64\-bit platforms\. ++. + .TP + \fBsearchLog\fR=\fIslog\fR, \fBslog\fR=\fIslog\fR + Specify the maximum number of searches in a hash chain or a binary tree using logarithmic scale\. ++. + .IP + More searches increases the chance to find a match which usually increases compression ratio but decreases compression speed\. ++. + .IP +-The minimum \fIslog\fR is 1 and the maximum is 'windowLog' \- 1\. ++The minimum \fIslog\fR is 1 and the maximum is \'windowLog\' \- 1\. ++. + .TP + \fBminMatch\fR=\fImml\fR, \fBmml\fR=\fImml\fR + Specify the minimum searched length of a match in a hash table\. ++. + .IP + Larger search lengths usually decrease compression ratio but improve decompression speed\. ++. + .IP + The minimum \fImml\fR is 3 and the maximum is 7\. ++. + .TP + \fBtargetLength\fR=\fItlen\fR, \fBtlen\fR=\fItlen\fR + The impact of this field vary depending on selected strategy\. ++. + .IP + For \fBZSTD_btopt\fR, \fBZSTD_btultra\fR and \fBZSTD_btultra2\fR, it specifies the minimum match length that causes match finder to stop searching\. A larger \fBtargetLength\fR usually improves compression ratio but decreases compression speed\. ++. + .IP + For \fBZSTD_fast\fR, it triggers ultra\-fast mode when > 0\. The value represents the amount of data skipped between match sampling\. Impact is reversed: a larger \fBtargetLength\fR increases compression speed but decreases compression ratio\. ++. + .IP + For all other strategies, this field has no impact\. ++. + .IP + The minimum \fItlen\fR is 0 and the maximum is 128 KiB\. ++. + .TP + \fBoverlapLog\fR=\fIovlog\fR, \fBovlog\fR=\fIovlog\fR + Determine \fBoverlapSize\fR, amount of data reloaded from previous job\. This parameter is only available when multithreading is enabled\. Reloading more data improves compression ratio, but decreases speed\. ++. + .IP + The minimum \fIovlog\fR is 0, and the maximum is 9\. 1 means "no overlap", hence completely independent jobs\. 9 means "full overlap", meaning up to \fBwindowSize\fR is reloaded from previous job\. Reducing \fIovlog\fR by 1 reduces the reloaded amount by a factor 2\. For example, 8 means "windowSize/2", and 6 means "windowSize/8"\. Value 0 is special and means "default": \fIovlog\fR is automatically determined by \fBzstd\fR\. In which case, \fIovlog\fR will range from 6 to 9, depending on selected \fIstrat\fR\. ++. ++.TP ++\fBldmHashRateLog\fR=\fIlhrlog\fR, \fBlhrlog\fR=\fIlhrlog\fR ++Specify the frequency of inserting entries into the long distance matching hash table\. ++. ++.IP ++This option is ignored unless long distance matching is enabled\. ++. ++.IP ++Larger values will improve compression speed\. Deviating far from the default value will likely result in a decrease in compression ratio\. ++. ++.IP ++The default value varies between 4 and 7, depending on \fBstrategy\fR\. ++. + .TP + \fBldmHashLog\fR=\fIlhlog\fR, \fBlhlog\fR=\fIlhlog\fR + Specify the maximum size for a hash table used for long distance matching\. ++. + .IP + This option is ignored unless long distance matching is enabled\. ++. + .IP + Bigger hash tables usually improve compression ratio at the expense of more memory during compression and a decrease in compression speed\. ++. + .IP +-The minimum \fIlhlog\fR is 6 and the maximum is 30 (default: 20)\. ++The minimum \fIlhlog\fR is 6 and the maximum is 30 (default: \fBwindowLog \- ldmHashRateLog\fR)\. ++. + .TP + \fBldmMinMatch\fR=\fIlmml\fR, \fBlmml\fR=\fIlmml\fR + Specify the minimum searched length of a match for long distance matching\. ++. + .IP + This option is ignored unless long distance matching is enabled\. ++. + .IP + Larger/very small values usually decrease compression ratio\. ++. + .IP +-The minimum \fIlmml\fR is 4 and the maximum is 4096 (default: 64)\. ++The minimum \fIlmml\fR is 4 and the maximum is 4096 (default: 32 to 64, depending on \fBstrategy\fR)\. ++. + .TP + \fBldmBucketSizeLog\fR=\fIlblog\fR, \fBlblog\fR=\fIlblog\fR + Specify the size of each bucket for the hash table used for long distance matching\. ++. + .IP + This option is ignored unless long distance matching is enabled\. ++. + .IP + Larger bucket sizes improve collision resolution but decrease compression speed\. ++. + .IP +-The minimum \fIlblog\fR is 1 and the maximum is 8 (default: 3)\. +-.TP +-\fBldmHashRateLog\fR=\fIlhrlog\fR, \fBlhrlog\fR=\fIlhrlog\fR +-Specify the frequency of inserting entries into the long distance matching hash table\. +-.IP +-This option is ignored unless long distance matching is enabled\. +-.IP +-Larger values will improve compression speed\. Deviating far from the default value will likely result in a decrease in compression ratio\. +-.IP +-The default value is \fBwlog \- lhlog\fR\. ++The minimum \fIlblog\fR is 1 and the maximum is 8 (default: 4 to 8, depending on \fBstrategy\fR)\. ++. + .SS "Example" + The following parameters sets advanced compression options to something similar to predefined level 19 for files bigger than 256 KB: ++. + .P + \fB\-\-zstd\fR=wlog=23,clog=23,hlog=22,slog=6,mml=3,tlen=48,strat=6 ++. + .SS "\-B#:" + Specify the size of each compression job\. This parameter is only available when multi\-threading is enabled\. Each compression job is run in parallel, so this value indirectly impacts the nb of active threads\. Default job size varies depending on compression level (generally \fB4 * windowSize\fR)\. \fB\-B#\fR makes it possible to manually select a custom size\. Note that job size must respect a minimum value which is enforced transparently\. This minimum is either 512 KB, or \fBoverlapSize\fR, whichever is largest\. Different job sizes will lead to non\-identical compressed frames\. ++. + .SH "DICTIONARY BUILDER" +-\fBzstd\fR offers \fIdictionary\fR compression, which greatly improves efficiency on small files and messages\. It's possible to train \fBzstd\fR with a set of samples, the result of which is saved into a file called a \fBdictionary\fR\. Then, during compression and decompression, reference the same dictionary, using command \fB\-D dictionaryFileName\fR\. Compression of small files similar to the sample set will be greatly improved\. ++\fBzstd\fR offers \fIdictionary\fR compression, which greatly improves efficiency on small files and messages\. It\'s possible to train \fBzstd\fR with a set of samples, the result of which is saved into a file called a \fBdictionary\fR\. Then, during compression and decompression, reference the same dictionary, using command \fB\-D dictionaryFileName\fR\. Compression of small files similar to the sample set will be greatly improved\. ++. + .TP + \fB\-\-train FILEs\fR + Use FILEs as training set to create a dictionary\. The training set should ideally contain a lot of samples (> 100), and weight typically 100x the target dictionary size (for example, ~10 MB for a 100 KB dictionary)\. \fB\-\-train\fR can be combined with \fB\-r\fR to indicate a directory rather than listing all the files, which can be useful to circumvent shell expansion limits\. ++. + .IP + Since dictionary compression is mostly effective for small files, the expectation is that the training set will only contain small files\. In the case where some samples happen to be large, only the first 128 KiB of these samples will be used for training\. ++. + .IP + \fB\-\-train\fR supports multithreading if \fBzstd\fR is compiled with threading support (default)\. Additional advanced parameters can be specified with \fB\-\-train\-fastcover\fR\. The legacy dictionary builder can be accessed with \fB\-\-train\-legacy\fR\. The slower cover dictionary builder can be accessed with \fB\-\-train\-cover\fR\. Default \fB\-\-train\fR is equivalent to \fB\-\-train\-fastcover=d=8,steps=4\fR\. ++. + .TP + \fB\-o FILE\fR + Dictionary saved into \fBFILE\fR (default name: dictionary)\. ++. + .TP + \fB\-\-maxdict=#\fR +-Limit dictionary to specified size (default: 112640 bytes)\. As usual, quantities are expressed in bytes by default, and it's possible to employ suffixes (like \fBKB\fR or \fBMB\fR) to specify larger values\. ++Limit dictionary to specified size (default: 112640 bytes)\. As usual, quantities are expressed in bytes by default, and it\'s possible to employ suffixes (like \fBKB\fR or \fBMB\fR) to specify larger values\. ++. + .TP + \fB\-#\fR + Use \fB#\fR compression level during training (optional)\. Will generate statistics more tuned for selected compression level, resulting in a \fIsmall\fR compression ratio improvement for this level\. ++. + .TP + \fB\-B#\fR + Split input files into blocks of size # (default: no split) ++. + .TP + \fB\-M#\fR, \fB\-\-memory=#\fR + Limit the amount of sample data loaded for training (default: 2 GB)\. Note that the default (2 GB) is also the maximum\. This parameter can be useful in situations where the training set size is not well controlled and could be potentially very large\. Since speed of the training process is directly correlated to the size of the training sample set, a smaller sample set leads to faster training\. ++. + .IP + In situations where the training set is larger than maximum memory, the CLI will randomly select samples among the available ones, up to the maximum allowed memory budget\. This is meant to improve dictionary relevance by mitigating the potential impact of clustering, such as selecting only files from the beginning of a list sorted by modification date, or sorted by alphabetical order\. The randomization process is deterministic, so training of the same list of files with the same parameters will lead to the creation of the same dictionary\. ++. + .TP + \fB\-\-dictID=#\fR +-A dictionary ID is a locally unique ID\. The decoder will use this value to verify it is using the right dictionary\. By default, zstd will create a 4\-bytes random number ID\. It's possible to provide an explicit number ID instead\. It's up to the dictionary manager to not assign twice the same ID to 2 different dictionaries\. Note that short numbers have an advantage: an ID < 256 will only need 1 byte in the compressed frame header, and an ID < 65536 will only need 2 bytes\. This compares favorably to 4 bytes default\. ++A dictionary ID is a locally unique ID\. The decoder will use this value to verify it is using the right dictionary\. By default, zstd will create a 4\-bytes random number ID\. It\'s possible to provide an explicit number ID instead\. It\'s up to the dictionary manager to not assign twice the same ID to 2 different dictionaries\. Note that short numbers have an advantage: an ID < 256 will only need 1 byte in the compressed frame header, and an ID < 65536 will only need 2 bytes\. This compares favorably to 4 bytes default\. ++. + .IP +-Note that RFC8878 reserves IDs less than 32768 and greater than or equal to 2\e^31, so they should not be used in public\. ++Note that RFC8878 reserves IDs less than 32768 and greater than or equal to 2^31, so they should not be used in public\. ++. + .TP + \fB\-\-train\-cover[=k#,d=#,steps=#,split=#,shrink[=#]]\fR + Select parameters for the default dictionary builder algorithm named cover\. If \fId\fR is not specified, then it tries \fId\fR = 6 and \fId\fR = 8\. If \fIk\fR is not specified, then it tries \fIsteps\fR values in the range [50, 2000]\. If \fIsteps\fR is not specified, then the default value of 40 is used\. If \fIsplit\fR is not specified or split <= 0, then the default value of 100 is used\. Requires that \fId\fR <= \fIk\fR\. If \fIshrink\fR flag is not used, then the default value for \fIshrinkDict\fR of 0 is used\. If \fIshrink\fR is not specified, then the default value for \fIshrinkDictMaxRegression\fR of 1 is used\. ++. + .IP + Selects segments of size \fIk\fR with highest score to put in the dictionary\. The score of a segment is computed by the sum of the frequencies of all the subsegments of size \fId\fR\. Generally \fId\fR should be in the range [6, 8], occasionally up to 16, but the algorithm will run faster with d <= \fI8\fR\. Good values for \fIk\fR vary widely based on the input data, but a safe range is [2 * \fId\fR, 2000]\. If \fIsplit\fR is 100, all input samples are used for both training and testing to find optimal \fId\fR and \fIk\fR to build dictionary\. Supports multithreading if \fBzstd\fR is compiled with threading support\. Having \fIshrink\fR enabled takes a truncated dictionary of minimum size and doubles in size until compression ratio of the truncated dictionary is at most \fIshrinkDictMaxRegression%\fR worse than the compression ratio of the largest dictionary\. ++. + .IP + Examples: ++. + .IP + \fBzstd \-\-train\-cover FILEs\fR ++. + .IP + \fBzstd \-\-train\-cover=k=50,d=8 FILEs\fR ++. + .IP + \fBzstd \-\-train\-cover=d=8,steps=500 FILEs\fR ++. + .IP + \fBzstd \-\-train\-cover=k=50 FILEs\fR ++. + .IP + \fBzstd \-\-train\-cover=k=50,split=60 FILEs\fR ++. + .IP + \fBzstd \-\-train\-cover=shrink FILEs\fR ++. + .IP + \fBzstd \-\-train\-cover=shrink=2 FILEs\fR ++. + .TP + \fB\-\-train\-fastcover[=k#,d=#,f=#,steps=#,split=#,accel=#]\fR + Same as cover but with extra parameters \fIf\fR and \fIaccel\fR and different default value of split If \fIsplit\fR is not specified, then it tries \fIsplit\fR = 75\. If \fIf\fR is not specified, then it tries \fIf\fR = 20\. Requires that 0 < \fIf\fR < 32\. If \fIaccel\fR is not specified, then it tries \fIaccel\fR = 1\. Requires that 0 < \fIaccel\fR <= 10\. Requires that \fId\fR = 6 or \fId\fR = 8\. ++. + .IP + \fIf\fR is log of size of array that keeps track of frequency of subsegments of size \fId\fR\. The subsegment is hashed to an index in the range [0,2^\fIf\fR \- 1]\. It is possible that 2 different subsegments are hashed to the same index, and they are considered as the same subsegment when computing frequency\. Using a higher \fIf\fR reduces collision but takes longer\. ++. + .IP + Examples: ++. + .IP + \fBzstd \-\-train\-fastcover FILEs\fR ++. + .IP + \fBzstd \-\-train\-fastcover=d=8,f=15,accel=2 FILEs\fR ++. + .TP + \fB\-\-train\-legacy[=selectivity=#]\fR + Use legacy dictionary builder algorithm with the given dictionary \fIselectivity\fR (default: 9)\. The smaller the \fIselectivity\fR value, the denser the dictionary, improving its efficiency but reducing its achievable maximum size\. \fB\-\-train\-legacy=s=#\fR is also accepted\. ++. + .IP + Examples: ++. + .IP + \fBzstd \-\-train\-legacy FILEs\fR ++. + .IP + \fBzstd \-\-train\-legacy=selectivity=8 FILEs\fR ++. + .SH "BENCHMARK" +-The \fBzstd\fR CLI provides a benchmarking mode that can be used to easily find suitable compression parameters, or alternatively to benchmark a computer's performance\. \fBzstd \-b [FILE(s)]\fR will benchmark \fBzstd\fR for both compression and decompression using default compression level\. Note that results are very dependent on the content being compressed\. It's possible to pass multiple files to the benchmark, and even a directory with \fB\-r DIRECTORY\fR\. When no \fBFILE\fR is provided, the benchmark will use a procedurally generated \fBlorem ipsum\fR text\. ++The \fBzstd\fR CLI provides a benchmarking mode that can be used to easily find suitable compression parameters, or alternatively to benchmark a computer\'s performance\. \fBzstd \-b [FILE(s)]\fR will benchmark \fBzstd\fR for both compression and decompression using default compression level\. Note that results are very dependent on the content being compressed\. ++. ++.P ++It\'s possible to pass multiple files to the benchmark, and even a directory with \fB\-r DIRECTORY\fR\. When no \fBFILE\fR is provided, the benchmark will use a procedurally generated \fBlorem ipsum\fR text\. ++. ++.P ++Benchmarking will employ \fBmax(1, min(4, nbCores/4))\fR worker threads by default in order to match the behavior of the normal CLI I/O\. ++. + .IP "\(bu" 4 + \fB\-b#\fR: benchmark file(s) using compression level # ++. + .IP "\(bu" 4 + \fB\-e#\fR: benchmark file(s) using multiple compression levels, from \fB\-b#\fR to \fB\-e#\fR (inclusive) ++. + .IP "\(bu" 4 + \fB\-d\fR: benchmark decompression speed only (requires providing a zstd\-compressed content) ++. + .IP "\(bu" 4 + \fB\-i#\fR: minimum evaluation time, in seconds (default: 3s), benchmark mode only ++. + .IP "\(bu" 4 + \fB\-B#\fR, \fB\-\-block\-size=#\fR: cut file(s) into independent chunks of size # (default: no chunking) ++. + .IP "\(bu" 4 + \fB\-S\fR: output one benchmark result per input file (default: consolidated result) ++. + .IP "\(bu" 4 + \fB\-D dictionary\fR benchmark using dictionary ++. + .IP "\(bu" 4 + \fB\-\-priority=rt\fR: set process priority to real\-time (Windows) ++. + .IP "" 0 ++. + .P + Beyond compression levels, benchmarking is also compatible with other parameters, such as number of threads (\fB\-T#\fR), advanced compression parameters (\fB\-\-zstd=###\fR), dictionary compression (\fB\-D dictionary\fR), or even disabling checksum verification for example\. ++. + .P + \fBOutput Format:\fR CompressionLevel#Filename: InputSize \-> OutputSize (CompressionRatio), CompressionSpeed, DecompressionSpeed ++. + .P + \fBMethodology:\fR For speed measurement, the entire input is compressed/decompressed in\-memory to measure speed\. A run lasts at least 1 sec, so when files are small, they are compressed/decompressed several times per run, in order to improve measurement accuracy\. ++. + .SH "SEE ALSO" + \fBzstdgrep\fR(1), \fBzstdless\fR(1), \fBgzip\fR(1), \fBxz\fR(1) ++. + .P +-The \fIzstandard\fR format is specified in Y\. Collet, "Zstandard Compression and the 'application/zstd' Media Type", https://www\.ietf\.org/rfc/rfc8878\.txt, Internet RFC 8878 (February 2021)\. ++The \fIzstandard\fR format is specified in Y\. Collet, "Zstandard Compression and the \'application/zstd\' Media Type", https://www\.ietf\.org/rfc/rfc8878\.txt, Internet RFC 8878 (February 2021)\. ++. + .SH "BUGS" + Report bugs at: https://github\.com/facebook/zstd/issues ++. + .SH "AUTHOR" + Yann Collet +diff --git a/programs/zstdgrep.1 b/programs/zstdgrep.1 +index d7fda583398..fc79e82e326 100644 +--- a/programs/zstdgrep.1 ++++ b/programs/zstdgrep.1 +@@ -1,5 +1,5 @@ + . +-.TH "ZSTDGREP" "1" "March 2024" "zstd 1.5.6" "User Commands" ++.TH "ZSTDGREP" "1" "February 2025" "zstd 1.5.7" "User Commands" + . + .SH "NAME" + \fBzstdgrep\fR \- print lines matching a pattern in zstandard\-compressed files +diff --git a/programs/zstdless.1 b/programs/zstdless.1 +index 7dd65f8fc44..ad5048a02c7 100644 +--- a/programs/zstdless.1 ++++ b/programs/zstdless.1 +@@ -1,5 +1,5 @@ + . +-.TH "ZSTDLESS" "1" "March 2024" "zstd 1.5.6" "User Commands" ++.TH "ZSTDLESS" "1" "February 2025" "zstd 1.5.7" "User Commands" + . + .SH "NAME" + \fBzstdless\fR \- view zstandard\-compressed files diff --git a/sources b/sources index bb186a9..f2c261e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (zstd-1.5.6.tar.gz) = 54a578f2484da0520a6e9a24f501b9540a3fe3806785d6bc9db79fc095b7c142a7c121387c7eecd460ca71446603584ef1ba4d29a33ca90873338c9ffbd04f14 +SHA512 (zstd-1.5.7.tar.gz) = b4de208f179b68d4c6454139ca60d66ed3ef3893a560d6159a056640f83d3ee67cdf6ffb88971cdba35449dba4b597eaa8b4ae908127ef7fd58c89f40bf9a705 diff --git a/zstd.spec b/zstd.spec index 2f77c8a..1a1c999 100644 --- a/zstd.spec +++ b/zstd.spec @@ -17,14 +17,16 @@ %bcond gtest %[ !0%{?rhel} ] Name: zstd -Version: 1.5.6 -Release: 3%{?dist} +Version: 1.5.7 +Release: 1%{?dist} Summary: Zstd compression library License: BSD-3-Clause AND GPL-2.0-only URL: https://github.com/facebook/zstd Source0: https://github.com/facebook/zstd/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz +Patch1: man-pages-1.5.7.patch + BuildRequires: make BuildRequires: gcc %{?with_gtest:gtest-devel} %if %{with lz4} @@ -68,6 +70,7 @@ Static variant of the Zstd library. %prep %setup -q find -name .gitignore -delete +%patch 1 -p1 %build export CFLAGS="$RPM_OPT_FLAGS" @@ -135,6 +138,9 @@ install -D -m644 programs/%{name}.1 %{buildroot}%{_mandir}/man1/p%{name}.1 %ldconfig_scriptlets -n lib%{name} %changelog +* Thu Feb 20 2025 Pádraig Brady - 1.5.7-1 +- latest upstream + * Sun Jan 19 2025 Fedora Release Engineering - 1.5.6-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild From af1b0cb7860eea31cbc2588c336bee06552cb067 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 25 Jul 2025 21:21:19 +0000 Subject: [PATCH 24/29] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild --- zstd.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zstd.spec b/zstd.spec index 1a1c999..5b3705b 100644 --- a/zstd.spec +++ b/zstd.spec @@ -18,7 +18,7 @@ Name: zstd Version: 1.5.7 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Zstd compression library License: BSD-3-Clause AND GPL-2.0-only @@ -138,6 +138,9 @@ install -D -m644 programs/%{name}.1 %{buildroot}%{_mandir}/man1/p%{name}.1 %ldconfig_scriptlets -n lib%{name} %changelog +* Fri Jul 25 2025 Fedora Release Engineering - 1.5.7-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + * Thu Feb 20 2025 Pádraig Brady - 1.5.7-1 - latest upstream From e4309bcebc0db4e35353338d7e03bd37f601a0de Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Fri, 10 Nov 2023 18:09:31 -0700 Subject: [PATCH 25/29] Build with cmake (bz#2088517) --- zstd.spec | 51 +++++++++++++++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 20 deletions(-) diff --git a/zstd.spec b/zstd.spec index 5b3705b..43a9a5c 100644 --- a/zstd.spec +++ b/zstd.spec @@ -18,7 +18,7 @@ Name: zstd Version: 1.5.7 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Zstd compression library License: BSD-3-Clause AND GPL-2.0-only @@ -27,6 +27,7 @@ Source0: https://github.com/facebook/zstd/archive/v%{version}.tar.gz#/%{n Patch1: man-pages-1.5.7.patch +BuildRequires: cmake BuildRequires: make BuildRequires: gcc %{?with_gtest:gtest-devel} %if %{with lz4} @@ -73,33 +74,38 @@ find -name .gitignore -delete %patch 1 -p1 %build -export CFLAGS="$RPM_OPT_FLAGS" -export LDFLAGS="$RPM_LD_FLAGS" -export PREFIX="%{_prefix}" -export LIBDIR="%{_libdir}" -%make_build -C lib lib-mt %{!?with_asm:ZSTD_NO_ASM=1} -%make_build -C programs %{!?with_asm:ZSTD_NO_ASM=1} +%if !%{with asm} +export CPPFLAGS=-DZSTD_DISABLE_ASM +%endif +%global _vpath_srcdir build/cmake +%global _vpath_builddir build/shared +%cmake %{?with_pzstd:-DZSTD_BUILD_CONTRIB=ON} -DZSTD_BUILD_STATIC=NO -DZSTD_PROGRAMS_LINK_SHARED=YES +%cmake_build +%global _vpath_builddir build/static +%cmake %{?with_pzstd:-DZSTD_BUILD_CONTRIB=ON} -DZSTD_BUILD_SHARED=NO -DBUILD_TESTING=YES +%cmake_build + +%install +%global _vpath_builddir build/static +%cmake_install +# Install shared second so that cmake config files reference the shared library +%global _vpath_builddir build/shared +%cmake_install %if %{with pzstd} -export CXXFLAGS="$RPM_OPT_FLAGS" -%make_build -C contrib/pzstd %{!?with_asm:ZSTD_NO_ASM=1} +install -D -m644 programs/%{name}.1 %{buildroot}%{_mandir}/man1/p%{name}.1 %endif %check -execstack lib/libzstd.so.1 +execstack %{_vpath_builddir}/lib/libzstd.so.1 +%global _vpath_builddir build/static +%ctest --verbose +%if %{with pzstd} && %{with gtest} +# No pzstd tests with the cmake build at the moment export CFLAGS="$RPM_OPT_FLAGS" export LDFLAGS="$RPM_LD_FLAGS" -make -C tests test-zstd -%if %{with pzstd} && %{with gtest} export CXXFLAGS="$RPM_OPT_FLAGS" -make -C contrib/pzstd test -%endif - -%install -%make_install PREFIX=%{_prefix} LIBDIR=%{_libdir} -%if %{with pzstd} -install -D -m755 contrib/pzstd/pzstd %{buildroot}%{_bindir}/pzstd -install -D -m644 programs/%{name}.1 %{buildroot}%{_mandir}/man1/p%{name}.1 +make PZSTD_CXX_STD=-std=c++14 -C contrib/pzstd tests check %endif %files @@ -119,6 +125,7 @@ install -D -m644 programs/%{name}.1 %{buildroot}%{_mandir}/man1/p%{name}.1 %{_mandir}/man1/%{name}cat.1* %{_mandir}/man1/%{name}grep.1* %{_mandir}/man1/%{name}less.1* +%{_pkgdocdir}/zstd_manual.html %license COPYING LICENSE %files -n lib%{name} @@ -131,6 +138,7 @@ install -D -m644 programs/%{name}.1 %{buildroot}%{_mandir}/man1/p%{name}.1 %{_includedir}/zstd_errors.h %{_libdir}/pkgconfig/libzstd.pc %{_libdir}/libzstd.so +%{_libdir}/cmake/zstd/ %files -n lib%{name}-static %{_libdir}/libzstd.a @@ -138,6 +146,9 @@ install -D -m644 programs/%{name}.1 %{buildroot}%{_mandir}/man1/p%{name}.1 %ldconfig_scriptlets -n lib%{name} %changelog +* Sat Sep 20 2025 Orion Poplawski - 1.5.7-3 +- Build with cmake (bz#2088517) + * Fri Jul 25 2025 Fedora Release Engineering - 1.5.7-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild From 4170a25cb105972cc2da06c199a5cff845f3df17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Terje=20R=C3=B8sten?= Date: Wed, 8 Oct 2025 10:25:49 +0200 Subject: [PATCH 26/29] Move to C++17 for gtest 1.17.0 --- zstd.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/zstd.spec b/zstd.spec index 43a9a5c..e86bbaf 100644 --- a/zstd.spec +++ b/zstd.spec @@ -18,7 +18,7 @@ Name: zstd Version: 1.5.7 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Zstd compression library License: BSD-3-Clause AND GPL-2.0-only @@ -105,7 +105,7 @@ execstack %{_vpath_builddir}/lib/libzstd.so.1 export CFLAGS="$RPM_OPT_FLAGS" export LDFLAGS="$RPM_LD_FLAGS" export CXXFLAGS="$RPM_OPT_FLAGS" -make PZSTD_CXX_STD=-std=c++14 -C contrib/pzstd tests check +make PZSTD_CXX_STD=-std=c++17 -C contrib/pzstd tests check %endif %files @@ -146,6 +146,9 @@ make PZSTD_CXX_STD=-std=c++14 -C contrib/pzstd tests check %ldconfig_scriptlets -n lib%{name} %changelog +* Wed Oct 08 2025 Terje Røsten - 1.5.7-4 +- Move to C++17 for gtest 1.17.0 + * Sat Sep 20 2025 Orion Poplawski - 1.5.7-3 - Build with cmake (bz#2088517) From 64ce90edbb2775cd985c1c2bbc9ca3d2071a7a8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= Date: Tue, 25 Nov 2025 14:20:55 +0000 Subject: [PATCH 27/29] Change to more accurate license s/BSD AND GPLv2/BSD OR GPLv2/ See: https://bugzilla.redhat.com/show_bug.cgi?id=2416948 https://docs.fedoraproject.org/en-US/legal/license-field/#_special_rules_for_or_expressions --- zstd.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zstd.spec b/zstd.spec index e86bbaf..afd2f52 100644 --- a/zstd.spec +++ b/zstd.spec @@ -21,7 +21,7 @@ Version: 1.5.7 Release: 4%{?dist} Summary: Zstd compression library -License: BSD-3-Clause AND GPL-2.0-only +License: BSD-3-Clause OR GPL-2.0-only URL: https://github.com/facebook/zstd Source0: https://github.com/facebook/zstd/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz From 7b6ede5c5bb776f958fe2065c35c6c2fd58d0d47 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 17 Jan 2026 21:11:27 +0000 Subject: [PATCH 28/29] Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild --- zstd.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zstd.spec b/zstd.spec index afd2f52..38bb965 100644 --- a/zstd.spec +++ b/zstd.spec @@ -18,7 +18,7 @@ Name: zstd Version: 1.5.7 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Zstd compression library License: BSD-3-Clause OR GPL-2.0-only @@ -146,6 +146,9 @@ make PZSTD_CXX_STD=-std=c++17 -C contrib/pzstd tests check %ldconfig_scriptlets -n lib%{name} %changelog +* Sat Jan 17 2026 Fedora Release Engineering - 1.5.7-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild + * Wed Oct 08 2025 Terje Røsten - 1.5.7-4 - Move to C++17 for gtest 1.17.0 From efe3715ae2af861bbd41fc4c529be2c9da1f2d37 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 17 Jul 2026 09:44:03 +0000 Subject: [PATCH 29/29] Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild --- zstd.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zstd.spec b/zstd.spec index 38bb965..5ad4502 100644 --- a/zstd.spec +++ b/zstd.spec @@ -18,7 +18,7 @@ Name: zstd Version: 1.5.7 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Zstd compression library License: BSD-3-Clause OR GPL-2.0-only @@ -146,6 +146,9 @@ make PZSTD_CXX_STD=-std=c++17 -C contrib/pzstd tests check %ldconfig_scriptlets -n lib%{name} %changelog +* Fri Jul 17 2026 Fedora Release Engineering - 1.5.7-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild + * Sat Jan 17 2026 Fedora Release Engineering - 1.5.7-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild