extzstd 0.3.2 → 0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -3
  3. data/contrib/zstd/CHANGELOG +225 -1
  4. data/contrib/zstd/CONTRIBUTING.md +158 -75
  5. data/contrib/zstd/LICENSE +4 -4
  6. data/contrib/zstd/Makefile +106 -69
  7. data/contrib/zstd/Package.swift +36 -0
  8. data/contrib/zstd/README.md +64 -36
  9. data/contrib/zstd/SECURITY.md +15 -0
  10. data/contrib/zstd/TESTING.md +2 -3
  11. data/contrib/zstd/lib/BUCK +5 -7
  12. data/contrib/zstd/lib/Makefile +117 -199
  13. data/contrib/zstd/lib/README.md +37 -7
  14. data/contrib/zstd/lib/common/allocations.h +55 -0
  15. data/contrib/zstd/lib/common/bits.h +200 -0
  16. data/contrib/zstd/lib/common/bitstream.h +80 -86
  17. data/contrib/zstd/lib/common/compiler.h +225 -63
  18. data/contrib/zstd/lib/common/cpu.h +37 -1
  19. data/contrib/zstd/lib/common/debug.c +7 -1
  20. data/contrib/zstd/lib/common/debug.h +21 -12
  21. data/contrib/zstd/lib/common/entropy_common.c +15 -37
  22. data/contrib/zstd/lib/common/error_private.c +9 -2
  23. data/contrib/zstd/lib/common/error_private.h +93 -5
  24. data/contrib/zstd/lib/common/fse.h +12 -87
  25. data/contrib/zstd/lib/common/fse_decompress.c +37 -117
  26. data/contrib/zstd/lib/common/huf.h +97 -172
  27. data/contrib/zstd/lib/common/mem.h +58 -58
  28. data/contrib/zstd/lib/common/pool.c +38 -17
  29. data/contrib/zstd/lib/common/pool.h +10 -4
  30. data/contrib/zstd/lib/common/portability_macros.h +158 -0
  31. data/contrib/zstd/lib/common/threading.c +74 -14
  32. data/contrib/zstd/lib/common/threading.h +5 -10
  33. data/contrib/zstd/lib/common/xxhash.c +6 -814
  34. data/contrib/zstd/lib/common/xxhash.h +6930 -195
  35. data/contrib/zstd/lib/common/zstd_common.c +1 -36
  36. data/contrib/zstd/lib/common/zstd_deps.h +1 -1
  37. data/contrib/zstd/lib/common/zstd_internal.h +68 -154
  38. data/contrib/zstd/lib/common/zstd_trace.h +163 -0
  39. data/contrib/zstd/lib/compress/clevels.h +134 -0
  40. data/contrib/zstd/lib/compress/fse_compress.c +75 -155
  41. data/contrib/zstd/lib/compress/hist.c +1 -1
  42. data/contrib/zstd/lib/compress/hist.h +1 -1
  43. data/contrib/zstd/lib/compress/huf_compress.c +810 -259
  44. data/contrib/zstd/lib/compress/zstd_compress.c +2864 -919
  45. data/contrib/zstd/lib/compress/zstd_compress_internal.h +523 -192
  46. data/contrib/zstd/lib/compress/zstd_compress_literals.c +117 -40
  47. data/contrib/zstd/lib/compress/zstd_compress_literals.h +16 -6
  48. data/contrib/zstd/lib/compress/zstd_compress_sequences.c +28 -19
  49. data/contrib/zstd/lib/compress/zstd_compress_sequences.h +1 -1
  50. data/contrib/zstd/lib/compress/zstd_compress_superblock.c +251 -412
  51. data/contrib/zstd/lib/compress/zstd_compress_superblock.h +1 -1
  52. data/contrib/zstd/lib/compress/zstd_cwksp.h +284 -97
  53. data/contrib/zstd/lib/compress/zstd_double_fast.c +382 -133
  54. data/contrib/zstd/lib/compress/zstd_double_fast.h +14 -2
  55. data/contrib/zstd/lib/compress/zstd_fast.c +732 -260
  56. data/contrib/zstd/lib/compress/zstd_fast.h +3 -2
  57. data/contrib/zstd/lib/compress/zstd_lazy.c +1177 -390
  58. data/contrib/zstd/lib/compress/zstd_lazy.h +129 -14
  59. data/contrib/zstd/lib/compress/zstd_ldm.c +280 -210
  60. data/contrib/zstd/lib/compress/zstd_ldm.h +3 -2
  61. data/contrib/zstd/lib/compress/zstd_ldm_geartab.h +106 -0
  62. data/contrib/zstd/lib/compress/zstd_opt.c +516 -285
  63. data/contrib/zstd/lib/compress/zstd_opt.h +32 -8
  64. data/contrib/zstd/lib/compress/zstdmt_compress.c +202 -131
  65. data/contrib/zstd/lib/compress/zstdmt_compress.h +9 -6
  66. data/contrib/zstd/lib/decompress/huf_decompress.c +1149 -555
  67. data/contrib/zstd/lib/decompress/huf_decompress_amd64.S +595 -0
  68. data/contrib/zstd/lib/decompress/zstd_ddict.c +4 -4
  69. data/contrib/zstd/lib/decompress/zstd_ddict.h +1 -1
  70. data/contrib/zstd/lib/decompress/zstd_decompress.c +583 -106
  71. data/contrib/zstd/lib/decompress/zstd_decompress_block.c +1054 -379
  72. data/contrib/zstd/lib/decompress/zstd_decompress_block.h +14 -3
  73. data/contrib/zstd/lib/decompress/zstd_decompress_internal.h +56 -6
  74. data/contrib/zstd/lib/deprecated/zbuff.h +1 -1
  75. data/contrib/zstd/lib/deprecated/zbuff_common.c +1 -1
  76. data/contrib/zstd/lib/deprecated/zbuff_compress.c +24 -4
  77. data/contrib/zstd/lib/deprecated/zbuff_decompress.c +3 -1
  78. data/contrib/zstd/lib/dictBuilder/cover.c +60 -44
  79. data/contrib/zstd/lib/dictBuilder/cover.h +6 -11
  80. data/contrib/zstd/lib/dictBuilder/divsufsort.c +1 -1
  81. data/contrib/zstd/lib/dictBuilder/fastcover.c +26 -18
  82. data/contrib/zstd/lib/dictBuilder/zdict.c +100 -101
  83. data/contrib/zstd/lib/legacy/zstd_legacy.h +38 -1
  84. data/contrib/zstd/lib/legacy/zstd_v01.c +18 -53
  85. data/contrib/zstd/lib/legacy/zstd_v01.h +1 -1
  86. data/contrib/zstd/lib/legacy/zstd_v02.c +28 -85
  87. data/contrib/zstd/lib/legacy/zstd_v02.h +1 -1
  88. data/contrib/zstd/lib/legacy/zstd_v03.c +29 -88
  89. data/contrib/zstd/lib/legacy/zstd_v03.h +1 -1
  90. data/contrib/zstd/lib/legacy/zstd_v04.c +27 -80
  91. data/contrib/zstd/lib/legacy/zstd_v04.h +1 -1
  92. data/contrib/zstd/lib/legacy/zstd_v05.c +36 -85
  93. data/contrib/zstd/lib/legacy/zstd_v05.h +1 -1
  94. data/contrib/zstd/lib/legacy/zstd_v06.c +44 -96
  95. data/contrib/zstd/lib/legacy/zstd_v06.h +1 -1
  96. data/contrib/zstd/lib/legacy/zstd_v07.c +37 -92
  97. data/contrib/zstd/lib/legacy/zstd_v07.h +1 -1
  98. data/contrib/zstd/lib/libzstd.mk +237 -0
  99. data/contrib/zstd/lib/libzstd.pc.in +4 -3
  100. data/contrib/zstd/lib/module.modulemap +35 -0
  101. data/contrib/zstd/lib/{dictBuilder/zdict.h → zdict.h} +202 -33
  102. data/contrib/zstd/lib/zstd.h +1030 -332
  103. data/contrib/zstd/lib/{common/zstd_errors.h → zstd_errors.h} +27 -8
  104. data/ext/extconf.rb +26 -7
  105. data/ext/extzstd.c +51 -24
  106. data/ext/extzstd.h +33 -6
  107. data/ext/extzstd_stream.c +74 -31
  108. data/ext/libzstd_conf.h +0 -1
  109. data/ext/zstd_decompress_asm.S +1 -0
  110. metadata +17 -7
  111. data/contrib/zstd/appveyor.yml +0 -292
  112. data/ext/depend +0 -2
