9395 Commits

Author SHA1 Message Date
Yann Collet
71921e596f
Merge pull request #2983 from facebook/minLitPricev2
[opt] minor compression ratio improvement
2022-01-20 16:02:31 -08:00
Felix Handte
330c97d2bf
Merge pull request #3015 from felixhandte/enable-cet-test-illegal-instruction
Add GitHub Action Checking that Zstd Runs Successfully Under CET
2022-01-20 16:18:42 -05:00
Elliot Gorokhovsky
a8f1aa2f6d
Merge pull request #3016 from embg/macro_lint
Minor lint fix
2022-01-20 13:05:02 -07:00
Felix Handte
c7e8315d88
Merge pull request #2994 from hjl-tools/hjl/cet-report/dev
x86: Append -z cet-report=error to LDFLAGS
2022-01-20 14:58:13 -05:00
Elliot Gorokhovsky
f936dd89cb Minor lint fix 2022-01-20 11:54:43 -07:00
H.J. Lu
d6fcdd123c x86: Append -z cet-report=error to LDFLAGS
Append -z cet-report=error to LDFLAGS if -fcf-protection is enabled by
default in compiler to catch the missing Intel CET marker:

compiling multi-threaded dynamic library 1.5.1
/usr/local/bin/ld: obj/conf_f408b4c825de923ffc88f7f21b6884b1/dynamic/huf_decompress_amd64.o: error: missing IBT and SHSTK properties
collect2: error: ld returned 1 exit status
...
LINK obj/conf_dbc0b41e36c44111bb0bb918e093d7c1/zstd
/usr/local/bin/ld: obj/conf_dbc0b41e36c44111bb0bb918e093d7c1/huf_decompress_amd64.o: error: missing IBT and SHSTK properties
collect2: error: ld returned 1 exit status
2022-01-20 08:32:01 -08:00
W. Felix Handte
7cf80cb94c Add GitHub Action Checking that Zstd Runs Successfully Under CET 2022-01-20 11:25:52 -05:00
Felix Handte
4dfc4eca9a
Merge pull request #2992 from hjl-tools/hjl/cet/dev
x86-64: Enable Intel CET
2022-01-20 11:24:47 -05:00
Elliot Gorokhovsky
40bc9ee6c4
Merge pull request #2999 from embg/ci_instructions_update
Update CI documentation
2022-01-19 10:03:07 -07:00
Elliot Gorokhovsky
8250faa01b Update CI documentation 2022-01-19 09:58:31 -07:00
Nick Terrell
ef1eafded3
Merge pull request #3009 from terrelln/asm-flags
[build][asm] Pass ASFLAGS to the assembler instead of CFLAGS
2022-01-18 15:48:11 -08:00
Nick Terrell
3369a106eb
Merge pull request #2998 from floppym/issue2997
Avoid updating timestamps when the destination is stdout
2022-01-18 15:14:06 -08:00
Nick Terrell
8ea3d57de4 [build][asm] Pass ASFLAGS to the assembler instead of CFLAGS
* Add `-Wa,--noexecstack` to both `ASFLAGS` and `CFLAGS`
* Pass `ASFLAGS` to `.S` compilation instead of `CFLAGS`

Fixes #3006.
2022-01-18 15:11:29 -08:00
Elliot Gorokhovsky
fe8fefb28d
Merge pull request #3000 from embg/mt_memory_readability
Documentation and minor refactor to clarify MT memory management
2022-01-18 10:18:01 -07:00
Elliot Gorokhovsky
9b6dfedf0c Documentation and minor refactor to clarify MT memory management. 2022-01-18 09:43:05 -07:00
hjl-tools
ff92884a89
Merge branch 'facebook:dev' into hjl/cet/dev 2022-01-16 10:07:32 -08:00
Mike Gilbert
57a86d9ec6 Avoid updating timestamps when the destination is stdout
Fixes: 9cd6c1ff4d56fc74a2cbdfd9bcc82a64e0fe4bb7
Fixes: https://github.com/facebook/zstd/issues/2997
2022-01-13 16:47:18 -05:00
Felix Handte
f4a552a3fa
Merge pull request #2987 from felixhandte/prepare-v1.5.2
Prepare v1.5.2
2022-01-11 17:47:39 -05:00
H.J. Lu
51ab182bd4 x86-64: Enable Intel CET
Intel Control-flow Enforcement Technology (CET):

