1
0
mirror of https://github.com/facebook/zstd.git synced 2025-03-07 01:10:04 +02:00

9199 Commits

Author SHA1 Message Date
Nick Terrell
91f5891dd0 [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`.
2021-12-01 17:43:46 -08:00
Nick Terrell
e34e58b458
Merge pull request #2886 from terrelln/issue-2865
[test] Test that the exec-stack bit isn't set on libzstd.so
2021-12-01 13:05:35 -05:00
Nick Terrell
8f9f6442f5
Merge pull request #2888 from terrelln/issue-2814
[bmi2] Add lzcnt and bmi target attributes
2021-12-01 13:05:09 -05:00
Nick Terrell
906c3e9ccb
Merge pull request #2889 from terrelln/issue-2811
[contrib][pzstd] Fix build issue with gcc-5
2021-12-01 13:03:03 -05:00
Nick Terrell
a7a469e095 [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.
2021-11-30 18:29:02 -08:00
Nick Terrell
360c2630e4 [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
2021-11-30 18:13:00 -08:00
Nick Terrell
5414dd7978 [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.
2021-11-30 17:54:56 -08:00
Yann Collet
bf0a74663e
Merge pull request #2877 from jannkoeker/dev
Add detection when compiling with Clang and Ninja under Windows
2021-11-30 17:39:38 -08:00
Nick Terrell
7847c2fd68
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'
2021-11-30 14:10:00 -05:00
sen
9bc94b2929
Merge pull request #2845 from senhuang42/appveyor_msvc2
Move visual studio tests from per-release to per-PR
2021-11-30 13:12:08 -05:00
senhuang42
0907ab5f15 Add GH Actions windows runtime test 2021-11-29 18:25:19 -05:00
binhdvo
d7e1736375
Fix build for cygwin/bsd (#2882) 2021-11-29 14:11:39 -05:00
binhdvo
7abebc847b
Clarify documentation for -c (#2883) 2021-11-29 14:10:43 -05:00
senhuang42
20660a02e2 msvc tests to dev 2021-11-29 09:06:17 -05:00
Jann Köker
0a36c104ca
Update CMakeLists.txt
Prevents multiple rules error when building with ninja and clang under windows
2021-11-24 11:35:36 +01:00
Lvv.me
944c71c07d
Remove zstd-umbrella.h 2021-11-24 07:48:40 +08:00
Lvv.me
ebf664b744
Fix SPM warning: umbrella header for module 'libzstd' does not include header 'xxx.h' 2021-11-21 21:57:55 +08:00
Felix Handte
c2c6a4ab40
Merge pull request #2869 from felixhandte/oss-fuzz-fix-41005
Determinism: Avoid Mapping Window into Reserved Indices during Reduction
2021-11-18 10:11:48 -05:00
W. Felix Handte
66079085f0 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.
2021-11-17 18:09:18 -05:00
Yann Collet
a37a8df532
Merge pull request #2856 from rex4539/typos
Fix typos
2021-11-17 13:04:30 -08:00
Yann Collet
f56de118a0
Merge pull request #2858 from cntrump/support_swift_package_manager
Support Swift Package Manager
2021-11-16 20:50:07 -08:00
Nick Terrell
92c41c53ee
Merge pull request #2866 from terrelln/linux-O2
[linux-kernel] Don't add -O3 to CFLAGS
2021-11-16 17:23:23 -08:00
Nick Terrell
e2d01863bc [linux-kernel] Don't add -O3 to CFLAGS
It is no longer necessary to get good performance, there is only a small
speed difference between -O2 and -O3, so just stick to the default of
-O2. I've measured neutral compression speed and a ~3% decompression
speed loss in userspace with clang & gcc. I've also measured neutral
compression speed and a ~1% decompression speed loss in the kernel
benchmarks.

This also fixes the stack space usage on parisc. The compiler was buggy
for -O3 and used ~3KB of stack space for several functions. With -O2 the
problem is completely resolved, and stack space is back to a few hundred
bytes.

Additionally, we get a large code size win on gcc:

| Compiler | Before (Bytes) | After (Bytes) | Delta (Bytes) |
|----------|----------------|---------------|---------------|
| gcc-11   |         952754 |        738954 |       -213800 |
| clang-12 |         976290 |        938826 |        -37464 |
2021-11-16 15:42:36 -08:00
Nick Terrell
f343f27d17
Merge pull request #2857 from ko-zu/noexecstack
Remove executable flag from GNU_STACK segment
2021-11-16 14:37:56 -08:00
Nick Terrell
b7d899d99d
Merge pull request #2864 from terrelln/linux-opt
[linux-kernel] Don't inline function in zstd_opt.c
2021-11-16 14:13:39 -08:00
Nick Terrell
19eb459da3 [linux-kernel] Don't inline function in zstd_opt.c
The optimal parser is unlikely to be used in the linux kernel in
practice. There is no reason these functions should be force inlined,
since we aren't gaining anything, and are losing build size.

| Compiler | Before (Bytes) | After (Bytes) | Delta (Bytes) |
|----------|----------------|---------------|---------------|
| gcc-11   |        1142090 |        952754 |       -189336 |
| clang-12 |        1228402 |        976290 |       -252112 |

This is a temporary solution pending the resolution of PR #2862 in the
`dev` branch.
2021-11-15 20:37:30 -08:00
Nick Terrell
8dba88c3f6
Merge pull request #2863 from terrelln/fast-dfast-size
Reduce function size in fast & dfast
2021-11-15 20:15:22 -08:00
Nick Terrell
802ea885ef Reduce function size in fast & dfast
Take the same approach as in PR #2828 [0] to remove functions that force
inline many function bodies and `switch`. Instead, create one function per
"template" combination, and then switch between these functions. This
allows the compiler to break the large function into many small
functions, which generally helps codegen.

Also, in the `extDict` modes when there is no ext-dict, call the top
level function instead of the force inlined one, to save on code size.

I'm specifically doing this because gcc on the parisc architecture doesn't
handle the large function body well, and ends up using a lot of excess
stack space. Outlining these functions fixes it.
2021-11-15 19:05:48 -08:00
Lvv.me
81b96205af
Using module.modulemap replace symbol link for public header 2021-11-15 13:23:50 +08:00
Lvv.me
27455638aa
Support Swift Package Manager 2021-11-14 17:29:33 +08:00
ko-zu
c67e07f34e Remove executable flag from GNU_STACK section
Putting stack marking into every assembly files is required to indicate
that the stack does not need to be executable.
Executable flag on stack conflicts with some security measures, Systemd
MemoryDenyWriteExecute=yes for example.
2021-11-13 22:58:33 +09:00
Dimitris Apostolou
ebbd675998
Fix typos 2021-11-13 10:04:04 +02:00
Yann Collet
ddae153947
Merge pull request #2847 from Svetlitski-FB/improve-verbose-output-2
Display command line parameters with concrete values in verbose mode
2021-11-12 18:51:18 -08:00
Kevin Svetlitski
9b28c26cbf Integrate verbose mode tests into playTests.sh 2021-11-12 14:10:21 -08:00
Kevin Svetlitski
7fbd126e08 Suppress spurious unused parameter warning 2021-11-12 10:44:26 -08:00
Kevin Svetlitski
375e3aad6c Ensure formatting directives for displaying size_t are portable 2021-11-11 13:17:32 -08:00
Kevin Svetlitski
365c91194c Ensure print*CParams functions are only defined when used 2021-11-11 12:14:56 -08:00
Kevin Svetlitski
f6ffd39230 Add test case for detailed compression parameter verbose output 2021-11-11 11:59:54 -08:00
Yann Collet
9ba07907c8
Merge pull request #2836 from animalize/copy16
ZSTD_copy16() uses ZSTD_memcpy()
2021-11-11 07:53:08 -08:00
Kevin Svetlitski
df9b7755cb Fix const-ness of FIO_displayCompressionParameters 2021-11-10 17:25:27 -08:00
Kevin Svetlitski
63fe6198ed Display --zstd= subparameters in command-line ready form in verbose mode 2021-11-10 17:20:43 -08:00
Felix Handte
a071e00696
Merge pull request #2850 from felixhandte/oss-fuzz-fix-40829-for-real-this-time
Fix Determinism Bug: Avoid Reducing Indices to Reserved Values
2021-11-10 12:00:43 -05:00
binhdvo
931778ed9b
Fix fullbench CI failure (#2851) 2021-11-09 15:15:35 -05:00
W. Felix Handte
48572f52b1 Rewrite Fix to Still Auto-Vectorize 2021-11-09 12:17:03 -05:00
W. Felix Handte
61765cacd0 Avoid Reducing Indices to Reserved Values
Previously, if an index was equal to `reducerValue + 1`, it would get remapped
during index reduction to 1 i.e. `ZSTD_DUBT_UNSORTED_MARK`. This can affect the
parsing of the input slightly, by causing tree nodes to be nullified when they
otherwise wouldn't be. This hardly matters from a correctness or efficiency
perspective, but it does impact determinism.

So this commit changes index reduction to avoid mapping indices to collide with
`ZSTD_DUBT_UNSORTED_MARK`.
2021-11-08 20:03:52 -05:00
Nick Terrell
793b6cec73
Merge pull request #2849 from terrelln/linux-kernel-backport
Backport zstd patch from LKML
2021-11-05 15:02:37 -07:00
Nick Terrell
d46995efeb Backport zstd patch from LKML
Credit to Nathan Chancellor for the bug fix and Nick Desaulniers for the
bug report.

Link: https://github.com/ClangBuiltLinux/linux/issues/1486
Link: https://lore.kernel.org/all/20211021202353.2356400-1-nathan@kernel.org/
2021-11-05 14:09:49 -07:00
sen
379c62a7d4
Merge pull request #2846 from senhuang42/fix_appveyor
Use unused functions to appease Visual Studio
2021-11-05 23:24:25 +03:00
Kevin Svetlitski
0665d4c1c2 Display command line parameters with concrete values in verbose mode 2021-11-05 12:01:20 -07:00
Yann Collet
5375d75c55
Merge pull request #2839 from Svetlitski-FB/improve-verbose-output
Improvements to verbose mode output - decompression memory usage
2021-11-04 18:26:42 -07:00