4 SRCS= entropy_common.c \
14 zstd_compress_literals.c \
15 zstd_compress_sequences.c \
20 zstd_decompress_block.c \
37 CFLAGS+= -I${ZSTDDIR}/lib -I${ZSTDDIR}/lib/common -DXXH_NAMESPACE=ZSTD_ \
43 ZSTDDIR= ${SRCTOP}/sys/contrib/zstd
44 .PATH: ${ZSTDDIR}/lib/common ${ZSTDDIR}/lib/compress \
45 ${ZSTDDIR}/lib/decompress ${ZSTDDIR}/lib/deprecated \
46 ${ZSTDDIR}/lib/dictBuilder ${ZSTDDIR}/lib
48 .include <bsd.compiler.mk>
50 # https://github.com/facebook/zstd/commit/812e8f2a [zstd 1.4.1]
51 # "Note that [GCC] autovectorization still does not do a good job on the
52 # optimized version, so it's turned off via attribute and flag. I found
53 # that neither attribute nor command-line flag were entirely successful in
54 # turning off vectorization, which is why there were both."
55 .if ${COMPILER_TYPE} == "gcc"
56 CFLAGS.zstd_decompress_block.c+= -fno-tree-vectorize
59 # Work around for LLVM bug 35023, https://bugs.llvm.org/show_bug.cgi?id=35023
60 # Fixed in https://reviews.llvm.org/rL349935 ; not sure if we have that version
61 # in our LLVM or not yet.
62 .if ${MACHINE_ARCH:Marm*} != ""
63 CFLAGS.zstd_compress.c+= -O0
66 # Work around lack of __bswap[sd]i2() intrinsics on riscv. Probably should be
67 # added to one of the runtime C libraries instead.
68 .if ${MACHINE_CPUARCH} == "riscv"
69 .PATH: ${ZSTDDIR}/lib/freebsd
70 SRCS+= zstd_kfreebsd.c