@@ -1,5 +1,5 @@
1
1
  # ################################################################
2
- # Copyright (c) 2015-2020, Yann Collet, Facebook, Inc.
2
+ # Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  # All rights reserved.
4
4
  #
5
5
  # This source code is licensed under both the BSD-style license (found in the
@@ -29,6 +29,7 @@ VOID = /dev/null
29
29
  # fail on other tested distros (ubuntu, debian) even
30
30
  # without manually specifying the TARGET_SYSTEM.
31
31
  TARGET_SYSTEM ?= $(OS)
32
+ CP ?= cp
32
33
 
33
34
  ifneq (,$(filter Windows%,$(TARGET_SYSTEM)))
34
35
  EXT =.exe
@@ -48,7 +49,7 @@ allmost: allzstd zlibwrapper
48
49
 
49
50
  # skip zwrapper, can't build that on alternate architectures without the proper zlib installed
50
51
  .PHONY: allzstd
51
- allzstd: lib-all
52
+ allzstd: lib
52
53
  $(Q)$(MAKE) -C $(PRGDIR) all
53
54
  $(Q)$(MAKE) -C $(TESTDIR) all
54
55
 
@@ -57,9 +58,8 @@ all32:
57
58
  $(MAKE) -C $(PRGDIR) zstd32
58
59
  $(MAKE) -C $(TESTDIR) all32
59
60
 
60
- .PHONY: lib lib-release libzstd.a
61
- lib-all : lib
62
- lib lib-release lib-all :
61
+ .PHONY: lib lib-release lib-mt lib-nomt
62
+ lib lib-release lib-mt lib-nomt:
63
63
  $(Q)$(MAKE) -C $(ZSTDDIR) $@
64
64
 
65
65
  .PHONY: zstd zstd-release
@@ -70,7 +70,7 @@ zstd zstd-release:
70
70
  .PHONY: zstdmt
71
71
  zstdmt:
72
72
  $(Q)$(MAKE) -C $(PRGDIR) $@
73
- $(Q)cp $(PRGDIR)/zstd$(EXT) ./zstdmt$(EXT)
73
+ $(Q)$(CP) $(PRGDIR)/zstd$(EXT) ./zstdmt$(EXT)
74
74
 
75
75
  .PHONY: zlibwrapper
76
76
  zlibwrapper: lib
@@ -123,8 +123,9 @@ contrib: lib
123
123
  $(MAKE) -C contrib/seekable_format/examples all
124
124
  $(MAKE) -C contrib/seekable_format/tests test
125
125
  $(MAKE) -C contrib/largeNbDicts all
126
- cd contrib/single_file_libs/ ; ./build_decoder_test.sh
127
- cd contrib/single_file_libs/ ; ./build_library_test.sh
126
+ $(MAKE) -C contrib/externalSequenceProducer all
127
+ cd build/single_file_libs/ ; ./build_decoder_test.sh
128
+ cd build/single_file_libs/ ; ./build_library_test.sh
128
129
 
129
130
  .PHONY: cleanTabs
130
131
  cleanTabs:
@@ -142,21 +143,23 @@ clean:
142
143
  $(Q)$(MAKE) -C contrib/seekable_format/examples $@ > $(VOID)
143
144
  $(Q)$(MAKE) -C contrib/seekable_format/tests $@ > $(VOID)
144
145
  $(Q)$(MAKE) -C contrib/largeNbDicts $@ > $(VOID)
146
+ $(Q)$(MAKE) -C contrib/externalSequenceProducer $@ > $(VOID)
145
147
  $(Q)$(RM) zstd$(EXT) zstdmt$(EXT) tmp*
146
- $(Q)$(RM) -r lz4
148
+ $(Q)$(RM) -r lz4 cmakebuild install
147
149
  @echo Cleaning completed
148
150
 
149
151
  #------------------------------------------------------------------------------
150
152
  # make install is validated only for Linux, macOS, Hurd and some BSD targets
151
153
  #------------------------------------------------------------------------------
152
- ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD DragonFly NetBSD MSYS_NT Haiku))
154
+ ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD DragonFly NetBSD MSYS_NT CYGWIN_NT Haiku AIX))
153
155
 
154
156
  HOST_OS = POSIX
