From: W. Felix Handte Date: Thu, 4 May 2023 16:31:41 +0000 (-0400) Subject: Also Allow/Document/Test Excluding dfast and Up X-Git-Tag: v1.5.6^2~162^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5490c75ddaae98010985618832ab55ed7b98dbed;p=thirdparty%2Fzstd.git Also Allow/Document/Test Excluding dfast and Up --- diff --git a/.github/workflows/dev-short-tests.yml b/.github/workflows/dev-short-tests.yml index 566c84d01..9474190ff 100644 --- a/.github/workflows/dev-short-tests.yml +++ b/.github/workflows/dev-short-tests.yml @@ -349,6 +349,7 @@ jobs: make clean && make -j all MOREFLAGS="-Werror -DZSTD_NO_INLINE -DZSTD_STRIP_ERROR_STRINGS" make clean && make check MOREFLAGS="-Werror -DZSTD_NO_INLINE -DZSTD_STRIP_ERROR_STRINGS" make clean && make check ZSTD_LIB_EXCLUDE_COMPRESSORS_DFAST_AND_UP=1 MOREFLAGS="-Werror" + make clean && make check ZSTD_LIB_EXCLUDE_COMPRESSORS_GREEDY_AND_UP=1 MOREFLAGS="-Werror" dynamic-bmi2: runs-on: ubuntu-latest diff --git a/lib/README.md b/lib/README.md index 2da16647a..479820933 100644 --- a/lib/README.md +++ b/lib/README.md @@ -123,7 +123,10 @@ The file structure is designed to make this selection manually achievable for an strategies. In environments where the higher compression levels aren't used, it is possible to exclude all but the fastest strategy with `ZSTD_LIB_EXCLUDE_COMPRESSORS_DFAST_AND_UP=1`. (Note that this will change - the behavior of the default compression level.) + the behavior of the default compression level.) Or if you want to retain the + default compressor as well, you can set + `ZSTD_LIB_EXCLUDE_COMPRESSORS_GREEDY_AND_UP=1`, at the cost of an additional + ~20KB or so. For squeezing the last ounce of size out, you can also define `ZSTD_NO_INLINE`, which disables inlining, and `ZSTD_STRIP_ERROR_STRINGS`, diff --git a/lib/libzstd.mk b/lib/libzstd.mk index 0b1e03907..2c47ecdfa 100644 --- a/lib/libzstd.mk +++ b/lib/libzstd.mk @@ -48,6 +48,7 @@ endif ZSTD_NO_ASM ?= 0 ZSTD_LIB_EXCLUDE_COMPRESSORS_DFAST_AND_UP ?= 0 +ZSTD_LIB_EXCLUDE_COMPRESSORS_GREEDY_AND_UP ?= 0 ################################################################## # libzstd helpers @@ -182,6 +183,10 @@ endif ifneq ($(ZSTD_LIB_EXCLUDE_COMPRESSORS_DFAST_AND_UP), 0) CFLAGS += -DZSTD_EXCLUDE_DFAST_BLOCK_COMPRESSOR -DZSTD_EXCLUDE_GREEDY_BLOCK_COMPRESSOR -DZSTD_EXCLUDE_LAZY2_BLOCK_COMPRESSOR -DZSTD_EXCLUDE_BTLAZY2_BLOCK_COMPRESSOR -DZSTD_EXCLUDE_BTOPT_BLOCK_COMPRESSOR -DZSTD_EXCLUDE_BTULTRA_BLOCK_COMPRESSOR +else +ifneq ($(ZSTD_LIB_EXCLUDE_COMPRESSORS_GREEDY_AND_UP), 0) + CFLAGS += -DZSTD_EXCLUDE_GREEDY_BLOCK_COMPRESSOR -DZSTD_EXCLUDE_LAZY2_BLOCK_COMPRESSOR -DZSTD_EXCLUDE_BTLAZY2_BLOCK_COMPRESSOR -DZSTD_EXCLUDE_BTOPT_BLOCK_COMPRESSOR -DZSTD_EXCLUDE_BTULTRA_BLOCK_COMPRESSOR +endif endif ifneq ($(ZSTD_LEGACY_SUPPORT), 0)