Skip to content

Commit

Permalink
Add a build intermediary lib for zstd
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
c0d3z3r0 committed Dec 15, 2019
1 parent f4e47e1 commit 445f207
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 1 deletion.
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions lib/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion lib/libzpool/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
45 changes: 45 additions & 0 deletions lib/libzstd/Makefile.am
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 445f207

Please sign in to comment.