155
- CMAKE_PARAMS = -DZSTD_BUILD_CONTRIB:BOOL=ON -DZSTD_BUILD_STATIC:BOOL=ON -DZSTD_BUILD_TESTS:BOOL=ON -DZSTD_ZLIB_SUPPORT:BOOL=ON -DZSTD_LZMA_SUPPORT:BOOL=ON -DCMAKE_BUILD_TYPE=Release
157
+
158
+ MKDIR ?= mkdir -p
156
159
 
157
160
  HAVE_COLORNEVER = $(shell echo a | egrep --color=never a > /dev/null 2> /dev/null && echo 1 || echo 0)
158
161
  EGREP_OPTIONS ?=
159
- ifeq ($HAVE_COLORNEVER, 1)
162
+ ifeq ($(HAVE_COLORNEVER), 1)
160
163
  EGREP_OPTIONS += --color=never
161
164
  endif
162
165
  EGREP = egrep $(EGREP_OPTIONS)
@@ -180,7 +183,7 @@ list:
180
183
  done \
181
184
  } | column -t -s $$'\t'
182
185
 
183
- .PHONY: install armtest usan asan uasan
186
+ .PHONY: install armtest usan asan uasan msan asan32
184
187
  install:
185
188
  $(Q)$(MAKE) -C $(ZSTDDIR) $@
186
189
  $(Q)$(MAKE) -C $(PRGDIR) $@
@@ -194,22 +197,28 @@ uninstall:
194
197
  travis-install:
195
198
  $(MAKE) install PREFIX=~/install_test_dir
196
199
 
197
- .PHONY: gcc5build
200
+ .PHONY: clangbuild-darwin-fat
201
+ clangbuild-darwin-fat: clean
202
+ clang -v
203
+ CXX=clang++ CC=clang CFLAGS="-Werror -Wconversion -Wno-sign-conversion -Wdocumentation -arch arm64" $(MAKE) zstd-release
204
+ mv programs/zstd programs/zstd_arm64
205
+ CXX=clang++ CC=clang CFLAGS="-Werror -Wconversion -Wno-sign-conversion -Wdocumentation -arch x86_64" $(MAKE) zstd-release
206
+ mv programs/zstd programs/zstd_x64
207
+ lipo -create programs/zstd_x64 programs/zstd_arm64 -output programs/zstd
208
+
209
+ .PHONY: gcc5build gcc6build gcc7build clangbuild m32build armbuild aarch64build ppcbuild ppc64build
198
210
  gcc5build: clean
199
211
  gcc-5 -v
200
- CC=gcc-5 $(MAKE) all MOREFLAGS="-Werror"
212
+ CC=gcc-5 $(MAKE) all MOREFLAGS="-Werror $(MOREFLAGS)"
201
213
 
202
- .PHONY: gcc6build
203
214
  gcc6build: clean
204
215
  gcc-6 -v
205
- CC=gcc-6 $(MAKE) all MOREFLAGS="-Werror"
216
+ CC=gcc-6 $(MAKE) all MOREFLAGS="-Werror $(MOREFLAGS)"
206
217
 
207
- .PHONY: gcc7build
208
218
  gcc7build: clean
209
219
  gcc-7 -v
210
- CC=gcc-7 $(MAKE) all MOREFLAGS="-Werror"
220
+ CC=gcc-7 $(MAKE) all MOREFLAGS="-Werror $(MOREFLAGS)"
211
221
 
212
- .PHONY: clangbuild
213
222
  clangbuild: clean
214
223
  clang -v
215
224
  CXX=clang++ CC=clang CFLAGS="-Werror -Wconversion -Wno-sign-conversion -Wdocumentation" $(MAKE) all
@@ -222,61 +231,63 @@ armbuild: clean
222
231
  CC=arm-linux-gnueabi-gcc CFLAGS="-Werror" $(MAKE) allzstd
223
232
 
224
233
  aarch64build: clean
225
- CC=aarch64-linux-gnu-gcc CFLAGS="-Werror" $(MAKE) allzstd
234
+ CC=aarch64-linux-gnu-gcc CFLAGS="-Werror -O0" $(MAKE) allzstd
226
235
 
227
236
  ppcbuild: clean
228
- CC=powerpc-linux-gnu-gcc CFLAGS="-m32 -Wno-attributes -Werror" $(MAKE) allzstd
237
+ CC=powerpc-linux-gnu-gcc CFLAGS="-m32 -Wno-attributes -Werror" $(MAKE) -j allzstd
229
238
 
230
239
  ppc64build: clean
231
- CC=powerpc-linux-gnu-gcc CFLAGS="-m64 -Werror" $(MAKE) allzstd
240
+ CC=powerpc-linux-gnu-gcc CFLAGS="-m64 -Werror" $(MAKE) -j allzstd
232
241
 
242
+ .PHONY: armfuzz aarch64fuzz ppcfuzz ppc64fuzz
233
243
  armfuzz: clean
234
- CC=arm-linux-gnueabi-gcc QEMU_SYS=qemu-arm-static MOREFLAGS="-static" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) fuzztest
244
+ CC=arm-linux-gnueabi-gcc QEMU_SYS=qemu-arm-static MOREFLAGS="-static $(MOREFLAGS)" FUZZER_FLAGS="--no-big-tests $(FUZZER_FLAGS)" $(MAKE) -C $(TESTDIR) fuzztest
235
245
 
236
246
  aarch64fuzz: clean
237
247
  ld -v
238
- CC=aarch64-linux-gnu-gcc QEMU_SYS=qemu-aarch64-static MOREFLAGS="-static" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) fuzztest
248
+ CC=aarch64-linux-gnu-gcc QEMU_SYS=qemu-aarch64-static MOREFLAGS="-static $(MOREFLAGS)" FUZZER_FLAGS="--no-big-tests $(FUZZER_FLAGS)" $(MAKE) -C $(TESTDIR) fuzztest
239
249
 
240
250
  ppcfuzz: clean
241
- CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc-static MOREFLAGS="-static" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) fuzztest
251
+ CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc-static MOREFLAGS="-static $(MOREFLAGS)" FUZZER_FLAGS="--no-big-tests $(FUZZER_FLAGS)" $(MAKE) -C $(TESTDIR) fuzztest
242
252
 
243
253
  ppc64fuzz: clean
244
- CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc64-static MOREFLAGS="-m64 -static" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) fuzztest
254
+ CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc64-static MOREFLAGS="-m64 -static $(MOREFLAGS)" FUZZER_FLAGS="--no-big-tests $(FUZZER_FLAGS)" $(MAKE) -C $(TESTDIR) fuzztest
245
255
 
