diff --git a/noexecstack.patch b/noexecstack.patch new file mode 100644 index 0000000..c3cbdd2 --- /dev/null +++ b/noexecstack.patch @@ -0,0 +1,40 @@ +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 dd97c28..5db1734 100644 --- a/pzstd.1.patch +++ b/pzstd.1.patch @@ -1,17 +1,17 @@ -Index: zstd-1.4.7/programs/zstd.1 +Index: zstd-1.5.1/programs/zstd.1 =================================================================== ---- zstd-1.4.7.orig/programs/zstd.1 -+++ zstd-1.4.7/programs/zstd.1 -@@ -223,6 +223,12 @@ Using environment variables to set param - .P - They can both be overridden by corresponding command line arguments: \fB\-#\fR for compression level and \fB\-T#\fR for number of compression threads\. - . -+.SH Parallel Zstd OPTIONS +--- 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 + .IP "" 0 ++.SS Parallel Zstd OPTIONS +Additional options for the pzstd utility +.TP -+.BR \-p ", " --processes ++\fB\-p\fR, \fB\-\-processes\fR + number of threads to use for (de)compression (default:4) +. - .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\. - . + .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.0.tar.gz b/zstd-1.5.0.tar.gz deleted file mode 100644 index 09aa2cb..0000000 --- a/zstd-1.5.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5194fbfa781fcf45b98c5e849651aa7b3b0a008c6b72d4a0db760f3002291e94 -size 1851389 diff --git a/zstd-1.5.0.tar.gz.sig b/zstd-1.5.0.tar.gz.sig deleted file mode 100644 index 10ed5d3..0000000 --- a/zstd-1.5.0.tar.gz.sig +++ /dev/null @@ -1,17 +0,0 @@ ------BEGIN PGP SIGNATURE----- - -iQJFBAADCAAvFiEETvSsY0VfyfRUXZt974/plSi1L/0FAmCetpsRHHNpZ25pbmdA -enN0ZC5uZXQACgkQ74/plSi1L/35IA/+K6cAjoErVr92dvObAAtXpel+5VBixWjE -fxC7c5PDc4iU/KX4I3Jy9UqaM89roYil0C80K69/5NUIYksr6KZ+Ky+8nNrfmJtn -bbXDF5xEpHuYZl3+0YQaRx85R+bVfe7Zg5BK9JiqRBAQ5ViQBtIeV8Qm52e9Y2qM -zqEqzOWQKnDQITry0vOntl2YDrNOt/LkL0g8jqJpgjpOaCeITbHelg4iH+GZswTo -Nzm4CKqtW6pmdiIfw8s4+/2jzjeGx4WqfoXgn/NHu00pbGjL7o5A0Aa97PX1qIrN -kj9edtt5yOcq68FqZvDnJLS72z1E/RbHabmqUH/gXhK80t/FA0OeB/Cqk8HheN8F -V5nXsJCjbLuu0uCRmdwWAqFK4yCBcEfC6zDs/K2kXdJsZ7sU9sACwRhOGp3JkUyB -9u17n3qLBlNcK13/1t7EJZ3F5hv+uXwfbttSSkKZ81b10S6+KgD7L0sVZT8HpUEO -B+uf3mxII/HU08AV1oAq9B12tJvcP9i/hNHCEmb11PMMVbXuIrBlE1Tcb8nB+Jlr -t9NL+lYdkZ36zxqZO7FVPoUSloPDWVRfaATY0Bde6DI27yCQzMV8XJ8a8+4yrrSN -Yybb2AJMvumP6vf1NZ1rwR84/ZjntCOM5B9KCKJE1IY5usRWAXP0Y447xPPKo/eZ -W/aDitqa1N8= -=BVY7 ------END PGP SIGNATURE----- diff --git a/zstd-1.5.1.tar.gz b/zstd-1.5.1.tar.gz new file mode 100644 index 0000000..222049d --- /dev/null +++ b/zstd-1.5.1.tar.gz @@ -0,0 +1,3 @@ +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 new file mode 100644 index 0000000..50c5cba --- /dev/null +++ b/zstd-1.5.1.tar.gz.sig @@ -0,0 +1,17 @@ +-----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.changes b/zstd.changes index d3cd080..254a6c7 100644 --- a/zstd.changes +++ b/zstd.changes @@ -1,3 +1,34 @@ +------------------------------------------------------------------- +Wed Jan 5 13:12:22 UTC 2022 - Dirk Müller + +- add noexecstack.patch (bsc#1194337) + +------------------------------------------------------------------- +Mon Jan 3 09:18:49 UTC 2022 - Dirk Müller + +- fix pkgconfig pc file settings by passing in right prefix during build + +------------------------------------------------------------------- +Mon Dec 27 14:59:02 UTC 2021 - Dirk Müller + +- update to 1.5.1: + * perf: rebalanced compression levels, to better match the intended speed/level curve + * perf: faster huffman decoder, using x64 assembly + * perf: slightly faster high speed modes (strategies fast & dfast) + * perf: improved binary size and faster compilation times + * perf: new row64 mode, used notably in level 12 + * perf: faster mid-level compression speed in presence of highly repetitive patterns + * perf: minor compression ratio improvements for small data at high levels + * perf: reduced stack usage (mostly useful for Linux Kernel) + * perf: faster compression speed on incompressible data + * perf: on-demand reduced ZSTD_DCtx state size, using build macro ZSTD_DECODER_INTERNAL_BUFFER, at a small cost of performance + * build: allows hiding static symbols in the dynamic library, using build macro + * build: support for m68k (Motorola 68000's) + * build: improved AIX support + * build: improved meson unofficial build + * cli : custom memory limit when training dictionary (#2925) + * cli : report advanced parameters information when compressing in very verbose mode (``-vv`) + ------------------------------------------------------------------- Fri May 14 20:34:25 UTC 2021 - Ismail Dönmez diff --git a/zstd.spec b/zstd.spec index da15b3a..d1bc791 100644 --- a/zstd.spec +++ b/zstd.spec @@ -1,7 +1,7 @@ # # spec file for package zstd # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,7 +19,7 @@ %define major 1 %define libname lib%{name}%{major} Name: zstd -Version: %{major}.5.0 +Version: %{major}.5.1 Release: 0 Summary: Zstandard compression tools License: BSD-3-Clause AND GPL-2.0-only @@ -30,6 +30,8 @@ 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++ @@ -47,8 +49,9 @@ compression than gzip. For roughly the same time, zstd achives a ~12%% better ratio than gzip. LZMA outperforms zstd by ~10%% faster compression for same ratio, or ~1–4%% size reduction for same time. -# This compression summary is based on https://lists.opensuse.org/opensuse-factory/2019-05/msg00344.html + +# This compression summary is based on https://lists.opensuse.org/opensuse-factory/2019-05/msg00344.html %package -n %{libname} Summary: Zstd compression library Group: System/Libraries @@ -89,9 +92,9 @@ Needed for compiling programs that link with the library. %build %global _lto_cflags %{_lto_cflags} -ffat-lto-objects export CFLAGS="%{optflags}" -export CXXFLAGS="%{optflags} -std=c++11" +export CXXFLAGS="$CFLAGS -std=c++11" # lib-mt is alias for multi-threaded library support -%make_build -C lib lib-mt +%make_build prefix=%{_prefix} libdir=%{_libdir} -C lib lib-mt for dir in programs contrib/pzstd; do %make_build -C "$dir" done @@ -103,7 +106,7 @@ export CXXFLAGS="%{optflags} -std=c++11" #make %{?_smp_mflags} -C contrib/pzstd test-pzstd %install -%make_install V=1 VERBOSE=1 PREFIX=%{_prefix} LIBDIR=%{_libdir} +%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