From 5ef4ebe688fc2d2d41bccc7a4cc7f01fa02dd267 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Niew=C3=B6hner?= Date: Fri, 13 Dec 2019 13:22:30 +0100 Subject: [PATCH] Add a build intermediary lib for zstd MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This add a new build intermediary libzstd. This allows us to keep zstd cleanly separated from libzpool and to override the frame-size compiler option without for zstd only. (This is needed due to unused coude in the unmodified zstd source.) Signed-off-by: Michael Niewöhner --- configure.ac | 1 + lib/Makefile.am | 3 +++ lib/libzpool/Makefile.am | 3 ++- lib/libzstd/Makefile.am | 45 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 lib/libzstd/Makefile.am diff --git a/configure.ac b/configure.ac index 0d814e018653..b72856460063 100644 --- a/configure.ac +++ b/configure.ac @@ -155,6 +155,7 @@ AC_CONFIG_FILES([ lib/libzfs/libzfs_core.pc lib/libzfs_core/Makefile lib/libzpool/Makefile + lib/libzstd/Makefile lib/libzutil/Makefile man/Makefile man/man1/Makefile diff --git a/lib/Makefile.am b/lib/Makefile.am index 8dff773df40b..5ad690fae82a 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -2,6 +2,9 @@ # These six libraries are intermediary build components. SUBDIRS = libavl libefi libicp libshare libspl libtpool libzutil libunicode +# zstd intermediary build component +SUBDIRS += libzstd + # These four libraries, which are installed as the final build product, # incorporate the six convenience libraries given above. SUBDIRS += libuutil libnvpair libzpool libzfs_core libzfs diff --git a/lib/libzpool/Makefile.am b/lib/libzpool/Makefile.am index 9c097ce79dd0..eb0903a6dfb2 100644 --- a/lib/libzpool/Makefile.am +++ b/lib/libzpool/Makefile.am @@ -196,7 +196,8 @@ libzpool_la_LIBADD = \ $(top_builddir)/lib/libicp/libicp.la \ $(top_builddir)/lib/libnvpair/libnvpair.la \ $(top_builddir)/lib/libunicode/libunicode.la \ - $(top_builddir)/lib/libzutil/libzutil.la + $(top_builddir)/lib/libzutil/libzutil.la \ + $(top_builddir)/lib/libzstd/libzstd.la libzpool_la_LIBADD += $(ZLIB) -ldl libzpool_la_LDFLAGS = -pthread -version-info 2:0:0 diff --git a/lib/libzstd/Makefile.am b/lib/libzstd/Makefile.am new file mode 100644 index 000000000000..02690113d444 --- /dev/null +++ b/lib/libzstd/Makefile.am @@ -0,0 +1,45 @@ +include $(top_srcdir)/config/Rules.am + +VPATH = \ + $(top_srcdir)/contrib/zstd \ + $(top_srcdir)/contrib/zstd/common \ + $(top_srcdir)/contrib/zstd/compress \ + $(top_srcdir)/contrib/zstd/decompress \ + $(top_srcdir)/module/zstd + +DEFAULT_INCLUDES += \ + -I$(top_srcdir)/contrib/zstd \ + -I$(top_srcdir)/contrib/zstd/common \ + -I$(top_srcdir)/contrib/zstd/compress \ + -I$(top_srcdir)/contrib/zstd/decompress + +noinst_LTLIBRARIES = libzstd.la + +KERNEL_C = \ + zstd_common.c \ + fse_decompress.c \ + entropy_common.c \ + xxhash.c \ + hist.c \ + error_private.c \ + zstd_compress.c \ + zstd_compress_literals.c \ + zstd_compress_sequences.c \ + fse_compress.c \ + huf_compress.c \ + zstd_double_fast.c \ + zstd_fast.c \ + zstd_lazy.c \ + zstd_ldm.c \ + zstd_opt.c \ + zstd_ddict.c \ + zstd_decompress.c \ + zstd_decompress_block.c \ + huf_decompress.c \ + zstd.c + +nodist_libzstd_la_SOURCES = $(KERNEL_C) + +# -fno-tree-vectorize gets set for gcc in zstd/common/compiler.h +# Set it for other compilers, too. +CFLAGS_zstd_decompress_block.o := -fno-tree-vectorize