SHA256
3
0
forked from pool/zstd

Accepting request 952093 from Archiving

now with explicit Conflicts for gzip+busybox-gzip

- 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

- 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/request/show/952093
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/zstd?expand=0&rev=28
This commit is contained in:
Dominique Leuenberger 2022-02-07 22:36:49 +00:00 committed by Git OBS Bridge
commit 053682670a
8 changed files with 86 additions and 80 deletions

View File

@ -1,40 +0,0 @@
From 9a9d1ec6f4536ffeb745f360ef010cefd125bfd0 Mon Sep 17 00:00:00 2001
From: "W. Felix Handte" <w@felixhandte.com>
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*.

View File

@ -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
.

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e28b2f2ed5710ea0d3a1ecac3f6a947a016b972b9dd30242369010e5f53d7002
size 1934669

View File

@ -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-----

3
zstd-1.5.2.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7c42d56fac126929a6a85dbc73ff1db2411d04f104fae9bdea51305663a83fd0
size 1936664

17
zstd-1.5.2.tar.gz.sig Normal file
View File

@ -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-----

View File

@ -1,3 +1,22 @@
-------------------------------------------------------------------
Sun Jan 30 22:59:24 UTC 2022 - Dirk Müller <dmueller@suse.com>
- 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 <bwiedemann@suse.com>
- 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 <dmueller@suse.com>

View File

@ -16,10 +16,9 @@
#
%define major 1
%define libname lib%{name}%{major}
%define libname libzstd1
Name: zstd
Version: %{major}.5.1
Version: 1.5.2
Release: 0
Summary: Zstandard compression tools
License: BSD-3-Clause AND GPL-2.0-only
@ -30,12 +29,12 @@ 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++
BuildRequires: pkgconfig
# for .gz support
BuildRequires: pkgconfig(zlib)
%description
Zstd, short for Zstandard, is a lossless compression algorithm. Speed
@ -86,15 +85,32 @@ 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)
Conflicts: gzip
Conflicts: busybox-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
@ -103,22 +119,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
@ -127,10 +154,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