ZSTD_LIB_MINIFY is offered only inside "if ZSTD", so a board which enables zstd for SPL alone gets the full-size library in the phase which can least afford it.
Add an SPL-scoped variant of this option and key the build flags off that. Signed-off-by: Alexey Charkov <[email protected]> --- lib/Kconfig | 12 ++++++++++++ lib/zstd/Makefile | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/Kconfig b/lib/Kconfig index 6e6df5b3b191..87b5f3f4864d 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -1025,6 +1025,18 @@ config SPL_ZSTD SPL_SYS_MALLOC_SIMPLE that memory is never returned, as free() does nothing there. +config SPL_ZSTD_LIB_MINIFY + bool "Minify Zstandard code in SPL" + depends on SPL_ZSTD + default y + help + This disables various optional components and changes the + compilation flags to prioritize space-saving. + + For detailed info, see zstd's lib/README.md + + https://github.com/facebook/zstd/blob/dev/lib/README.md + endmenu config ERRNO_STR diff --git a/lib/zstd/Makefile b/lib/zstd/Makefile index c9a7dfe405b4..9d1b4d4a4f72 100644 --- a/lib/zstd/Makefile +++ b/lib/zstd/Makefile @@ -11,7 +11,7 @@ obj-y += zstd_decompress.o obj-y += zstd_common.o -ifeq ($(CONFIG_ZSTD_LIB_MINIFY),y) +ifeq ($(CONFIG_$(PHASE_)ZSTD_LIB_MINIFY),y) ccflags-y += -DHUF_FORCE_DECOMPRESS_X1 ccflags-y += -DZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT ccflags-y += -DZSTD_NO_INLINE -- 2.55.0