246
- .PHONY: cxxtest
256
+ .PHONY: cxxtest gcc5test gcc6test armtest aarch64test ppctest ppc64test
247
257
  cxxtest: CXXFLAGS += -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror
248
258
  cxxtest: clean
249
259
  $(MAKE) -C $(PRGDIR) all CC="$(CXX) -Wno-deprecated" CFLAGS="$(CXXFLAGS)" # adding -Wno-deprecated to avoid clang++ warning on dealing with C files directly
250
260
 
251
261
  gcc5test: clean
252
262
  gcc-5 -v
253
- $(MAKE) all CC=gcc-5 MOREFLAGS="-Werror"
263
+ $(MAKE) all CC=gcc-5 MOREFLAGS="-Werror $(MOREFLAGS)"
254
264
 
255
265
  gcc6test: clean
256
266
  gcc-6 -v
257
- $(MAKE) all CC=gcc-6 MOREFLAGS="-Werror"
267
+ $(MAKE) all CC=gcc-6 MOREFLAGS="-Werror $(MOREFLAGS)"
258
268
 
259
269
  armtest: clean
260
270
  $(MAKE) -C $(TESTDIR) datagen # use native, faster
261
- $(MAKE) -C $(TESTDIR) test CC=arm-linux-gnueabi-gcc QEMU_SYS=qemu-arm-static ZSTDRTTEST= MOREFLAGS="-Werror -static" FUZZER_FLAGS=--no-big-tests
271
+ $(MAKE) -C $(TESTDIR) test CC=arm-linux-gnueabi-gcc QEMU_SYS=qemu-arm-static ZSTDRTTEST= MOREFLAGS="-Werror -static $(MOREFLAGS)" FUZZER_FLAGS="--no-big-tests $(FUZZER_FLAGS)"
262
272
 
263
273
  aarch64test:
264
274
  $(MAKE) -C $(TESTDIR) datagen # use native, faster
265
- $(MAKE) -C $(TESTDIR) test CC=aarch64-linux-gnu-gcc QEMU_SYS=qemu-aarch64-static ZSTDRTTEST= MOREFLAGS="-Werror -static" FUZZER_FLAGS=--no-big-tests
275
+ $(MAKE) -C $(TESTDIR) test CC=aarch64-linux-gnu-gcc QEMU_SYS=qemu-aarch64-static ZSTDRTTEST= MOREFLAGS="-Werror -static $(MOREFLAGS)" FUZZER_FLAGS="--no-big-tests $(FUZZER_FLAGS)"
266
276
 
267
277
  ppctest: clean
268
278
  $(MAKE) -C $(TESTDIR) datagen # use native, faster
269
- $(MAKE) -C $(TESTDIR) test CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc-static ZSTDRTTEST= MOREFLAGS="-Werror -Wno-attributes -static" FUZZER_FLAGS=--no-big-tests
279
+ $(MAKE) -C $(TESTDIR) test CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc-static ZSTDRTTEST= MOREFLAGS="-Werror -Wno-attributes -static $(MOREFLAGS)" FUZZER_FLAGS="--no-big-tests $(FUZZER_FLAGS)"
270
280
 
271
281
  ppc64test: clean
272
282
  $(MAKE) -C $(TESTDIR) datagen # use native, faster
273
- $(MAKE) -C $(TESTDIR) test CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc64-static ZSTDRTTEST= MOREFLAGS="-m64 -static" FUZZER_FLAGS=--no-big-tests
283
+ $(MAKE) -C $(TESTDIR) test CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc64-static ZSTDRTTEST= MOREFLAGS="-m64 -static $(MOREFLAGS)" FUZZER_FLAGS="--no-big-tests $(FUZZER_FLAGS)"
274
284
 
285
+ .PHONY: arm-ppc-compilation
275
286
  arm-ppc-compilation:
276
- $(MAKE) -C $(PRGDIR) clean zstd CC=arm-linux-gnueabi-gcc QEMU_SYS=qemu-arm-static ZSTDRTTEST= MOREFLAGS="-Werror -static"
277
- $(MAKE) -C $(PRGDIR) clean zstd CC=aarch64-linux-gnu-gcc QEMU_SYS=qemu-aarch64-static ZSTDRTTEST= MOREFLAGS="-Werror -static"
278
- $(MAKE) -C $(PRGDIR) clean zstd CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc-static ZSTDRTTEST= MOREFLAGS="-Werror -Wno-attributes -static"
279
- $(MAKE) -C $(PRGDIR) clean zstd CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc64-static ZSTDRTTEST= MOREFLAGS="-m64 -static"
287
+ $(MAKE) -C $(PRGDIR) clean zstd CC=arm-linux-gnueabi-gcc QEMU_SYS=qemu-arm-static ZSTDRTTEST= MOREFLAGS="-Werror -static $(MOREFLAGS)"
288
+ $(MAKE) -C $(PRGDIR) clean zstd CC=aarch64-linux-gnu-gcc QEMU_SYS=qemu-aarch64-static ZSTDRTTEST= MOREFLAGS="-Werror -static $(MOREFLAGS)"
289
+ $(MAKE) -C $(PRGDIR) clean zstd CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc-static ZSTDRTTEST= MOREFLAGS="-Werror -Wno-attributes -static $(MOREFLAGS)"
290
+ $(MAKE) -C $(PRGDIR) clean zstd CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc64-static ZSTDRTTEST= MOREFLAGS="-m64 -static $(MOREFLAGS)"
280
291
 
281
292
  regressiontest:
282
293
  $(MAKE) -C $(FUZZDIR) regressiontest
@@ -287,44 +298,64 @@ uasanregressiontest:
287
298
  msanregressiontest:
288
299
  $(MAKE) -C $(FUZZDIR) regressiontest CC=clang CXX=clang++ CFLAGS="-O3 -fsanitize=memory" CXXFLAGS="-O3 -fsanitize=memory"
289
300
 
290
- # run UBsan with -fsanitize-recover=signed-integer-overflow
291
- # due to a bug in UBsan when doing pointer subtraction
292
- # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63303
293
-
301
+ update_regressionResults : REGRESS_RESULTS_DIR := /tmp/regress_results_dir/
302
+ update_regressionResults:
303
+ $(MAKE) -C programs zstd
304
+ $(MAKE) -C tests/regression test
305
+ $(RM) -rf $(REGRESS_RESULTS_DIR)
306
+ $(MKDIR) $(REGRESS_RESULTS_DIR)
307
+ ./tests/regression/test \
308
+ --cache tests/regression/cache \
309
+ --output $(REGRESS_RESULTS_DIR)/results.csv \
310
+ --zstd programs/zstd
311
+ echo "Showing results differences"
312
+ ! diff tests/regression/results.csv $(REGRESS_RESULTS_DIR)/results.csv
313
+ echo "Updating results.csv"
314
+ $(CP) $(REGRESS_RESULTS_DIR)/results.csv tests/regression/results.csv
315
+
316
+
317
+ # run UBsan with -fsanitize-recover=pointer-overflow
318
+ # this only works with recent compilers such as gcc 8+
294
319
  usan: clean