https://en.wikipedia.org/wiki/Control-flow_integrity#Intel_Control-flow_Enforcement_Technology

requires that on Linux, all linker input files are marked as CET enabled
in .note.gnu.property section.  For high-level language source codes,
.note.gnu.property section is added by compiler with the -fcf-protection
option.  For assembly sources, include <cet.h> to add .note.gnu.property
section.
2022-01-11 13:19:16 -08:00
Felix Handte
e113c0ca49
Merge pull request #2993 from hjl-tools/hjl/asm/dev
x86-64: Hide internal assembly functions
2022-01-11 14:31:51 -05:00
Felix Handte
4dfaf0003f
Merge pull request #2957 from hmaarrfk/fix_cmake_msvc
Fixup MSVC source file inclusion for cmake builds
2022-01-11 13:25:16 -05:00
Yann Collet
05e884f288
Merge pull request #2956 from sunwire/fix-tar-test-cases
Fix tar test cases
2022-01-11 10:16:34 -08:00
Yann Collet
78633272a0
Merge pull request #2982 from terrelln/decompress-progress-0
Fix stderr progress logging for decompression
2022-01-11 10:15:15 -08:00
H.J. Lu
568c69a4eb x86-64: Hide internal assembly functions
Hide x86-64 internal assembly functions. Before

$ nm -D lib/libzstd.so.1 | grep usingDTable_internal_bmi2_asm_loop
00000000000c23c0 T _HUF_decompress4X1_usingDTable_internal_bmi2_asm_loop
00000000000c23c0 T HUF_decompress4X1_usingDTable_internal_bmi2_asm_loop
00000000000c283d T _HUF_decompress4X2_usingDTable_internal_bmi2_asm_loop
00000000000c283d T HUF_decompress4X2_usingDTable_internal_bmi2_asm_loop
$

After

$ nm -D lib/libzstd.so.1 | grep usingDTable_internal_bmi2_asm_loop
$

This fixes issue #2990.
2022-01-11 10:12:24 -08:00
W. Felix Handte
144879a7cd Update Changelog 2022-01-10 12:48:40 -05:00
Nick Terrell
308a11b8e8 Fix stderr progress logging for decompression
When decompressing with `-q` and an output file, the progress bar was mistakenly printed. This is a minimal fix, with a larger refactor to be stacked on top of it.

Fixes #2967.
2022-01-07 15:09:56 -08:00
Yann Collet
5595aec629 updated regression results 2022-01-07 15:08:06 -08:00
Yann Collet
ca0135c2fd new Formulation
presumes faster
2022-01-07 14:37:53 -08:00
Yann Collet
9e1b4828e5 enforce a minimum price of 1 bit per literal in the optimal parser 2022-01-07 13:53:48 -08:00
W. Felix Handte
e1323744b6 Update Docs 2022-01-07 14:14:26 -05:00
W. Felix Handte
46ad9377e8 Bump Version Number to 1.5.2 2022-01-07 14:14:26 -05:00
Nick Terrell
5f2c3d9720
Merge pull request #2981 from terrelln/asm-license
[license] Fix license header of huf_decompress_amd64.S
2022-01-07 11:06:30 -08:00
Nick Terrell
c7b03c217c [license] Fix license header of huf_decompress_amd64.S
* Add the license header for `huf_decompress_amd64.S`
* Add `.S` files to the `test-license.py` test
2022-01-07 09:35:27 -08:00
Nick Terrell
0677b26b6d
Merge pull request #2980 from terrelln/opt-oss-fuzz-fix
[opt] Fix oss-fuzz bug in optimal parser
2022-01-07 09:27:09 -08:00
Felix Handte
844c53ed75
Merge pull request #2977 from felixhandte/fix-2950
Remove Dependencies to Allow the Zstd Binary to Dynamically Link to the Library
2022-01-07 12:10:46 -05:00
Nick Terrell
4d8a2132d0 [opt] Fix oss-fuzz bug in optimal parser
oss-fuzz uncovered a scenario where we're evaluating the cost of litLength = 131072,
which can't be represented in the zstd format, so we accessed 1 beyond LL_bits.

