]> git.ipfire.org Git - thirdparty/zstd.git/log
thirdparty/zstd.git
3 years agoReduce bit tables to 8bit 2930/head
Norbert Lange [Tue, 14 Dec 2021 21:33:49 +0000 (22:33 +0100)] 
Reduce bit tables to 8bit

This saves some 1.7Kb in rodata section (x86_64, zstd tool),
while assembler code stays the same except
the type of a few load/extend instructions.

Should not have negative performance implications.

3 years agoAdd typedefs for 8bit (un)signed
Norbert Lange [Tue, 14 Dec 2021 21:33:39 +0000 (22:33 +0100)] 
Add typedefs for 8bit (un)signed

To make code more expressive, add U8 and S8 typedefs

3 years agoFix performance degradation with -m32 (#2926)
binhdvo [Tue, 14 Dec 2021 20:53:50 +0000 (15:53 -0500)] 
Fix performance degradation with -m32 (#2926)

3 years agoMerge pull request #2921 from felixhandte/neg-lvl-stagger-step
Felix Handte [Tue, 14 Dec 2021 19:13:57 +0000 (14:13 -0500)] 
Merge pull request #2921 from felixhandte/neg-lvl-stagger-step

Stagger Stepping in Negative Levels

3 years agoUpdate Regression Tests w/ New Sizes 2921/head
W. Felix Handte [Mon, 13 Dec 2021 22:29:32 +0000 (17:29 -0500)] 
Update Regression Tests w/ New Sizes

3 years agoIncrement Step by 1 not 2
W. Felix Handte [Mon, 13 Dec 2021 20:46:41 +0000 (15:46 -0500)] 
Increment Step by 1 not 2

I couldn't find a good way to spread `ip0` and `ip1` apart when we accelerate
due to incompressible inputs. (The methods I tried slowed things down quite a
bit.)

Since we aren't splaying ip0 and ip1 apart (which would be like `0_1_2_3_`, as
opposed to the `01__23__` we were actually doing), it's a big ambitious to
increment `step` by 2. Instead, let's increment it by 1, which has the benefit
sliiightly improving compression. Speed remains pretty much unchanged.

3 years agoMerge pull request #2905 from 15596858998/dev_1205
Nick Terrell [Mon, 13 Dec 2021 21:45:23 +0000 (13:45 -0800)] 
Merge pull request #2905 from 15596858998/dev_1205

add test case

3 years agoRewrite `step` to Track Increment Between Pairs of Positions
W. Felix Handte [Mon, 13 Dec 2021 19:48:26 +0000 (14:48 -0500)] 
Rewrite `step` to Track Increment Between Pairs of Positions

The position updates are rewritten from `ip[N] = ip[N-1] + step` to be
`ip[N] = ip[N-2] + step`. This lets us only deal with the asymmetric spacing
of gaps at setup and then we only have to keep a single `step` variable.

This seems to work quite well on GCC and Clang!

3 years agoAllow Templating `ZSTD_fast` Matchfinders on Acceleration (Lvl < -1)
W. Felix Handte [Mon, 13 Dec 2021 19:46:57 +0000 (14:46 -0500)] 
Allow Templating `ZSTD_fast` Matchfinders on Acceleration (Lvl < -1)

3 years agoMerge pull request #2923 from IAL32/patch-1
Felix Handte [Mon, 13 Dec 2021 18:15:21 +0000 (13:15 -0500)] 
Merge pull request #2923 from IAL32/patch-1

typo: Small spelling mistake in example

3 years agoUpdate playTests.sh 2905/head
zx123123 [Mon, 13 Dec 2021 00:58:42 +0000 (08:58 +0800)] 
Update playTests.sh

3 years agotypo: Small spelling mistake in example 2923/head
Adrian Castro [Sat, 11 Dec 2021 11:02:23 +0000 (12:02 +0100)] 
typo: Small spelling mistake in example

Just a couple of characters:
`main` -> `may`

3 years agoMerge pull request #2922 from facebook/x32
Yann Collet [Sat, 11 Dec 2021 08:12:10 +0000 (00:12 -0800)] 
Merge pull request #2922 from facebook/x32

x32 compatibility

3 years agofixed x32 compatibility 2922/head
Yann Collet [Sat, 11 Dec 2021 05:02:17 +0000 (21:02 -0800)] 
fixed x32 compatibility

3 years agoadded x32 compatibility test
Yann Collet [Sat, 11 Dec 2021 04:56:20 +0000 (20:56 -0800)] 
added x32 compatibility test

3 years agoDecompose `step` into Two Variables
W. Felix Handte [Fri, 10 Dec 2021 20:52:30 +0000 (15:52 -0500)] 
Decompose `step` into Two Variables

This avoids an additional addition, at the cost of an additional variable.

3 years agoStagger Application of `stepSize` in ZSTD_fast
W. Felix Handte [Fri, 10 Dec 2021 20:44:39 +0000 (15:44 -0500)] 
Stagger Application of `stepSize` in ZSTD_fast

This replicates the behavior of @terrelln's `ZSTD_fast` implementation. That
is, it always looks at adjacent pairs of positions, and only applies the
acceleration every other position. This produces a more fine-grained
acceleration.

3 years agocomplete changelog with #2885
Yann Collet [Thu, 9 Dec 2021 17:53:45 +0000 (09:53 -0800)] 
complete changelog with #2885

3 years agoMerge pull request #2917 from facebook/change151
Yann Collet [Thu, 9 Dec 2021 16:45:34 +0000 (08:45 -0800)] 
Merge pull request #2917 from facebook/change151

Update changelog for v1.5.1

3 years agoMerge pull request #2910 from felixhandte/reject-irregular-dicts
Felix Handte [Thu, 9 Dec 2021 16:44:37 +0000 (11:44 -0500)] 
Merge pull request #2910 from felixhandte/reject-irregular-dicts

Reject Irregular Dictionary Files

3 years agoUpdate changelog for v1.5.1 2917/head
Yann Collet [Thu, 9 Dec 2021 00:55:38 +0000 (16:55 -0800)] 
Update changelog for v1.5.1

3 years agoMerge pull request #2914 from facebook/xxhash081
Yann Collet [Thu, 9 Dec 2021 00:48:46 +0000 (16:48 -0800)] 
Merge pull request #2914 from facebook/xxhash081

updated xxHash to latest v0.8.1

3 years agoremove offending static assert lines 2914/head
Yann Collet [Wed, 8 Dec 2021 23:05:17 +0000 (15:05 -0800)] 
remove offending static assert lines

no idea why visual + clang-cl + appveyor don't like them,
I've not been able to reproduce the issue locally,
but these static assert are very unlikely to deliver a useful signal,
I can't imagine a situation where they will be wrong,
and if they are, then a ton of other things will be broken way before reaching that point.

3 years agoMerge pull request #2916 from terrelln/issue-2906
Nick Terrell [Wed, 8 Dec 2021 21:51:10 +0000 (16:51 -0500)] 
Merge pull request #2916 from terrelln/issue-2906

Remove possible NULL pointer addition

3 years agoaltered copyright title
Yann Collet [Wed, 8 Dec 2021 21:15:45 +0000 (13:15 -0800)] 
altered copyright title

3 years agoReject Irregular Dictionary Files 2910/head
W. Felix Handte [Mon, 6 Dec 2021 18:47:18 +0000 (13:47 -0500)] 
Reject Irregular Dictionary Files

I hadn't seen #2890, so I wrote my own version. I like this approach a little
better, since it does an explicit check for a regular file, rather than
passing a magic value.

Addresses #2874.

3 years agoremoved declarations of XXH3 symbols when XXH_NO_XXH3 is defined
Yann Collet [Wed, 8 Dec 2021 20:56:16 +0000 (12:56 -0800)] 
removed declarations of XXH3 symbols when XXH_NO_XXH3 is defined

on top of implementations, which were already scoped out.

3 years agoreplaces malloc / free / memcpy by Zstandard's version
Yann Collet [Wed, 8 Dec 2021 20:51:04 +0000 (12:51 -0800)] 
replaces malloc / free / memcpy by Zstandard's version

3 years agoRemove possible NULL pointer addition 2916/head
Nick Terrell [Wed, 8 Dec 2021 18:57:30 +0000 (10:57 -0800)] 
Remove possible NULL pointer addition

Refactor `ZSTDMT_isOverlapped()` to do NULL checks before computing the
end pointer.

Fixes #2906.

3 years agoMerge pull request #2915 from terrelln/oss-fuzz-build-fix
Nick Terrell [Wed, 8 Dec 2021 20:32:49 +0000 (15:32 -0500)] 
Merge pull request #2915 from terrelln/oss-fuzz-build-fix

Fix oss-fuzz build

3 years agoMerge pull request #2912 from felixhandte/pkg-config-fix
Felix Handte [Wed, 8 Dec 2021 20:22:56 +0000 (15:22 -0500)] 
Merge pull request #2912 from felixhandte/pkg-config-fix

Fix Up #2659; Build libzstd.pc Whenever Building the Lib on Unix

3 years agoFix oss-fuzz build 2915/head
Nick Terrell [Wed, 8 Dec 2021 18:31:40 +0000 (10:31 -0800)] 
Fix oss-fuzz build

Disable assembly when dataflow sanitizer is enabled.

This regressed in PR #2893, which accidentally removed the check for
dataflow sanitizer.

3 years agofixed very minor cast warning under cygwin
Yann Collet [Wed, 8 Dec 2021 17:17:06 +0000 (09:17 -0800)] 
fixed very minor cast warning under cygwin

3 years agoFix Up #2659; Build libzstd.pc Whenever Building the Lib on Unix 2912/head
W. Felix Handte [Tue, 7 Dec 2021 19:22:36 +0000 (14:22 -0500)] 
Fix Up #2659; Build libzstd.pc Whenever Building the Lib on Unix

3 years agoupdated xxHash to latest v0.8.1
Yann Collet [Wed, 8 Dec 2021 05:14:52 +0000 (21:14 -0800)] 
updated xxHash to latest v0.8.1

with minor modifications directly embedded in source :
- does not compile XXH3
- namespace emulation (ZSTD_ prefix)

Incidentally fix #2824

3 years agoImply -q when stderr is not a tty (#2884)
binhdvo [Tue, 7 Dec 2021 21:56:19 +0000 (16:56 -0500)] 
Imply -q when stderr is not a tty (#2884)

* Imply -q when stderr is not a tty

3 years agoMerge pull request #2659 from ericonr/pc
Felix Handte [Tue, 7 Dec 2021 19:18:38 +0000 (14:18 -0500)] 
Merge pull request #2659 from ericonr/pc

[lib] Fix libzstd.pc for lib-mt builds

3 years agoMerge pull request #2907 from Hello71/armv6-fix-legacy
Nick Terrell [Mon, 6 Dec 2021 20:41:22 +0000 (15:41 -0500)] 
Merge pull request #2907 from Hello71/armv6-fix-legacy

Apply FORCE_MEMORY_ACCESS=1 to legacy

3 years agoMerge pull request #2890 from 15596858998/dec_1201
Nick Terrell [Mon, 6 Dec 2021 18:18:15 +0000 (13:18 -0500)] 
Merge pull request #2890 from 15596858998/dec_1201

fixbug CLI's -D fails when the argument is not a regular file

3 years agoApply FORCE_MEMORY_ACCESS=1 to legacy 2907/head
Alex Xu (Hello71) [Mon, 6 Dec 2021 03:51:44 +0000 (22:51 -0500)] 
Apply FORCE_MEMORY_ACCESS=1 to legacy

See #2633, #2881.

3 years agoadd test case
15596858998 [Sun, 5 Dec 2021 11:12:52 +0000 (19:12 +0800)] 
add test case

3 years agoMerge pull request #2893 from terrelln/issue-2789
Nick Terrell [Fri, 3 Dec 2021 19:07:30 +0000 (14:07 -0500)] 
Merge pull request #2893 from terrelln/issue-2789

[asm] Share portability macros and restrict ASM further

3 years agoMerge pull request #2897 from felixhandte/zstd-deprecated-avoid-deprecated
Felix Handte [Fri, 3 Dec 2021 17:09:58 +0000 (12:09 -0500)] 
Merge pull request #2897 from felixhandte/zstd-deprecated-avoid-deprecated

Avoid Using Deprecated Functions in Deprecated Code

3 years agoMerge pull request #2899 from felixhandte/cmake-disable-multithreading-android
Felix Handte [Fri, 3 Dec 2021 17:09:39 +0000 (12:09 -0500)] 
Merge pull request #2899 from felixhandte/cmake-disable-multithreading-android

Disable Multithreading in CMake Builds for Android

3 years ago[asm] Share portability macros and restrict ASM further 2893/head
Nick Terrell [Wed, 1 Dec 2021 20:52:23 +0000 (12:52 -0800)] 
[asm] Share portability macros and restrict ASM further

Move portability macros to `lib/common/portability_macros.h`. This file
only contains platform/feature detection (e.g. 0/1 macros). This file is
shared between C and ASM code, so it cannot include any C code.

Rename `HUF_` ASM macros to be `ZSTD_` prefixed, and move to the new
header.

Restrict `ZSTD_ASM_SUPPORTED` to `__GNUC__`, because we need the GAS
assembler.

Finally, only include the ASM code if we are actually going to use it.
This disables it on all Windows platforms, which should resolve the
problem brought up in Issue #2789.

3 years agoMerge pull request #2900 from terrelln/issue-2893-test
Nick Terrell [Fri, 3 Dec 2021 00:51:33 +0000 (19:51 -0500)] 
Merge pull request #2900 from terrelln/issue-2893-test

[CI] Add cmake windows build

3 years agoMerge pull request #2898 from terrelln/issue-2862
Nick Terrell [Fri, 3 Dec 2021 00:49:43 +0000 (19:49 -0500)] 
Merge pull request #2898 from terrelln/issue-2862

Improve zstd_opt build speed and size

3 years ago[CI] Add cmake windows build 2900/head
Nick Terrell [Thu, 2 Dec 2021 22:42:17 +0000 (14:42 -0800)] 
[CI] Add cmake windows build

Build on windows with cmake to ensure everything compiles.

3 years agoMerge pull request #2896 from facebook/m68k
Yann Collet [Thu, 2 Dec 2021 22:25:45 +0000 (14:25 -0800)] 
Merge pull request #2896 from facebook/m68k

Zstandard compiles and run on m68k cpus

3 years agoDisable Multithreading in CMake Builds for Android 2899/head
W. Felix Handte [Thu, 2 Dec 2021 22:23:42 +0000 (17:23 -0500)] 
Disable Multithreading in CMake Builds for Android

3 years agoImprove zstd_opt build speed and size 2898/head
Nick Terrell [Thu, 2 Dec 2021 21:32:53 +0000 (13:32 -0800)] 
Improve zstd_opt build speed and size

Use the same trick as we did for zstd_lazy in PR #2828:
* Create one search function specialization for each (dictMode, mls).
* Select the search function pointer at the top of the match finder.

Additionally, we no longer inline `ZSTD_compressBlock_opt_generic` into
every function, since `dictMode` is no longer used as a template. Create
two specializations, for opt levels 0 and 2, and call one of the two
specializations.

Lastly, remove the hack that disabled inlining for zstd_opt for the
Linux Kernel, as we've gotten most of the benefit already.

Compilation time sees a ~4x reduction:

| Compiler | Flags                            | Dev Time (s) | PR Time (s) | Delta |
|----------|----------------------------------|--------------|-------------|-------|
| gcc      | -O3                              |         10.1 |         2.3 |  -77% |
| gcc      | -O3 -fsanitize=address,undefined |         61.1 |        10.2 |  -83% |
| clang    | -O3                              |          9.0 |         2.1 |  -76% |
| clang    | -O3 -fsanitize=address,undefined |         33.5 |         5.1 |  -84% |

Build size is reduced by 150KB - 200KB:

| Compiler | Dev libzstd.a Size (B) | PR libzstd.a Size (B) | Delta |
|----------|------------------------|-----------------------|-------|
| gcc      |                1327476 |               1177108 |  -11% |
| clang    |                1378324 |               1167780 |  -15% |

There is a <2% speed loss in all cases:

| Compiler | Level | Dev Speed (MB/s) | PR Speed (MB/s) | Delta  |
|----------|-------|------------------|-----------------|--------|
| gcc      |    16 |             4.78 |            4.72 | -1.25% |
| gcc      |    17 |             3.49 |            3.46 | -0.85% |
| gcc      |    18 |             2.92 |            2.86 | -2.04% |
| gcc      |    19 |             2.61 |            2.61 |  0.00% |
| clang    |    16 |             4.69 |            4.80 |  2.34% |
| clang    |    17 |             3.53 |            3.49 | -1.13% |
| clang    |    18 |             2.86 |            2.85 | -0.34% |
| clang    |    19 |             2.61 |            2.61 |  0.00% |

Fixes Issue #2862.

3 years agoFix Include Path 2897/head
W. Felix Handte [Thu, 2 Dec 2021 21:53:52 +0000 (16:53 -0500)] 
Fix Include Path

3 years agoMerge pull request #2892 from terrelln/issue-2785
Nick Terrell [Thu, 2 Dec 2021 21:20:56 +0000 (16:20 -0500)] 
Merge pull request #2892 from terrelln/issue-2785

[CircleCI] Fix short-tests-0

3 years agoMigrate to `FORWARD_IF_ERROR`
W. Felix Handte [Thu, 2 Dec 2021 21:06:07 +0000 (16:06 -0500)] 
Migrate to `FORWARD_IF_ERROR`

3 years agochanged macro name to ZSTD_ALIGNOF 2896/head
Yann Collet [Thu, 2 Dec 2021 20:57:42 +0000 (12:57 -0800)] 
changed macro name to ZSTD_ALIGNOF

for better consistency

3 years agobound alignment backup to sizeof(void*)
Yann Collet [Thu, 2 Dec 2021 19:30:03 +0000 (11:30 -0800)] 
bound alignment backup to sizeof(void*)

3 years agoAvoid Using Deprecated Functions in Deprecated Code
W. Felix Handte [Thu, 2 Dec 2021 19:25:33 +0000 (14:25 -0500)] 
Avoid Using Deprecated Functions in Deprecated Code

`lib/deprecated` is no longer built by zstd's bundled build files. However,
users may try to build these files when they import the source tree into
their own build systems. And if they have `-Wdeprecated-declarations` on,
this can produce warnings.

This PR migrates these files away from using deprecated declarations.

This addresses #2767.

3 years agomove the alignment macro to compiler.h
Yann Collet [Thu, 2 Dec 2021 19:20:01 +0000 (11:20 -0800)] 
move the alignment macro to compiler.h

because mem.h is dropped in the Linux kernel.

Changed macro definition order (gcc/clang/msvc before c11)
due to a limitation in the kernel source builder.

Changed the backup to sizeof(),
reverting to previous behavior when no support of alignof() is detected.

3 years agoMerge pull request #2891 from supperPants/dev
Nick Terrell [Thu, 2 Dec 2021 18:53:33 +0000 (13:53 -0500)] 
Merge pull request #2891 from supperPants/dev

Fix typos

3 years agoMerge pull request #2687 from sapiippo/dev
Yann Collet [Thu, 2 Dec 2021 18:53:02 +0000 (10:53 -0800)] 
Merge pull request #2687 from sapiippo/dev

Makefile: fix build for mingw

3 years agoMerge pull request #2894 from facebook/tomerge2051
Yann Collet [Thu, 2 Dec 2021 18:52:46 +0000 (10:52 -0800)] 
Merge pull request #2894 from facebook/tomerge2051

merge #2501

3 years agom68k CI tests on GA are now compulsory
Yann Collet [Thu, 2 Dec 2021 18:30:04 +0000 (10:30 -0800)] 
m68k CI tests on GA are now compulsory

3 years agoMerge pull request #2895 from kanavin/fix-repro
Nick Terrell [Thu, 2 Dec 2021 18:20:15 +0000 (13:20 -0500)] 
Merge pull request #2895 from kanavin/fix-repro

Makefile: sort all wildcard file list expansions

3 years agoMakefile: sort all wildcard file list expansions 2895/head
Alexander Kanavin [Wed, 23 Dec 2020 18:14:32 +0000 (19:14 +0100)] 
Makefile: sort all wildcard file list expansions

Otherwise the order is non-deterministic and breaks
reproducible builds.

3 years agofix align conditions for huf_compress
Yann Collet [Thu, 2 Dec 2021 07:02:00 +0000 (23:02 -0800)] 
fix align conditions for huf_compress

3 years ago[CircleCI] Fix short-tests-0 2892/head
Nick Terrell [Wed, 1 Dec 2021 19:49:58 +0000 (11:49 -0800)] 
[CircleCI] Fix short-tests-0

short-tests-0 were silently failing. I think because of the && make clean construction. Switch to ; instead.

Also fix all the test failures that were exposed.

`make all` is failing on CircleCI because it is missing Docker. Move that test
to GitHub actions, and switch the pedantic CircleCI test to `make allmost`.

3 years agoadded alignment test
Yann Collet [Thu, 2 Dec 2021 01:16:36 +0000 (17:16 -0800)] 
added alignment test

and fix an incorrect alignment check in cwksp which was failing on m68k

3 years agoremoved lib/Makefile preamble 2894/head
Yann Collet [Thu, 2 Dec 2021 00:54:59 +0000 (16:54 -0800)] 
removed lib/Makefile preamble

now included from libzstd.mk

3 years agoMerge branch 'dev' into tomerge2051
Yann Collet [Wed, 1 Dec 2021 23:29:49 +0000 (15:29 -0800)] 
Merge branch 'dev' into tomerge2051

3 years agoMerge pull request #2501 from skitt/hide-static-symbols
Yann Collet [Wed, 1 Dec 2021 23:26:42 +0000 (15:26 -0800)] 
Merge pull request #2501 from skitt/hide-static-symbols

Explicitly hide static symbols

3 years agoMerge pull request #2887 from terrelln/issue-2815
Nick Terrell [Wed, 1 Dec 2021 23:15:53 +0000 (18:15 -0500)] 
Merge pull request #2887 from terrelln/issue-2815

[zdict] Remove ZDICT_CONTENTSIZE_MIN restriction for ZDICT_finalizeDictionary

3 years agoreduce storage requirement
Yann Collet [Wed, 1 Dec 2021 23:10:55 +0000 (15:10 -0800)] 
reduce storage requirement

51 MB seems excessive for CI storate and considering the nature of the test.

(note : maybe we should consider using `/tmp` for files generated during tests,
as tmpfs is typically using RAM, thus preserving storage.)

3 years agoMerge pull request #2876 from 15596858998/dev
Yann Collet [Wed, 1 Dec 2021 23:10:08 +0000 (15:10 -0800)] 
Merge pull request #2876 from 15596858998/dev

Solve the bug of extra output newline character

3 years agoMerge pull request #2885 from yoniko/limit-level-32bit-systems
Yann Collet [Wed, 1 Dec 2021 22:19:16 +0000 (14:19 -0800)] 
Merge pull request #2885 from yoniko/limit-level-32bit-systems

Limit `ZSTD_maxCLevel` to 21 for 32-bit binaries.

3 years agoMerge pull request #2886 from terrelln/issue-2865
Nick Terrell [Wed, 1 Dec 2021 18:05:35 +0000 (13:05 -0500)] 
Merge pull request #2886 from terrelln/issue-2865

[test] Test that the exec-stack bit isn't set on libzstd.so

3 years agoMerge pull request #2888 from terrelln/issue-2814
Nick Terrell [Wed, 1 Dec 2021 18:05:09 +0000 (13:05 -0500)] 
Merge pull request #2888 from terrelln/issue-2814

[bmi2] Add lzcnt and bmi target attributes

3 years agoMerge pull request #2889 from terrelln/issue-2811
Nick Terrell [Wed, 1 Dec 2021 18:03:03 +0000 (13:03 -0500)] 
Merge pull request #2889 from terrelln/issue-2811

[contrib][pzstd] Fix build issue with gcc-5

3 years agoMerge https://github.com/facebook/zstd into dev 2891/head
supperPants [Wed, 1 Dec 2021 14:41:24 +0000 (22:41 +0800)] 
Merge https://github.com/facebook/zstd into dev

3 years agoFix typos.
supperPants [Wed, 1 Dec 2021 14:36:21 +0000 (22:36 +0800)] 
Fix typos.

3 years agofixbug CLI's -D fails when the argument is not a regular file 2890/head
15596858998 [Wed, 1 Dec 2021 13:47:35 +0000 (21:47 +0800)] 
fixbug CLI's -D fails when the argument is not a regular file

3 years ago[contrib][pzstd] Fix build issue with gcc-5 2889/head
Nick Terrell [Wed, 1 Dec 2021 02:26:11 +0000 (18:26 -0800)] 
[contrib][pzstd] Fix build issue with gcc-5

gcc-5 didn't like the l-value overload for defaulted operator=. There is
no reason it needs to be l-value overloaded, so just remove it.

I'm not sure why the build broke for @mckaygerhard in Issue #2811, since
this code hasn't changed since it was added. But, there is no harm in
fixing it.

Fixes issue #2811.

3 years ago[test] Test that the exec-stack bit isn't set on libzstd.so 2886/head
Nick Terrell [Tue, 30 Nov 2021 20:29:55 +0000 (12:29 -0800)] 
[test] Test that the exec-stack bit isn't set on libzstd.so

Tests that libzstd.so doesn't have the exec-stack bit set using
readelf. If the stack is marked executable systemd will refuse
to link against zstd. We now test that it isn't set on every PR.

Adds a test for PR #2857
Fixes Issue #2865

3 years ago[zdict] Remove ZDICT_CONTENTSIZE_MIN restriction for ZDICT_finalizeDictionary 2887/head
Nick Terrell [Wed, 1 Dec 2021 00:51:16 +0000 (16:51 -0800)] 
[zdict] Remove ZDICT_CONTENTSIZE_MIN restriction for ZDICT_finalizeDictionary

Allow the `dictContentSize` to be any size. The finalized dictionary
content size must be at least as large as the maximum repcode (8). So we
add zero bytes to the dictionary to ensure that we meet that
requirement.

I've removed this restriction because its been causing us headaches when
people complain that dictionary training failed. It fails because there
isn't enough useful content to put in the dictionary. Either because
every sample is exactly the same and less than ZDICT_CONTENTSIZE_MIN bytes,
or there isn't enough content. Instead, we should succeed in creating
the dictionary, and it is up to the user to decide if it is worthwhile.
It is possible that the tables alone provide enough value.

NOTE: This allows us to produce dictionaries with finalized
`dictContentSize < ZDICT_CONTENTSIZE_MIN`. But, they are still valid
zstd dictionaries. We could remove the `ZDICT_CONTENTSIZE_MIN` macro,
but I've decided to leave that for now, so we don't break users.

3 years ago[bmi2] Add lzcnt and bmi target attributes 2888/head
Nick Terrell [Wed, 1 Dec 2021 01:43:28 +0000 (17:43 -0800)] 
[bmi2] Add lzcnt and bmi target attributes

* When dynamic dispatching to bmi2 add lzcnt and bmi to the
  TARGET_ATTRIBUTE.
* Centralize the bmi2 TARGET_ATTRIBUTE definition to
  BMI2_TARGET_ATTRIBUTE so we can change it in the future.
* Only enable bmi2 when both bmi1 & bmi2 are supported. There shouldn't
  be any cases where bmi2 is supported but bmi1 isn't. But, since we are
  using the instruction we should check bmi1 as well.

3 years agoMerge pull request #2877 from jannkoeker/dev
Yann Collet [Wed, 1 Dec 2021 01:39:38 +0000 (17:39 -0800)] 
Merge pull request #2877 from jannkoeker/dev

Add detection when compiling with Clang and Ninja under Windows

3 years agoMerge pull request #2872 from cntrump/fix_umbrella_header_warning_for_spm
Nick Terrell [Tue, 30 Nov 2021 19:10:00 +0000 (14:10 -0500)] 
Merge pull request #2872 from cntrump/fix_umbrella_header_warning_for_spm

Fix SPM warning: umbrella header for module 'libzstd' does not include header 'xxx.h'

3 years ago`ZSTD_maxCLevel` now limited to 21 for 32-bit binaries. 2885/head
Yonatan Komornik [Tue, 30 Nov 2021 18:31:52 +0000 (10:31 -0800)] 
`ZSTD_maxCLevel` now limited to 21 for 32-bit binaries.
CI tests for constrained memory runs with max level on 32-bit binaries.

3 years agoMerge pull request #2845 from senhuang42/appveyor_msvc2
sen [Tue, 30 Nov 2021 18:12:08 +0000 (13:12 -0500)] 
Merge pull request #2845 from senhuang42/appveyor_msvc2

Move visual studio tests from per-release to per-PR

3 years agoAdd GH Actions windows runtime test 2845/head
senhuang42 [Mon, 29 Nov 2021 18:09:56 +0000 (13:09 -0500)] 
Add GH Actions windows runtime test

3 years agoFix build for cygwin/bsd (#2882)
binhdvo [Mon, 29 Nov 2021 19:11:39 +0000 (14:11 -0500)] 
Fix build for cygwin/bsd (#2882)

3 years agoClarify documentation for -c (#2883)
binhdvo [Mon, 29 Nov 2021 19:10:43 +0000 (14:10 -0500)] 
Clarify documentation for -c (#2883)

3 years agomsvc tests to dev
senhuang42 [Wed, 3 Nov 2021 13:48:34 +0000 (16:48 +0300)] 
msvc tests to dev

3 years agoUpdate CMakeLists.txt 2877/head
Jann Köker [Wed, 24 Nov 2021 10:35:36 +0000 (11:35 +0100)] 
Update CMakeLists.txt

 Prevents multiple rules error when building with ninja and clang under windows

3 years agoRemove zstd-umbrella.h 2872/head
Lvv.me [Tue, 23 Nov 2021 23:48:40 +0000 (07:48 +0800)] 
Remove zstd-umbrella.h

3 years ago更新 fileio.c 2871/head 2876/head
15596858998 [Tue, 23 Nov 2021 14:08:23 +0000 (22:08 +0800)] 
更新 fileio.c

Solve the logic problem of wrong output of newline characters.

3 years agoFix SPM warning: umbrella header for module 'libzstd' does not include header 'xxx.h'
Lvv.me [Sun, 21 Nov 2021 13:57:55 +0000 (21:57 +0800)] 
Fix SPM warning: umbrella header for module 'libzstd' does not include header 'xxx.h'

3 years ago更新 playTests.sh
15596858998 [Sun, 21 Nov 2021 04:35:58 +0000 (12:35 +0800)] 
更新 playTests.sh

3 years agoMerge pull request #2869 from felixhandte/oss-fuzz-fix-41005
Felix Handte [Thu, 18 Nov 2021 15:11:48 +0000 (10:11 -0500)] 
Merge pull request #2869 from felixhandte/oss-fuzz-fix-41005

Determinism: Avoid Mapping Window into Reserved Indices during Reduction

3 years agoDeterminism: Avoid Mapping Window into Reserved Indices during Reduction 2869/head
W. Felix Handte [Wed, 17 Nov 2021 23:09:18 +0000 (18:09 -0500)] 
Determinism: Avoid Mapping Window into Reserved Indices during Reduction

PR #2850 attempted to fix a determinism bug that was uncovered by OSS-Fuzz. It
succeeded in addressing that source of non-determinism, but introduced a new
one: it was possible, when index reduction occurred, to map indices in the
window to the reserved value, which would cause them to be zeroed, potentially
altering parsing of the input.

This PR addresses this issue. It makes sure that the bottom of the window is
always `>= ZSTD_WINDOW_START_INDEX`.

I'm not sure if this makes #2850 redundant. I think it's probably still
valuable to have that protection as well.

Credit to OSS-Fuzz for discovering this issue.

3 years agoMerge pull request #2856 from rex4539/typos
Yann Collet [Wed, 17 Nov 2021 21:04:30 +0000 (13:04 -0800)] 
Merge pull request #2856 from rex4539/typos

Fix typos