295
- $(MAKE) test CC=clang MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize-recover=signed-integer-overflow -fsanitize=undefined -Werror"
320
+ $(MAKE) test CC=clang MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=undefined -Werror $(MOREFLAGS)"
296
321
 
297
322
  asan: clean
298
- $(MAKE) test CC=clang MOREFLAGS="-g -fsanitize=address -Werror"
323
+ $(MAKE) test CC=clang MOREFLAGS="-g -fsanitize=address -Werror $(MOREFLAGS)"
299
324
 
300
325
  asan-%: clean
301
- LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=address -Werror" $(MAKE) -C $(TESTDIR) $*
326
+ LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=address -Werror $(MOREFLAGS)" $(MAKE) -C $(TESTDIR) $*
302
327
 
303
328
  msan: clean
304
- $(MAKE) test CC=clang MOREFLAGS="-g -fsanitize=memory -fno-omit-frame-pointer -Werror" HAVE_LZMA=0 # datagen.c fails this test for no obvious reason
329
+ $(MAKE) test CC=clang MOREFLAGS="-g -fsanitize=memory -fno-omit-frame-pointer -Werror $(MOREFLAGS)" HAVE_LZMA=0 # datagen.c fails this test for no obvious reason
305
330
 
306
- msan-%: clean
307
- LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=memory -fno-omit-frame-pointer -Werror" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) HAVE_LZMA=0 $*
331
+ msan-%:
332
+ $(MAKE) clean
333
+ LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=memory -fno-omit-frame-pointer -Werror $(MOREFLAGS)" FUZZER_FLAGS="--no-big-tests $(FUZZER_FLAGS)" $(MAKE) -j -C $(TESTDIR) HAVE_LZMA=0 $*
308
334
 
309
335
  asan32: clean
310
- $(MAKE) -C $(TESTDIR) test32 CC=clang MOREFLAGS="-g -fsanitize=address"
336
+ $(MAKE) -C $(TESTDIR) test32 CC=clang MOREFLAGS="-g -fsanitize=address $(MOREFLAGS)"
311
337
 
312
338
  uasan: clean
313
- $(MAKE) test CC=clang MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize-recover=signed-integer-overflow -fsanitize=address,undefined -Werror"
339
+ $(MAKE) test CC=clang MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=address,undefined -Werror $(MOREFLAGS)"
314
340
 
315
341
  uasan-%: clean
316
- LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize-recover=signed-integer-overflow -fsanitize=address,undefined -Werror" $(MAKE) -C $(TESTDIR) $*
342
+ LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=address,undefined -Werror $(MOREFLAGS)" $(MAKE) -C $(TESTDIR) $*
317
343
 
318
344
  tsan-%: clean
319
- LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=thread -Werror" $(MAKE) -C $(TESTDIR) $* FUZZER_FLAGS=--no-big-tests
345
+ LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=thread -Werror $(MOREFLAGS)" $(MAKE) -C $(TESTDIR) $* FUZZER_FLAGS="--no-big-tests $(FUZZER_FLAGS)"
320
346
 
347
+ .PHONY: apt-install
321
348
  apt-install:
349
+ # TODO: uncomment once issue 3011 is resolved and remove hack from Github Actions .yml
350
+ # sudo apt-get update
322
351
  sudo apt-get -yq --no-install-suggests --no-install-recommends --force-yes install $(APT_PACKAGES)
323
352
 
353
+ .PHONY: apt-add-repo
324
354
  apt-add-repo:
325
355
  sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
326
356
  sudo apt-get update -y -qq
327
357
 
358
+ .PHONY: ppcinstall arminstall valgrindinstall libc6install gcc6install gcc7install gcc8install gpp6install clang38install lz4install
328
359
  ppcinstall:
329
360
  APT_PACKAGES="qemu-system-ppc qemu-user-static gcc-powerpc-linux-gnu" $(MAKE) apt-install
330
361
 
@@ -361,43 +392,49 @@ endif
361
392
 
362
393
  ifneq (,$(filter MSYS%,$(shell uname)))
363
394
  HOST_OS = MSYS
364
- CMAKE_PARAMS = -G"MSYS Makefiles" -DCMAKE_BUILD_TYPE=Debug -DZSTD_MULTITHREAD_SUPPORT:BOOL=OFF -DZSTD_BUILD_STATIC:BOOL=ON -DZSTD_BUILD_TESTS:BOOL=ON
365
395
  endif
366
396
 
367
-
368
397
  #------------------------------------------------------------------------
369
398
  # target specific tests
370
399
  #------------------------------------------------------------------------
371
400
  ifneq (,$(filter $(HOST_OS),MSYS POSIX))
372
- cmakebuild:
373
- cmake --version
374
- $(RM) -r $(BUILDIR)/cmake/build
375
- mkdir $(BUILDIR)/cmake/build
376
- cd $(BUILDIR)/cmake/build; cmake -DCMAKE_INSTALL_PREFIX:PATH=~/install_test_dir $(CMAKE_PARAMS) ..
377
- $(MAKE) -C $(BUILDIR)/cmake/build -j4;
378
- $(MAKE) -C $(BUILDIR)/cmake/build install;
379
- $(MAKE) -C $(BUILDIR)/cmake/build uninstall;
380
- cd $(BUILDIR)/cmake/build; ctest -V -L Medium
381
401
 