Fix the issue by making it cost 1 bit more than litLength = 131071.

There are still follow ups:
1. This happened because literals_cost[0] = 0, so the optimal parser chose 36 literals
   over a match. Should we bound literals_cost[literal] > 0, unless the block truly only
   has one literal value?
2. When no matches are found, the cost model isn't updated. In this case no matches were
   found for an entire block. So the literals cost model wasn't updated at all. That made
   the optimal parser think literals_cost[0] = 0, where it is actually quite high, since
   the block was entirely random noise.

Credit to OSS-Fuzz.
2022-01-06 16:10:18 -08:00
W. Felix Handte
4bd96a61f1 Avoid xxHash Dependency by Inlining
xxHash symbols are present in `libzstd.so`, but they are local and therefore
unavailable outside the lib. There are two possible solutions to the problem.
We could make those symbols global, or we could remove the dependency.

This commit chooses the latter approach. I suppose this comes at the cost of
code size / build time. I'm open to comments on whether this is a good thing
to do, especially since this will apply even when we are statically linking
everything.
2022-01-06 00:25:26 -05:00
W. Felix Handte
fc946d131b Remove Unused Include 2022-01-06 00:25:26 -05:00
Felix Handte
26d88c05f0
Merge pull request #2953 from felixhandte/modulemap-improvements
Improve Module Map File
2022-01-05 23:54:50 -05:00
Mark Harfouche
df5ad5a0f1 Add a compile option to explicitely disable assembly 2022-01-05 20:38:00 -05:00
W. Felix Handte
1778222446 Update the Swift Package Definition to Reflect Move 2022-01-05 18:32:56 -05:00
W. Felix Handte
8dd943e42c Improve Module Map File
This commit makes several changes:

1. It adds modules for the dictionary builder and errors headers.
2. It captures all of the macros that are used to configure these headers.
   When the headers are imported as modules and one of these macros is defined
   the compiler issues a warning that it needs to be defined on the CLI.
3. It promotes the modulemap file into the root of the lib directory.
   Experimentation shows that clang's `-fimplicit-module-maps` will find the
   modulemap when placed here, but not when it's put in a subdirectory.
2022-01-05 18:32:53 -05:00
Felix Handte
7e679511a8
Merge pull request #2964 from felixhandte/noexecstack-all-archs
Mark Huffman Decoder Assembly `noexecstack` on All Architectures
2022-01-05 16:52:39 -05:00
W. Felix Handte
ff5d1daf33 Clean Up Debugging Statements 2022-01-05 16:13:00 -05:00
W. Felix Handte
ef1f9e80ff Restrict GNU-stack Note to GNU Assemblers 2022-01-05 16:03:32 -05:00
W. Felix Handte
b12edddb37 Write GNU-stack Section on All ELF Architectures
Previously we did this only on Linux, which missed other Unices.
2022-01-05 15:44:40 -05:00
W. Felix Handte
4620ce6a9a Makefiles: Add noexecstack Options to Compilation and Linking
Hopefully this marks the binary artifacts `noexecstack` even on platforms
where binaries default to true.
2022-01-05 15:12:31 -05:00
Nick Terrell
c592b463ca
Merge pull request #2972 from terrelln/meson-fix
[meson] Explicitly disable assembly for non clang/gcc copmilers
2022-01-05 09:27:33 -08:00
Yann Collet
3c2c3fbe4a
Merge pull request #2969 from facebook/fix2966_part1
fix performance issue in scenario #2966 (part 1)
2022-01-04 17:03:10 -08:00
Nick Terrell
c4f5116e95 [meson] Explicitly disable assembly for non clang/gcc copmilers
After merging #2951 I realized that we will want to explicitly disable
assembly when we aren't including the assembly source file. Otherwise,
if some non clang/gcc compiler does support assembly, it would fail to
build.
2022-01-04 16:05:59 -08:00