From ced1fa5cd0a793ec06638a6d1de8bbbae66816849d058e6e00efcfddf9645fdd Mon Sep 17 00:00:00 2001 From: Bernhard Wiedemann Date: Fri, 21 Jan 2022 07:17:55 +0000 Subject: [PATCH 1/3] update to 1.5.2: * correct a performance regression * smaller improvements and fixes * See https://github.com/facebook/zstd/releases/tag/v1.5.2 - Refresh pzstd.1.patch - Drop upstream noexecstack.patch OBS-URL: https://build.opensuse.org/package/show/Archiving/zstd?expand=0&rev=74 --- noexecstack.patch | 40 ---------------------------------------- pzstd.1.patch | 14 +++++++------- zstd-1.5.1.tar.gz | 3 --- zstd-1.5.1.tar.gz.sig | 17 ----------------- zstd-1.5.2.tar.gz | 3 +++ zstd-1.5.2.tar.gz.sig | 17 +++++++++++++++++ zstd.changes | 10 ++++++++++ zstd.spec | 4 +--- 8 files changed, 38 insertions(+), 70 deletions(-) delete mode 100644 noexecstack.patch delete mode 100644 zstd-1.5.1.tar.gz delete mode 100644 zstd-1.5.1.tar.gz.sig create mode 100644 zstd-1.5.2.tar.gz create mode 100644 zstd-1.5.2.tar.gz.sig diff --git a/noexecstack.patch b/noexecstack.patch deleted file mode 100644 index c3cbdd2..0000000 --- a/noexecstack.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 9a9d1ec6f4536ffeb745f360ef010cefd125bfd0 Mon Sep 17 00:00:00 2001 -From: "W. Felix Handte" -Date: Wed, 29 Dec 2021 17:47:12 -0800 -Subject: [PATCH] Mark Huffman Decoder Assembly `noexecstack` on All - Architectures - -Apparently, even when the assembly file is empty (because -`ZSTD_ENABLE_ASM_X86_64_BMI2` is false), it still is marked as possibly -needing an executable stack and so the whole library is marked as such. This -commit applies a simple patch for this problem by moving the noexecstack -indication outside the macro guard. - -This commit builds on #2857. - -This commit addresses #2963. ---- - lib/decompress/huf_decompress_amd64.S | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/lib/decompress/huf_decompress_amd64.S b/lib/decompress/huf_decompress_amd64.S -index 98173cce86..706786bb0d 100644 ---- a/lib/decompress/huf_decompress_amd64.S -+++ b/lib/decompress/huf_decompress_amd64.S -@@ -1,7 +1,5 @@ - #include "../common/portability_macros.h" - --#if ZSTD_ENABLE_ASM_X86_64_BMI2 -- - /* Stack marking - * ref: https://wiki.gentoo.org/wiki/Hardened/GNU_stack_quickstart - */ -@@ -9,6 +7,8 @@ - .section .note.GNU-stack,"",%progbits - #endif - -+#if ZSTD_ENABLE_ASM_X86_64_BMI2 -+ - /* Calling convention: - * - * %rdi contains the first argument: HUF_DecompressAsmArgs*. diff --git a/pzstd.1.patch b/pzstd.1.patch index 5db1734..39c163a 100644 --- a/pzstd.1.patch +++ b/pzstd.1.patch @@ -1,11 +1,11 @@ -Index: zstd-1.5.1/programs/zstd.1 +Index: zstd-1.5.2/programs/zstd.1 =================================================================== ---- zstd-1.5.1.orig/programs/zstd.1 -+++ zstd-1.5.1/programs/zstd.1 -@@ -147,6 +147,12 @@ If input directory contains "\.\.", the - .IP "\[ci]" 4 - \fB\-\-\fR: All arguments after \fB\-\-\fR are treated as files +--- zstd-1.5.2.orig/programs/zstd.1 ++++ zstd-1.5.2/programs/zstd.1 +@@ -217,6 +217,12 @@ If input directory contains "\.\.", the + . .IP "" 0 + . +.SS Parallel Zstd OPTIONS +Additional options for the pzstd utility +.TP @@ -14,4 +14,4 @@ Index: zstd-1.5.1/programs/zstd.1 +. .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\. - .P + . diff --git a/zstd-1.5.1.tar.gz b/zstd-1.5.1.tar.gz deleted file mode 100644 index 222049d..0000000 --- a/zstd-1.5.1.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e28b2f2ed5710ea0d3a1ecac3f6a947a016b972b9dd30242369010e5f53d7002 -size 1934669 diff --git a/zstd-1.5.1.tar.gz.sig b/zstd-1.5.1.tar.gz.sig deleted file mode 100644 index 50c5cba..0000000 --- a/zstd-1.5.1.tar.gz.sig +++ /dev/null @@ -1,17 +0,0 @@ ------BEGIN PGP SIGNATURE----- - -iQJFBAADCgAvFiEETvSsY0VfyfRUXZt974/plSi1L/0FAmHBIyoRHHNpZ25pbmdA -enN0ZC5uZXQACgkQ74/plSi1L/0eYA/6AxWBhURFeDFWg+iS83skZEdTWe7xlp8a -8JXuGTxgfts9ZP/IVxi3q4hPCVdsS54Wo0OzMkfWsNxCl84nI3LHH1rP2TdCjHh/ -EEwYA4fuKCdV7JO9fTVhg1INTSaKAghh/0ZYcJYw+PQ0TTTBVPHx4cAMustGzI8F -nxQkjJltQAI14nkCsELXMZhYlFY7ytF4j9+kGM1ZzuJPmMi6AlmMYRUmHjCNKqgj -bWC4SSOayfB2CAgrDVC4Vs/gCkVEA/YNeIv0I9QfOlU1C9ogagFiRGpB0jwdUgbz -14nucSicYaCAkQLBxDxSe9iFWpIyaFE3BisrhxWIDJlsp7tHA2VtlqFdWye7MuIF -HYi/UfjutivGxvD9hJNIrrHv7KnzTNLCJ5/sJGT55DTV5BngUtMrBLoCEezkn/Qj -uLe2bsvVZpAO1eY22lE3Alg9NgzIy1JkdZ3zJSyG0HNGXs4ds3qOsKAIihFvl2tY -H+BAFEpN1sUbBsgKq/fEv+I9Jfjxp9vmbS41M72cKb2VelZbCKy4AispOlzTmoqU -VK7nZR8ur9dXIzijz1Yf51cAzF1SFFiqg+ffTjXQ3JC8bmGHzJoxR42vONdbwD3B -3jUX25Cifu08IRlgPlDd3dWmNu8jmeLE6XVIf1r5iKcQWL87hkQ0XtLy9AZG8KfT -ud6ml4p7RIQ= -=C+Ki ------END PGP SIGNATURE----- diff --git a/zstd-1.5.2.tar.gz b/zstd-1.5.2.tar.gz new file mode 100644 index 0000000..6b09680 --- /dev/null +++ b/zstd-1.5.2.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7c42d56fac126929a6a85dbc73ff1db2411d04f104fae9bdea51305663a83fd0 +size 1936664 diff --git a/zstd-1.5.2.tar.gz.sig b/zstd-1.5.2.tar.gz.sig new file mode 100644 index 0000000..7f9f214 --- /dev/null +++ b/zstd-1.5.2.tar.gz.sig @@ -0,0 +1,17 @@ +-----BEGIN PGP SIGNATURE----- + +iQJFBAADCgAvFiEETvSsY0VfyfRUXZt974/plSi1L/0FAmHp2lARHHNpZ25pbmdA +enN0ZC5uZXQACgkQ74/plSi1L/3cNA//QJClHfc5gvIfxWO199i4reO6GDOzoNWS +6xi6MCv1fxHHYfJZTij2/Uokyuc3lr0WD0AUGLFOy3jKUtWUCDjgp12iOEKa9pbf +MIJ5jEHUYkC6yAr3omlgpPQ5EXnKs4u1b9AopKs90GKTVKrDreaoyTqlF7nGV3ud +xS5t4r1ihwEnxfe4GcAga2T/uX0iu2yWzqxol3/T/DwqmK0gvEpaw0qEGSVRItW3 +dEGiSAOYRfOxPMg1u8KlD/E/oe7GPEIjRkt8RALWRpzg+FuTHhBvUfjKUV7ZJyWa +HNnxzMbsKxDFNzZ/EDfG4ATZQVcL73iEi/3vT4OWHi2NI2U+S1JwKMyV4831jQ8E +M1ta97trYDyCggMCT1Na5zYJZNpGFu1T1Vhb6iFSNyQq0aZilshL3opsgR1CxqUf +BAD+rUpDRsomYH79gjwM45Fe3D3fRxXrVKhur9WsO0+OYpyULBX/oJ7z/9JNL240 +yN+QlpIjlkrolPB07ykjN9OsyWuHD6PJ37RVO4laEcsrn+CqGvJ2L/wOsNsQhJ+Y +3Bwp2wLhaNeHNRmRiqc79/pIOqrdiKAp/ji0jVWfBj/QDpnDdxNznzOuehIpmiLB +hSJbeycS/t/RFU3JO7UakdTc8s1mr9VaJSCHcXlgYoeuQ4O0ljKbH/g9Dn/LLWFG +Z4Zccqm7w90= +=89fj +-----END PGP SIGNATURE----- diff --git a/zstd.changes b/zstd.changes index 254a6c7..57403f5 100644 --- a/zstd.changes +++ b/zstd.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Fri Jan 21 04:53:08 UTC 2022 - Bernhard Wiedemann + +- update to 1.5.2: + * correct a performance regression + * smaller improvements and fixes + * See https://github.com/facebook/zstd/releases/tag/v1.5.2 +- Refresh pzstd.1.patch +- Drop upstream noexecstack.patch + ------------------------------------------------------------------- Wed Jan 5 13:12:22 UTC 2022 - Dirk Müller diff --git a/zstd.spec b/zstd.spec index d1bc791..e0fd427 100644 --- a/zstd.spec +++ b/zstd.spec @@ -19,7 +19,7 @@ %define major 1 %define libname lib%{name}%{major} Name: zstd -Version: %{major}.5.1 +Version: %{major}.5.2 Release: 0 Summary: Zstandard compression tools License: BSD-3-Clause AND GPL-2.0-only @@ -30,8 +30,6 @@ Source1: https://github.com/facebook/zstd/releases/download/v%{version}/% Source2: zstd.keyring Source99: baselibs.conf Patch1: pzstd.1.patch -# Cherry-pick from https://github.com/facebook/zstd/pull/2964 -Patch2: https://github.com/facebook/zstd/commit/9a9d1ec6f4536ffeb745f360ef010cefd125bfd0.patch#/noexecstack.patch BuildRequires: gcc # C++ is needed for pzstd only BuildRequires: gcc-c++ From 138094e8b8a8ca79f13159a3cc1a0d769971dc0c9ad47111fb328109ad55ddc2 Mon Sep 17 00:00:00 2001 From: Bernhard Wiedemann Date: Mon, 31 Jan 2022 09:43:08 +0000 Subject: [PATCH 2/3] Accepting request 950053 from home:dirkmueller:Factory - enable zlib/gzip compatible backend, as zlib is significantly (50%-100%) faster than gzip - add zstd-gzip compatibility subpackage which can be used as a drop in compatible replacement for gzip - small spec file cleanups OBS-URL: https://build.opensuse.org/request/show/950053 OBS-URL: https://build.opensuse.org/package/show/Archiving/zstd?expand=0&rev=75 --- zstd.changes | 9 +++++++++ zstd.spec | 49 ++++++++++++++++++++++++++++++++++++++----------- 2 files changed, 47 insertions(+), 11 deletions(-) diff --git a/zstd.changes b/zstd.changes index 57403f5..4e69643 100644 --- a/zstd.changes +++ b/zstd.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Sun Jan 30 22:59:24 UTC 2022 - Dirk Müller + +- enable zlib/gzip compatible backend, as zlib is significantly + (50%-100%) faster than gzip +- add zstd-gzip compatibility subpackage which can be used + as a drop in compatible replacement for gzip +- small spec file cleanups + ------------------------------------------------------------------- Fri Jan 21 04:53:08 UTC 2022 - Bernhard Wiedemann diff --git a/zstd.spec b/zstd.spec index e0fd427..9c37acb 100644 --- a/zstd.spec +++ b/zstd.spec @@ -16,10 +16,9 @@ # -%define major 1 -%define libname lib%{name}%{major} +%define libname libzstd1 Name: zstd -Version: %{major}.5.2 +Version: 1.5.2 Release: 0 Summary: Zstandard compression tools License: BSD-3-Clause AND GPL-2.0-only @@ -34,6 +33,8 @@ BuildRequires: gcc # C++ is needed for pzstd only BuildRequires: gcc-c++ BuildRequires: pkgconfig +# for .gz support +BuildRequires: pkgconfig(zlib) %description Zstd, short for Zstandard, is a lossless compression algorithm. Speed @@ -84,15 +85,30 @@ targeting faster compression than zlib at comparable ratios. Needed for compiling programs that link with the library. +%package gzip +Summary: zstd and zlib based gzip drop-in +Group: Productivity/Archiving/Compression +Conflicts: alternative(gzip) +Provides: gzip +Provides: alternative(gzip) +Requires: %{name} >= %{version} + +%description gzip +Zstd, short for Zstandard, is a lossless compression algorithm, +targeting faster compression than zlib at comparable ratios. + +This subpackage provides a compatible alternative to gzip(1) using +an optimized deflate/zlib handling. + %prep %autosetup -p1 %build %global _lto_cflags %{_lto_cflags} -ffat-lto-objects export CFLAGS="%{optflags}" -export CXXFLAGS="$CFLAGS -std=c++11" +export CXXFLAGS="%{optflags} -std=c++11" # lib-mt is alias for multi-threaded library support -%make_build prefix=%{_prefix} libdir=%{_libdir} -C lib lib-mt +%make_build HAVE_ZLIB=1 prefix=%{_prefix} libdir=%{_libdir} -C lib lib-mt for dir in programs contrib/pzstd; do %make_build -C "$dir" done @@ -101,22 +117,33 @@ done export CFLAGS="%{optflags}" export CXXFLAGS="%{optflags} -std=c++11" %make_build -C tests test-zstd -#make %{?_smp_mflags} -C contrib/pzstd test-pzstd +#make_build -C contrib/pzstd test-pzstd %install %make_install V=1 VERBOSE=1 prefix=%{_prefix} libdir=%{_libdir} install -D -m755 contrib/pzstd/pzstd %{buildroot}%{_bindir}/pzstd install -D -m644 programs/zstd.1 %{buildroot}%{_mandir}/man1/pzstd.1 +ln -s zstd %{buildroot}/%{_bindir}/gzip +ln -s zstd %{buildroot}/%{_bindir}/gunzip + +%post -n %{libname} -p /sbin/ldconfig +%postun -n %{libname} -p /sbin/ldconfig %files %license COPYING LICENSE %doc README.md CHANGELOG -%{_bindir}/* +%{_bindir}/pzstd +%{_bindir}/unzstd +%{_bindir}/zstd +%{_bindir}/zstdcat +%{_bindir}/zstdgrep +%{_bindir}/zstdless +%{_bindir}/zstdmt %{_mandir}/man1/*.1%{?ext_man} %files -n %{libname} %license COPYING LICENSE -%{_libdir}/libzstd.so.* +%{_libdir}/libzstd.so.1* %files -n lib%{name}-devel %license COPYING LICENSE @@ -125,10 +152,10 @@ install -D -m644 programs/zstd.1 %{buildroot}%{_mandir}/man1/pzstd.1 %{_libdir}/libzstd.so %files -n lib%{name}-devel-static -%license COPYING LICENSE %{_libdir}/libzstd.a -%post -n %{libname} -p /sbin/ldconfig -%postun -n %{libname} -p /sbin/ldconfig +%files gzip +%{_bindir}/gzip +%{_bindir}/gunzip %changelog From fbd9545b0a6ccc5c1e7ab734546efdd18c649bf70f664e28f2bab967874bf222 Mon Sep 17 00:00:00 2001 From: Bernhard Wiedemann Date: Mon, 7 Feb 2022 10:52:10 +0000 Subject: [PATCH 3/3] Add conflics OBS-URL: https://build.opensuse.org/package/show/Archiving/zstd?expand=0&rev=76 --- zstd.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zstd.spec b/zstd.spec index 9c37acb..0dcdd33 100644 --- a/zstd.spec +++ b/zstd.spec @@ -89,6 +89,8 @@ Needed for compiling programs that link with the library. Summary: zstd and zlib based gzip drop-in Group: Productivity/Archiving/Compression Conflicts: alternative(gzip) +Conflicts: gzip +Conflicts: busybox-gzip Provides: gzip Provides: alternative(gzip) Requires: %{name} >= %{version}