402
+ CMAKE ?= cmake
403
+ CMAKE_PARAMS = -DZSTD_BUILD_CONTRIB:BOOL=ON -DZSTD_BUILD_STATIC:BOOL=ON -DZSTD_BUILD_TESTS:BOOL=ON -DZSTD_ZLIB_SUPPORT:BOOL=ON -DZSTD_LZMA_SUPPORT:BOOL=ON
404
+
405
+ ifneq (,$(filter MSYS%,$(shell uname)))
406
+ CMAKE_PARAMS = -G"MSYS Makefiles" -DZSTD_MULTITHREAD_SUPPORT:BOOL=OFF -DZSTD_BUILD_STATIC:BOOL=ON -DZSTD_BUILD_TESTS:BOOL=ON
407
+ endif
408
+
409
+ .PHONY: cmakebuild
410
+ cmakebuild:
411
+ $(CMAKE) --version
412
+ $(RM) -r cmakebuild install
413
+ $(MKDIR) cmakebuild install
414
+ cd cmakebuild; $(CMAKE) -Wdev -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS="-Werror -O0" -DCMAKE_INSTALL_PREFIX=install $(CMAKE_PARAMS) ../build/cmake
415
+ $(CMAKE) --build cmakebuild --target install -- -j V=1
416
+ cd cmakebuild; ctest -V -L Medium
417
+
418
+ .PHONY: c89build gnu90build c99build gnu99build c11build bmix64build bmix32build bmi32build staticAnalyze
382
419
  c89build: clean
383
420
  $(CC) -v
384
- CFLAGS="-std=c89 -Werror" $(MAKE) allmost # will fail, due to missing support for `long long`
421
+ CFLAGS="-std=c89 -Werror -Wno-attributes -Wpedantic -Wno-long-long -Wno-variadic-macros -O0" $(MAKE) lib zstd
385
422
 
386
423
  gnu90build: clean
387
424
  $(CC) -v
388
- CFLAGS="-std=gnu90 -Werror" $(MAKE) allmost
425
+ CFLAGS="-std=gnu90 -Werror -O0" $(MAKE) allmost
389
426
 
390
427
  c99build: clean
391
428
  $(CC) -v
392
- CFLAGS="-std=c99 -Werror" $(MAKE) allmost
429
+ CFLAGS="-std=c99 -Werror -O0" $(MAKE) allmost
393
430
 
394
431
  gnu99build: clean
395
432
  $(CC) -v
396
- CFLAGS="-std=gnu99 -Werror" $(MAKE) allmost
433
+ CFLAGS="-std=gnu99 -Werror -O0" $(MAKE) allmost
397
434
 
398
435
  c11build: clean
399
436
  $(CC) -v
400
- CFLAGS="-std=c11 -Werror" $(MAKE) allmost
437
+ CFLAGS="-std=c11 -Werror -O0" $(MAKE) allmost
401
438
 
402
439
  bmix64build: clean
403
440
  $(CC) -v
@@ -416,5 +453,5 @@ bmi32build: clean
416
453
  staticAnalyze: SCANBUILD ?= scan-build
417
454
  staticAnalyze:
418
455
  $(CC) -v
419
- CC=$(CC) CPPFLAGS=-g $(SCANBUILD) --status-bugs -v $(MAKE) allzstd examples contrib
456
+ CC=$(CC) CPPFLAGS=-g $(SCANBUILD) --status-bugs -v $(MAKE) zstd
420
457
  endif
@@ -0,0 +1,36 @@
1
+ // swift-tools-version:5.0
2
+ // The swift-tools-version declares the minimum version of Swift required to build this package.
3
+
4
+ import PackageDescription
5
+
6
+ let package = Package(
7
+ name: "zstd",
8
+ platforms: [
9
+ .macOS(.v10_10), .iOS(.v9), .tvOS(.v9)
10
+ ],
11
+ products: [
12
+ // Products define the executables and libraries a package produces, and make them visible to other packages.
13
+ .library(
14
+ name: "libzstd",
15
+ targets: [ "libzstd" ])
16
+ ],
17
+ dependencies: [
18
+ // Dependencies declare other packages that this package depends on.
19
+ // .package(url: /* package url */, from: "1.0.0"),
20
+ ],
21
+ targets: [
22
+ // Targets are the basic building blocks of a package. A target can define a module or a test suite.
23
+ // Targets can depend on other targets in this package, and on products in packages this package depends on.
24
+ .target(
25
+ name: "libzstd",
26
+ path: "lib",
27
+ sources: [ "common", "compress", "decompress", "dictBuilder" ],
28
+ publicHeadersPath: ".",
29
+ cSettings: [
30
+ .headerSearchPath(".")
31
+ ])
32
+ ],
33
+ swiftLanguageVersions: [.v5],
34
+ cLanguageStandard: .gnu11,
35
+ cxxLanguageStandard: .gnucxx14
36
+ )
@@ -4,23 +4,21 @@ __Zstandard__, or `zstd` as short version, is a fast lossless compression algori
4
4
  targeting real-time compression scenarios at zlib-level and better compression ratios.
5
5
  It's backed by a very fast entropy stage, provided by [Huff0 and FSE library](https://github.com/Cyan4973/FiniteStateEntropy).
6
6
 
7
- The project is provided as an open-source dual [BSD](LICENSE) and [GPLv2](COPYING) licensed **C** library,
7
+ Zstandard's format is stable and documented in [RFC8878](https://datatracker.ietf.org/doc/html/rfc8878). Multiple independent implementations are already available.
8
+ This repository represents the reference implementation, provided as an open-source dual [BSD](LICENSE) OR [GPLv2](COPYING) licensed **C** library,
8
9
  and a command line utility producing and decoding `.zst`, `.gz`, `.xz` and `.lz4` files.
9
10
  Should your project require another programming language,
10
- a list of known ports and bindings is provided on [Zstandard homepage](http://www.zstd.net/#other-languages).
11
+ a list of known ports and bindings is provided on [Zstandard homepage](https://facebook.github.io/zstd/#other-languages).
11
12
 
12
13
  **Development branch status:**
13
14
 
14
15
  [![Build Status][travisDevBadge]][travisLink]
15
- [![Build status][AppveyorDevBadge]][AppveyorLink]
16
16
  [![Build status][CircleDevBadge]][CircleLink]
17
17
  [![Build status][CirrusDevBadge]][CirrusLink]
18
18
  [![Fuzzing Status][OSSFuzzBadge]][OSSFuzzLink]
19
19
 
20
- [travisDevBadge]: https://travis-ci.org/facebook/zstd.svg?branch=dev "Continuous Integration test suite"
21
- [travisLink]: https://travis-ci.org/facebook/zstd
22
- [AppveyorDevBadge]: https://ci.appveyor.com/api/projects/status/xt38wbdxjk5mrbem/branch/dev?svg=true "Windows test suite"
23
- [AppveyorLink]: https://ci.appveyor.com/project/YannCollet/zstd-p0yf0
20
+ [travisDevBadge]: https://api.travis-ci.com/facebook/zstd.svg?branch=dev "Continuous Integration test suite"
21
+ [travisLink]: https://travis-ci.com/facebook/zstd
24
22
  [CircleDevBadge]: https://circleci.com/gh/facebook/zstd/tree/dev.svg?style=shield "Short test suite"
25
23
  [CircleLink]: https://circleci.com/gh/facebook/zstd
26
24
  [CirrusDevBadge]: https://api.cirrus-ci.com/github/facebook/zstd.svg?branch=dev
@@ -31,37 +29,36 @@ a list of known ports and bindings is provided on [Zstandard homepage](http://ww
31
29
  ## Benchmarks
32
30
 
33
31
  For reference, several fast compression algorithms were tested and compared
34
- on a server running Arch Linux (`Linux version 5.5.11-arch1-1`),
35
- with a Core i9-9900K CPU @ 5.0GHz,
32
+ on a desktop running Ubuntu 20.04 (`Linux 5.11.0-41-generic`),
33
+ with a Core i7-9700K CPU @ 4.9GHz,
36
34
  using [lzbench], an open-source in-memory benchmark by @inikep
37
35
  compiled with [gcc] 9.3.0,
38
36
  on the [Silesia compression corpus].
39
37
 
40
38
  [lzbench]: https://github.com/inikep/lzbench
41
- [Silesia compression corpus]: http://sun.aei.polsl.pl/~sdeor/index.php?page=silesia
39
+ [Silesia compression corpus]: https://sun.aei.polsl.pl//~sdeor/index.php?page=silesia
42
40
  [gcc]: https://gcc.gnu.org/
43
41
 
44
42
  | Compressor name | Ratio | Compression| Decompress.|
45
43
  | --------------- | ------| -----------| ---------- |
46
- | **zstd 1.4.5 -1** | 2.884 | 500 MB/s | 1660 MB/s |
47
- | zlib 1.2.11 -1 | 2.743 | 90 MB/s | 400 MB/s |
48
- | brotli 1.0.7 -0 | 2.703 | 400 MB/s | 450 MB/s |
49
- | **zstd 1.4.5 --fast=1** | 2.434 | 570 MB/s | 2200 MB/s |
50
- | **zstd 1.4.5 --fast=3** | 2.312 | 640 MB/s | 2300 MB/s |
51
- | quicklz 1.5.0 -1 | 2.238 | 560 MB/s | 710 MB/s |
52
- | **zstd 1.4.5 --fast=5** | 2.178 | 700 MB/s | 2420 MB/s |
53
- | lzo1x 2.10 -1 | 2.106 | 690 MB/s | 820 MB/s |
54
- | lz4 1.9.2 | 2.101 | 740 MB/s | 4530 MB/s |
55
- | **zstd 1.4.5 --fast=7** | 2.096 | 750 MB/s | 2480 MB/s |
56
- | lzf 3.6 -1 | 2.077 | 410 MB/s | 860 MB/s |
57
- | snappy 1.1.8 | 2.073 | 560 MB/s | 1790 MB/s |
58
-
59
- [zlib]: http://www.zlib.net/
60
- [LZ4]: http://www.lz4.org/
44
+ | **zstd 1.5.1 -1** | 2.887 | 530 MB/s | 1700 MB/s |
45
+ | [zlib] 1.2.11 -1 | 2.743 | 95 MB/s | 400 MB/s |
46
+ | brotli 1.0.9 -0 | 2.702 | 395 MB/s | 450 MB/s |
47
+ | **zstd 1.5.1 --fast=1** | 2.437 | 600 MB/s | 2150 MB/s |
48
+ | **zstd 1.5.1 --fast=3** | 2.239 | 670 MB/s | 2250 MB/s |
49
+ | quicklz 1.5.0 -1 | 2.238 | 540 MB/s | 760 MB/s |
50
+ | **zstd 1.5.1 --fast=4** | 2.148 | 710 MB/s | 2300 MB/s |
51
+ | lzo1x 2.10 -1 | 2.106 | 660 MB/s | 845 MB/s |
52
+ | [lz4] 1.9.3 | 2.101 | 740 MB/s | 4500 MB/s |
53
+ | lzf 3.6 -1 | 2.077 | 410 MB/s | 830 MB/s |
54
+ | snappy 1.1.9 | 2.073 | 550 MB/s | 1750 MB/s |
55
+
56
+ [zlib]: https://www.zlib.net/
57
+ [lz4]: https://lz4.github.io/lz4/
61
58
 
62
59
  The negative compression levels, specified with `--fast=#`,
63
- offer faster compression and decompression speed in exchange for some loss in
64
- compression ratio compared to level 1, as seen in the table above.
60
+ offer faster compression and decompression speed
61
+ at the cost of compression ratio (compared to level 1).
65
62
 
66
63
  Zstd can also offer stronger compression ratios at the cost of compression speed.
67
64
  Speed vs Compression trade-off is configurable by small increments.
@@ -124,14 +121,27 @@ Dictionary gains are mostly effective in the first few KB. Then, the compression
124
121
 
125
122
  ## Build instructions
126
123
 
124
+ `make` is the officially maintained build system of this project.
125
+ All other build systems are "compatible" and 3rd-party maintained,
126
+ they may feature small differences in advanced options.
127
+ When your system allows it, prefer using `make` to build `zstd` and `libzstd`.
128
+
127
129
  ### Makefile
128
130
 
129
131
  If your system is compatible with standard `make` (or `gmake`),
130
132
  invoking `make` in root directory will generate `zstd` cli in root directory.
133
+ It will also create `libzstd` into `lib/`.
131
134
 
132
135
  Other available options include:
133
136
  - `make install` : create and install zstd cli, library and man pages
134
- - `make check` : create and run `zstd`, tests its behavior on local platform
137
+ - `make check` : create and run `zstd`, test its behavior on local platform
138
+
139
+ The `Makefile` follows the [GNU Standard Makefile conventions](https://www.gnu.org/prep/standards/html_node/Makefile-Conventions.html),
140
+ allowing staged install, standard flags, directory variables and command variables.
141
+
142
+ For advanced use cases, specialized compilation flags which control binary generation
143
+ are documented in [`lib/README.md`](lib/README.md#modular-build) for the `libzstd` library
144
+ and in [`programs/README.md`](programs/README.md#compilation-variables) for the `zstd` CLI.
135
145
 
136
146
  ### cmake
137
147
 
@@ -141,6 +151,18 @@ to create `zstd` binary, and `libzstd` dynamic and static libraries.
141
151
 
142
152
  By default, `CMAKE_BUILD_TYPE` is set to `Release`.
143
153
 
154
+ #### Support for Fat (Universal2) Output
155
+
156
+ `zstd` can be built and installed with support for both Apple Silicon (M1/M2) as well as Intel by using CMake's Universal2 support.
157
+ To perform a Fat/Universal2 build and install use the following commands:
158
+
159
+ ```bash
160
+ cmake -B build-cmake-debug -S build/cmake -G Ninja -DCMAKE_OSX_ARCHITECTURES="x86_64;x86_64h;arm64"
161
+ cd build-cmake-debug
162
+ ninja
163
+ sudo ninja install
164
+ ```
165
+
144
166
  ### Meson
145
167
 
146
168
  A Meson project is provided within [`build/meson`](build/meson). Follow
@@ -176,24 +198,30 @@ Going into `build` directory, you will find additional possibilities:
176
198
  You can build the zstd binary via buck by executing: `buck build programs:zstd` from the root of the repo.
177
199
  The output binary will be in `buck-out/gen/programs/`.
178
200
 
201
+ ### Bazel
202
+
203
+ You easily can integrate zstd into your Bazel project by using the module hosted on the [Bazel Central Repository](https://registry.bazel.build/modules/zstd).
204
+
179
205
  ## Testing
180
206
 
181
- You can run quick local smoke tests by executing the `playTest.sh` script from the `src/tests` directory.
182
- Two env variables `$ZSTD_BIN` and `$DATAGEN_BIN` are needed for the test script to locate the zstd and datagen binary.
183
- For information on CI testing, please refer to TESTING.md
207
+ You can run quick local smoke tests by running `make check`.
208
+ If you can't use `make`, execute the `playTest.sh` script from the `src/tests` directory.
209
+ Two env variables `$ZSTD_BIN` and `$DATAGEN_BIN` are needed for the test script to locate the `zstd` and `datagen` binary.
210
+ For information on CI testing, please refer to `TESTING.md`.
184
211
 
185
212
  ## Status
186
213
 
187
- Zstandard is currently deployed within Facebook. It is used continuously to compress large amounts of data in multiple formats and use cases.
214
+ Zstandard is currently deployed within Facebook and many other large cloud infrastructures.
215
+ It is run continuously to compress large amounts of data in multiple formats and use cases.
188
216
  Zstandard is considered safe for production environments.
189
217
 
190
218
  ## License
191
219
 
192
- Zstandard is dual-licensed under [BSD](LICENSE) and [GPLv2](COPYING).
220
+ Zstandard is dual-licensed under [BSD](LICENSE) OR [GPLv2](COPYING).
193
221
 
194
222
  ## Contributing
195
223
 
196
- The "dev" branch is the one where all contributions are merged before reaching "master".
197
- If you plan to propose a patch, please commit into the "dev" branch, or its own feature branch.
198
- Direct commit to "master" are not permitted.
224
+ The `dev` branch is the one where all contributions are merged before reaching `release`.
225
+ If you plan to propose a patch, please commit into the `dev` branch, or its own feature branch.
226
+ Direct commit to `release` are not permitted.
199
227
  For more information, please read [CONTRIBUTING](CONTRIBUTING.md).
@@ -0,0 +1,15 @@
1
+ # Reporting and Fixing Security Issues
2
+
3
+ Please do not open GitHub issues or pull requests - this makes the problem immediately visible to everyone, including malicious actors. Security issues in this open source project can be safely reported via the Meta Bug Bounty program:
4
+
5
+ https://www.facebook.com/whitehat
6
+
7
+ Meta's security team will triage your report and determine whether or not is it eligible for a bounty under our program.
8
+
9
+ # Receiving Vulnerability Notifications
10
+
11
+ In the case that a significant security vulnerability is reported to us or discovered by us---without being publicly known---we will, at our discretion, notify high-profile, high-exposure users of Zstandard ahead of our public disclosure of the issue and associated fix.
12
+
13
+ If you believe your project would benefit from inclusion in this list, please reach out to one of the maintainers.
14
+
15
+ <!-- Note to maintainers: this list is kept [here](https://fburl.com/wiki/cgc1l62x). -->
@@ -22,12 +22,12 @@ They consist of the following tests:
22
22
  - `tests/playTests.sh --test-large-data`
23
23
  - Fuzzer tests: `tests/fuzzer.c`, `tests/zstreamtest.c`, and `tests/decodecorpus.c`
24
24
  - `tests/zstreamtest.c` under Tsan (streaming mode, including multithreaded mode)
25
- - Valgrind Test (`make -C tests valgrindTest`) (testing CLI and fuzzer under valgrind)
25
+ - Valgrind Test (`make -C tests test-valgrind`) (testing CLI and fuzzer under `valgrind`)
26
26
  - Fuzzer tests (see above) on ARM, AArch64, PowerPC, and PowerPC64
27
27
 
28
28
  Long Tests
29
29
  ----------
30
- Long tests run on all commits to `master` branch,
30
+ Long tests run on all commits to `release` branch,
31
31
  and once a day on the current version of `dev` branch,
32
32
  on TravisCI.
33
33
  They consist of the following tests:
@@ -40,5 +40,4 @@ They consist of the following tests:
40
40
  - Versions test (ensuring `zstd` can decode files from all previous versions)
41
41
  - `pzstd` with asan and tsan, as well as in 32-bits mode
42
42
  - Testing `zstd` with legacy mode off
43
- - Testing `zbuff` (old streaming API)
44
43
  - Entire test suite and make install on macOS
@@ -65,9 +65,7 @@ cxx_library(
65
65
  name='zdict',
66
66
  header_namespace='',
67
67
  visibility=['PUBLIC'],
68
- exported_headers=subdir_glob([
69
- ('dictBuilder', 'zdict.h'),
70
- ]),
68
+ exported_headers=['zdict.h'],
71
69
  headers=subdir_glob([
72
70
  ('dictBuilder', 'divsufsort.h'),
73
71
  ('dictBuilder', 'cover.h'),
@@ -131,10 +129,10 @@ cxx_library(
131
129
  name='errors',
132
130
  header_namespace='',
133
131
  visibility=['PUBLIC'],
134
- exported_headers=subdir_glob([
135
- ('common', 'error_private.h'),
136
- ('common', 'zstd_errors.h'),
137
- ]),
132
+ exported_headers=[
133
+ 'zstd_errors.h',
134
+ 'common/error_private.h',
135
+ ]
138
136
  srcs=['common/error_private.c'],
139
137
  )
140
138