Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Dec 2020 15:56:09 GMT
From:      Conrad Meyer <cem@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: f7cd7fe51c41 - sys/contrib/zstd: Import zstd 1.4.8
Message-ID:  <202012251556.0BPFu9l7029902@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by cem:

URL: https://cgit.FreeBSD.org/src/commit/?id=f7cd7fe51c4140960ebea00410ed62894f5625d1

commit f7cd7fe51c4140960ebea00410ed62894f5625d1
Merge: dc505d53dcc1 f6ae97673c28
Author:     Conrad Meyer <cem@FreeBSD.org>
AuthorDate: 2020-12-25 15:42:41 +0000
Commit:     Conrad Meyer <cem@FreeBSD.org>
CommitDate: 2020-12-25 15:42:41 +0000

    sys/contrib/zstd: Import zstd 1.4.8
    
    Merge commit 'f6ae97673c28bdb9ae795bd235ab6f26f2536a2d' into main
    
    Changes from 1.4.5:
      * https://github.com/facebook/zstd/releases/tag/v1.4.8
      * https://github.com/facebook/zstd/releases/tag/v1.4.7
      (and there was no public v1.4.6)
    
    Conflicts:
            sys/contrib/zstd/lib/common/zstd_internal.h (new ZSTD_NO_INTRINSICS)

 sys/conf/kern.pre.mk                               |    6 +-
 sys/contrib/zstd/CHANGELOG                         |  173 +-
 sys/contrib/zstd/CONTRIBUTING.md                   |   18 +-
 sys/contrib/zstd/Makefile                          |   68 +-
 sys/contrib/zstd/README.md                         |   12 +-
 sys/contrib/zstd/TESTING.md                        |    2 +-
 sys/contrib/zstd/appveyor.yml                      |   19 +-
 sys/contrib/zstd/doc/zstd_compression_format.md    |  114 +-
 sys/contrib/zstd/doc/zstd_manual.html              |  314 +++-
 sys/contrib/zstd/examples/Makefile                 |   53 +-
 sys/contrib/zstd/examples/streaming_compression.c  |    1 +
 .../examples/streaming_compression_thread_pool.c   |  178 ++
 sys/contrib/zstd/lib/Makefile                      |  365 ++--
 sys/contrib/zstd/lib/README.md                     |   28 +
 sys/contrib/zstd/lib/common/bitstream.h            |   39 +-
 sys/contrib/zstd/lib/common/compiler.h             |  119 +-
 sys/contrib/zstd/lib/common/cpu.h                  |    2 -
 sys/contrib/zstd/lib/common/debug.h                |   29 +-
 sys/contrib/zstd/lib/common/entropy_common.c       |  230 ++-
 sys/contrib/zstd/lib/common/error_private.c        |    1 +
 sys/contrib/zstd/lib/common/error_private.h        |    2 +-
 sys/contrib/zstd/lib/common/fse.h                  |   50 +-
 sys/contrib/zstd/lib/common/fse_decompress.c       |  139 +-
 sys/contrib/zstd/lib/common/huf.h                  |   31 +-
 sys/contrib/zstd/lib/common/mem.h                  |  159 +-
 sys/contrib/zstd/lib/common/pool.c                 |   38 +-
 sys/contrib/zstd/lib/common/pool.h                 |    2 +-
 sys/contrib/zstd/lib/common/threading.c            |   11 +-
 sys/contrib/zstd/lib/common/xxhash.c               |   74 +-
 sys/contrib/zstd/lib/common/xxhash.h               |    2 +-
 sys/contrib/zstd/lib/common/zstd_common.c          |   18 +-
 sys/contrib/zstd/lib/common/zstd_deps.h            |  111 ++
 sys/contrib/zstd/lib/common/zstd_errors.h          |    1 +
 sys/contrib/zstd/lib/common/zstd_internal.h        |  147 +-
 sys/contrib/zstd/lib/compress/fse_compress.c       |   53 +-
 sys/contrib/zstd/lib/compress/hist.c               |   54 +-
 sys/contrib/zstd/lib/compress/hist.h               |    2 +-
 sys/contrib/zstd/lib/compress/huf_compress.c       |  316 ++--
 sys/contrib/zstd/lib/compress/zstd_compress.c      | 1750 +++++++++++++++-----
 .../zstd/lib/compress/zstd_compress_internal.h     |  160 +-
 .../zstd/lib/compress/zstd_compress_literals.c     |    8 +-
 .../zstd/lib/compress/zstd_compress_sequences.c    |   20 +-
 .../zstd/lib/compress/zstd_compress_superblock.c   |   42 +-
 sys/contrib/zstd/lib/compress/zstd_cwksp.h         |   84 +-
 sys/contrib/zstd/lib/compress/zstd_double_fast.c   |   44 +-
 sys/contrib/zstd/lib/compress/zstd_fast.c          |   38 +-
 sys/contrib/zstd/lib/compress/zstd_lazy.c          |  428 ++++-
 sys/contrib/zstd/lib/compress/zstd_lazy.h          |   20 +
 sys/contrib/zstd/lib/compress/zstd_ldm.c           |   77 +-
 sys/contrib/zstd/lib/compress/zstd_ldm.h           |    6 +
 sys/contrib/zstd/lib/compress/zstd_opt.c           |  235 ++-
 sys/contrib/zstd/lib/compress/zstdmt_compress.c    |  480 +-----
 sys/contrib/zstd/lib/compress/zstdmt_compress.h    |  134 +-
 sys/contrib/zstd/lib/decompress/huf_decompress.c   |  502 +++---
 sys/contrib/zstd/lib/decompress/zstd_ddict.c       |   16 +-
 sys/contrib/zstd/lib/decompress/zstd_ddict.h       |    2 +-
 sys/contrib/zstd/lib/decompress/zstd_decompress.c  |  205 ++-
 .../zstd/lib/decompress/zstd_decompress_block.c    |  184 +-
 .../zstd/lib/decompress/zstd_decompress_block.h    |    7 +-
 .../zstd/lib/decompress/zstd_decompress_internal.h |   21 +-
 sys/contrib/zstd/lib/dictBuilder/cover.c           |   49 +-
 sys/contrib/zstd/lib/dictBuilder/cover.h           |    2 +-
 sys/contrib/zstd/lib/dictBuilder/fastcover.c       |   39 +-
 sys/contrib/zstd/lib/dictBuilder/zdict.c           |   31 +-
 sys/contrib/zstd/lib/dictBuilder/zdict.h           |    2 +-
 sys/contrib/zstd/lib/legacy/zstd_v01.c             |    6 +-
 sys/contrib/zstd/lib/legacy/zstd_v02.c             |    6 +-
 sys/contrib/zstd/lib/legacy/zstd_v03.c             |    6 +-
 sys/contrib/zstd/lib/legacy/zstd_v04.c             |    8 +-
 sys/contrib/zstd/lib/legacy/zstd_v05.c             |    6 +-
 sys/contrib/zstd/lib/legacy/zstd_v06.c             |    6 +-
 sys/contrib/zstd/lib/legacy/zstd_v07.c             |    6 +-
 sys/contrib/zstd/lib/libzstd.pc.in                 |    6 +-
 sys/contrib/zstd/lib/zstd.h                        |  395 ++++-
 sys/contrib/zstd/programs/Makefile                 |  284 ++--
 sys/contrib/zstd/programs/README.md                |   70 +-
 sys/contrib/zstd/programs/dibio.c                  |    2 +-
 sys/contrib/zstd/programs/fileio.c                 |  462 ++++--
 sys/contrib/zstd/programs/fileio.h                 |   29 +-
 sys/contrib/zstd/programs/platform.h               |    6 +
 sys/contrib/zstd/programs/timefn.h                 |    6 +-
 sys/contrib/zstd/programs/util.c                   |  407 ++++-
 sys/contrib/zstd/programs/util.h                   |   62 +-
 sys/contrib/zstd/programs/zstd.1                   |   77 +-
 sys/contrib/zstd/programs/zstd.1.md                |  150 +-
 sys/contrib/zstd/programs/zstdcli.c                |  195 ++-
 sys/contrib/zstd/programs/zstdgrep.1               |    2 +-
 sys/contrib/zstd/programs/zstdless.1               |    2 +-
 sys/contrib/zstd/zlibWrapper/Makefile              |    4 +-
 sys/contrib/zstd/zlibWrapper/zstd_zlibwrapper.c    |  137 +-
 90 files changed, 6825 insertions(+), 3082 deletions(-)

diff --cc sys/conf/kern.pre.mk
index 4a0663f49753,000000000000..4754092694c1
mode 100644,000000..100644
--- a/sys/conf/kern.pre.mk
+++ b/sys/conf/kern.pre.mk
@@@ -1,363 -1,0 +1,367 @@@
 +# $FreeBSD$
 +
 +# Part of a unified Makefile for building kernels.  This part contains all
 +# of the definitions that need to be before %BEFORE_DEPEND.
 +
 +# Allow user to configure things that only effect src tree builds.
 +# Note: This is duplicated from src.sys.mk to ensure that we include
 +# /etc/src.conf when building the kernel. Kernels can be built without
 +# the rest of /usr/src, but they still always process SRCCONF even though
 +# the normal mechanisms to prevent that (compiling out of tree) won't
 +# work. To ensure they do work, we have to duplicate thee few lines here.
 +SRCCONF?=	/etc/src.conf
 +.if (exists(${SRCCONF}) || ${SRCCONF} != "/etc/src.conf") && !target(_srcconf_included_)
 +.include "${SRCCONF}"
 +_srcconf_included_:
 +.endif
 +
 +.include <bsd.own.mk>
 +.include <bsd.compiler.mk>
 +.include "kern.opts.mk"
 +
 +# The kernel build always occurs in the object directory which is .CURDIR.
 +.if ${.MAKE.MODE:Unormal:Mmeta}
 +.MAKE.MODE+=	curdirOk=yes
 +.endif
 +
 +# The kernel build always expects .OBJDIR=.CURDIR.
 +.OBJDIR: ${.CURDIR}
 +
 +.if defined(NO_OBJWALK) || ${MK_AUTO_OBJ} == "yes"
 +NO_OBJWALK=		t
 +NO_MODULES_OBJ=	t
 +.endif
 +.if !defined(NO_OBJWALK)
 +_obj=		obj
 +.endif
 +
 +# Can be overridden by makeoptions or /etc/make.conf
 +KERNEL_KO?=	kernel
 +KERNEL?=	kernel
 +KODIR?=		/boot/${KERNEL}
 +LDSCRIPT_NAME?=	ldscript.$M
 +LDSCRIPT?=	$S/conf/${LDSCRIPT_NAME}
 +
 +M=		${MACHINE}
 +
 +AWK?=		awk
 +CP?=		cp
 +NM?=		nm
 +OBJCOPY?=	objcopy
 +SIZE?=		size
 +
 +.if defined(DEBUG)
 +CTFFLAGS+=	-g
 +.endif
 +.if ${MACHINE_CPUARCH} == "amd64" && ${COMPILER_TYPE} != "clang"
 +_COPTFLAGS_EXTRA=-frename-registers
 +.else
 +_COPTFLAGS_EXTRA=
 +.endif
 +COPTFLAGS?=-O2 -pipe ${_COPTFLAGS_EXTRA}
 +.if !empty(COPTFLAGS:M-O[23s]) && empty(COPTFLAGS:M-fno-strict-aliasing)
 +COPTFLAGS+= -fno-strict-aliasing
 +.endif
 +.if !defined(NO_CPU_COPTFLAGS)
 +COPTFLAGS+= ${_CPUCFLAGS}
 +.endif
 +NOSTDINC= -nostdinc
 +
 +INCLUDES= ${NOSTDINC} ${INCLMAGIC} -I. -I$S -I$S/contrib/ck/include
 +
 +CFLAGS=	${COPTFLAGS} ${DEBUG}
 +CFLAGS+= ${INCLUDES} -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h
 +CFLAGS_PARAM_INLINE_UNIT_GROWTH?=100
 +CFLAGS_PARAM_LARGE_FUNCTION_GROWTH?=1000
 +.if ${MACHINE_CPUARCH} == "mips"
 +CFLAGS_ARCH_PARAMS?=--param max-inline-insns-single=1000 -DMACHINE_ARCH='"${MACHINE_ARCH}"'
 +.endif
 +CFLAGS.gcc+= -fms-extensions -finline-limit=${INLINE_LIMIT}
 +CFLAGS.gcc+= --param inline-unit-growth=${CFLAGS_PARAM_INLINE_UNIT_GROWTH}
 +CFLAGS.gcc+= --param large-function-growth=${CFLAGS_PARAM_LARGE_FUNCTION_GROWTH}
 +CFLAGS.gcc+= -fms-extensions
 +.if defined(CFLAGS_ARCH_PARAMS)
 +CFLAGS.gcc+=${CFLAGS_ARCH_PARAMS}
 +.endif
 +WERROR?=	-Werror
 +# The following should be removed no earlier than LLVM11 being imported into the
 +# tree, to ensure we don't regress the build.  LLVM11 and GCC10 will switch the
 +# default over to -fno-common, making this redundant.
 +CFLAGS+=	-fno-common
 +
 +# XXX LOCORE means "don't declare C stuff" not "for locore.s".
 +ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${CFLAGS} ${ASM_CFLAGS.${.IMPSRC:T}} 
 +
 +.if defined(PROFLEVEL) && ${PROFLEVEL} >= 1
 +CFLAGS+=	-DGPROF
 +CFLAGS.gcc+=	-falign-functions=16
 +.if ${PROFLEVEL} >= 2
 +CFLAGS+=	-DGPROF4 -DGUPROF
 +PROF=		-pg
 +.if ${COMPILER_TYPE} == "gcc"
 +PROF+=		-mprofiler-epilogue
 +.endif
 +.else
 +PROF=		-pg
 +.endif
 +.endif
 +DEFINED_PROF=	${PROF}
 +
 +KCSAN_ENABLED!=	grep KCSAN opt_global.h || true ; echo
 +.if !empty(KCSAN_ENABLED)
 +SAN_CFLAGS+=	-fsanitize=thread
 +.endif
 +
 +KUBSAN_ENABLED!=	grep KUBSAN opt_global.h || true ; echo
 +.if !empty(KUBSAN_ENABLED)
 +SAN_CFLAGS+=	-fsanitize=undefined
 +.endif
 +
 +COVERAGE_ENABLED!=	grep COVERAGE opt_global.h || true ; echo
 +.if !empty(COVERAGE_ENABLED)
 +.if ${COMPILER_TYPE} == "clang" || \
 +    (${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 80100)
 +SAN_CFLAGS+=	-fsanitize-coverage=trace-pc,trace-cmp
 +.else
 +SAN_CFLAGS+=	-fsanitize-coverage=trace-pc
 +.endif
 +.endif
 +
 +CFLAGS+=	${SAN_CFLAGS}
 +
 +GCOV_ENABLED!=	grep GCOV opt_global.h || true ; echo
 +.if !empty(GCOV_ENABLED)
 +.if ${COMPILER_TYPE} == "gcc"
 +GCOV_CFLAGS+=	 -fprofile-arcs -ftest-coverage
 +.endif
 +.endif
 +
 +CFLAGS+=	${GCOV_CFLAGS}
 +
 +# Put configuration-specific C flags last (except for ${PROF}) so that they
 +# can override the others.
 +CFLAGS+=	${CONF_CFLAGS}
 +
 +.if defined(LINKER_FEATURES) && ${LINKER_FEATURES:Mbuild-id}
 +LDFLAGS+=	--build-id=sha1
 +.endif
 +
 +.if (${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
 +    ${MACHINE_CPUARCH} == "i386" || ${MACHINE} == "powerpc") && \
 +    defined(LINKER_FEATURES) && ${LINKER_FEATURES:Mifunc} == ""
 +.error amd64/arm64/i386/ppc* kernel requires linker ifunc support
 +.endif
 +.if ${MACHINE_CPUARCH} == "amd64"
 +LDFLAGS+=	-z max-page-size=2097152
 +.if ${LINKER_TYPE} != "lld"
 +LDFLAGS+=	-z common-page-size=4096
 +.else
 +.if defined(LINKER_FEATURES) && !${LINKER_FEATURES:Mifunc-noplt}
 +.warning "Linker ${LD} does not support -z ifunc-noplt -> ifunc calls are unoptimized."
 +.else
 +LDFLAGS+=	-z notext -z ifunc-noplt
 +.endif
 +.endif
 +.endif  # ${MACHINE_CPUARCH} == "amd64"
 +
 +.if ${MACHINE_CPUARCH} == "riscv"
 +# Hack: Work around undefined weak symbols being out of range when linking with
 +# LLD (address is a PC-relative calculation, and BFD works around this by
 +# rewriting the instructions to generate an absolute address of 0); -fPIE
 +# avoids this since it uses the GOT for all extern symbols, which is overly
 +# inefficient for us. Drop once undefined weak symbols work with medany.
 +.if ${LINKER_TYPE} == "lld"
 +CFLAGS+=	-fPIE
 +.endif
 +.endif
 +
 +NORMAL_C= ${CC} -c ${CFLAGS} ${WERROR} ${PROF} ${.IMPSRC}
 +NORMAL_S= ${CC:N${CCACHE_BIN}} -c ${ASM_CFLAGS} ${WERROR} ${.IMPSRC}
 +PROFILE_C= ${CC} -c ${CFLAGS} ${WERROR} ${.IMPSRC}
 +NORMAL_C_NOWERROR= ${CC} -c ${CFLAGS} ${PROF} ${.IMPSRC}
 +
 +NORMAL_M= ${AWK} -f $S/tools/makeobjops.awk ${.IMPSRC} -c ; \
 +	  ${CC} -c ${CFLAGS} ${WERROR} ${PROF} ${.PREFIX}.c
 +
 +NORMAL_FW= uudecode -o ${.TARGET} ${.ALLSRC}
 +NORMAL_FWO= ${CC:N${CCACHE_BIN}} -c ${ASM_CFLAGS} ${WERROR} -o ${.TARGET} \
 +	$S/kern/firmw.S -DFIRMW_FILE="${.ALLSRC:M*.fw}" \
 +	-DFIRMW_SYMBOL="${.ALLSRC:M*.fw:C/[-.\/]/_/g}"
 +
 +# for ZSTD in the kernel (include zstd/lib/freebsd before other CFLAGS)
- ZSTD_C= ${CC} -c -DZSTD_HEAPMODE=1 -I$S/contrib/zstd/lib/freebsd ${CFLAGS} -I$S/contrib/zstd/lib -I$S/contrib/zstd/lib/common ${WERROR} -Wno-inline -Wno-missing-prototypes ${PROF} -U__BMI__ ${.IMPSRC}
++ZSTD_C= ${CC} -c -DZSTD_HEAPMODE=1 -I$S/contrib/zstd/lib/freebsd ${CFLAGS} \
++	-I$S/contrib/zstd/lib -I$S/contrib/zstd/lib/common ${WERROR} \
++	-Wno-inline -Wno-missing-prototypes ${PROF} -U__BMI__ \
++	-DZSTD_NO_INTRINSICS \
++	${.IMPSRC}
 +# https://github.com/facebook/zstd/commit/812e8f2a [zstd 1.4.1]
 +# "Note that [GCC] autovectorization still does not do a good job on the
 +# optimized version, so it's turned off via attribute and flag.  I found
 +# that neither attribute nor command-line flag were entirely successful in
 +# turning off vectorization, which is why there were both."
 +.if ${COMPILER_TYPE} == "gcc"
 +ZSTD_DECOMPRESS_BLOCK_FLAGS= -fno-tree-vectorize
 +.endif
 +
 +ZINCDIR=$S/contrib/openzfs/include
 +# Common for dtrace / zfs
 +CDDL_CFLAGS=	\
 +	-DFREEBSD_NAMECACHE \
 +	-D_SYS_VMEM_H_ \
 +	-D__KERNEL \
 +	-D__KERNEL__ \
 +	-nostdinc \
 +	-include $S/modules/zfs/static_ccompile.h \
 +	-I${ZINCDIR} \
 +	-I${ZINCDIR}/os/freebsd \
 +	-I${ZINCDIR}/os/freebsd/spl \
 +	-I${ZINCDIR}/os/freebsd/zfs  \
 +	-I$S/modules/zfs \
 +	-I$S/contrib/openzfs/module/zstd/include \
 +	${CFLAGS} \
 +	-Wno-cast-qual \
 +	-Wno-duplicate-decl-specifier \
 +	-Wno-inline \
 +	-Wno-missing-braces \
 +	-Wno-missing-prototypes \
 +	-Wno-nested-externs \
 +	-Wno-parentheses \
 +	-Wno-pointer-arith \
 +	-Wno-redundant-decls \
 +	-Wno-strict-prototypes \
 +	-Wno-switch \
 +	-Wno-undef \
 +	-Wno-uninitialized \
 +	-Wno-unknown-pragmas \
 +	-Wno-unused \
 +	-include ${ZINCDIR}/os/freebsd/spl/sys/ccompile.h \
 +	-I$S/cddl/contrib/opensolaris/uts/common \
 +	-I$S -I$S/cddl/compat/opensolaris
 +CDDL_C=		${CC} -c ${CDDL_CFLAGS} ${WERROR} ${PROF} ${.IMPSRC}
 +
 +# Special flags for managing the compat compiles for ZFS
 +ZFS_CFLAGS+=	${CDDL_CFLAGS} -DBUILDING_ZFS -DHAVE_UIO_ZEROCOPY \
 +	-DWITH_NETDUMP -D__KERNEL__ -D_SYS_CONDVAR_H_ -DSMP \
 +	-DIN_FREEBSD_BASE -DHAVE_KSID
 +
 +.if ${MACHINE_ARCH} == "amd64"
 +ZFS_CFLAGS+= -DHAVE_AVX2 -DHAVE_AVX -D__x86_64 -DHAVE_SSE2 -DHAVE_AVX512F \
 +	-DHAVE_SSSE3 -DHAVE_AVX512BW
 +.endif
 +
 +.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc" || \
 +	${MACHINE_ARCH} == "powerpcspe" || ${MACHINE_ARCH} == "arm"
 +ZFS_CFLAGS+= -DBITS_PER_LONG=32
 +.else
 +ZFS_CFLAGS+= -DBITS_PER_LONG=64
 +.endif
 +
 +
 +ZFS_ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${ZFS_CFLAGS}
 +ZFS_C=		${CC} -c ${ZFS_CFLAGS} ${WERROR} ${PROF} ${.IMPSRC}
 +ZFS_RPC_C=	${CC} -c ${ZFS_CFLAGS} -DHAVE_RPC_TYPES ${WERROR} ${PROF} ${.IMPSRC}
 +ZFS_S=		${CC} -c ${ZFS_ASM_CFLAGS} ${WERROR} ${.IMPSRC}
 +
 +
 +
 +# Special flags for managing the compat compiles for DTrace
 +DTRACE_CFLAGS=	-DBUILDING_DTRACE ${CDDL_CFLAGS} -I$S/cddl/dev/dtrace -I$S/cddl/dev/dtrace/${MACHINE_CPUARCH}
 +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
 +DTRACE_CFLAGS+=	-I$S/cddl/contrib/opensolaris/uts/intel -I$S/cddl/dev/dtrace/x86
 +.endif
 +DTRACE_CFLAGS+=	-I$S/cddl/contrib/opensolaris/common/util -I$S -DDIS_MEM -DSMP -I$S/cddl/compat/opensolaris
 +DTRACE_CFLAGS+=	-I$S/cddl/contrib/opensolaris/uts/common
 +DTRACE_ASM_CFLAGS=	-x assembler-with-cpp -DLOCORE ${DTRACE_CFLAGS}
 +DTRACE_C=	${CC} -c ${DTRACE_CFLAGS}	${WERROR} ${PROF} ${.IMPSRC}
 +DTRACE_S=	${CC} -c ${DTRACE_ASM_CFLAGS}	${WERROR} ${.IMPSRC}
 +
 +# Special flags for managing the compat compiles for DTrace/FBT
 +FBT_CFLAGS=	-DBUILDING_DTRACE -nostdinc -I$S/cddl/dev/fbt/${MACHINE_CPUARCH} -I$S/cddl/dev/fbt ${CDDL_CFLAGS} -I$S/cddl/compat/opensolaris -I$S/cddl/contrib/opensolaris/uts/common  
 +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
 +FBT_CFLAGS+=	-I$S/cddl/dev/fbt/x86
 +.endif
 +FBT_C=		${CC} -c ${FBT_CFLAGS}		${WERROR} ${PROF} ${.IMPSRC}
 +
 +.if ${MK_CTF} != "no"
 +NORMAL_CTFCONVERT=	${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
 +.elif ${MAKE_VERSION} >= 5201111300
 +NORMAL_CTFCONVERT=
 +.else
 +NORMAL_CTFCONVERT=	@:
 +.endif
 +
 +# Linux Kernel Programming Interface C-flags
 +LINUXKPI_INCLUDES=	-I$S/compat/linuxkpi/common/include
 +LINUXKPI_C=		${NORMAL_C} ${LINUXKPI_INCLUDES}
 +
 +# Infiniband C flags.  Correct include paths and omit errors that linux
 +# does not honor.
 +OFEDINCLUDES=	-I$S/ofed/include -I$S/ofed/include/uapi ${LINUXKPI_INCLUDES}
 +OFEDNOERR=	-Wno-cast-qual -Wno-pointer-arith
 +OFEDCFLAGS=	${CFLAGS:N-I*} -DCONFIG_INFINIBAND_USER_MEM \
 +		${OFEDINCLUDES} ${CFLAGS:M-I*} ${OFEDNOERR}
 +OFED_C_NOIMP=	${CC} -c -o ${.TARGET} ${OFEDCFLAGS} ${WERROR} ${PROF}
 +OFED_C=		${OFED_C_NOIMP} ${.IMPSRC}
 +
 +# mlxfw C flags.
 +MLXFW_C=	${OFED_C_NOIMP} \
 +		-I${SRCTOP}/sys/contrib/xz-embedded/freebsd \
 +		-I${SRCTOP}/sys/contrib/xz-embedded/linux/lib/xz \
 +		${.IMPSRC}
 +
 +GEN_CFILES= $S/$M/$M/genassym.c ${MFILES:T:S/.m$/.c/}
 +SYSTEM_CFILES= config.c env.c hints.c vnode_if.c
 +SYSTEM_DEP= Makefile ${SYSTEM_OBJS}
 +SYSTEM_OBJS= locore.o ${MDOBJS} ${OBJS}
 +SYSTEM_OBJS+= ${SYSTEM_CFILES:.c=.o}
 +SYSTEM_OBJS+= hack.pico
 +
 +KEYMAP=kbdcontrol -P ${SRCTOP}/share/vt/keymaps -P ${SRCTOP}/share/syscons/keymaps
 +KEYMAP_FIX=sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /'
 +
 +MD_ROOT_SIZE_CONFIGURED!=	grep MD_ROOT_SIZE opt_md.h || true ; echo
 +.if ${MFS_IMAGE:Uno} != "no"
 +.if empty(MD_ROOT_SIZE_CONFIGURED)
 +SYSTEM_OBJS+= embedfs_${MFS_IMAGE:T:R}.o
 +.endif
 +.endif
 +SYSTEM_LD_BASECMD= \
 +	${LD} -m ${LD_EMULATION} -Bdynamic -T ${LDSCRIPT} ${_LDFLAGS} \
 +	--no-warn-mismatch --warn-common --export-dynamic \
 +	--dynamic-linker /red/herring -X
 +SYSTEM_LD= @${SYSTEM_LD_BASECMD} -o ${.TARGET} ${SYSTEM_OBJS} vers.o
 +SYSTEM_LD_TAIL= @${OBJCOPY} --strip-symbol gcc2_compiled. ${.TARGET} ; \
 +	${SIZE} ${.TARGET} ; chmod 755 ${.TARGET}
 +SYSTEM_DEP+= ${LDSCRIPT}
 +
 +# Calculate path for .m files early, if needed.
 +.if !defined(NO_MODULES) && !defined(__MPATH) && !make(install) && \
 +    (empty(.MAKEFLAGS:M-V) || defined(NO_SKIP_MPATH))
 +__MPATH!=find ${S:tA}/ -name \*_if.m
 +.endif
 +
 +# MKMODULESENV is set here so that port makefiles can augment
 +# them.
 +
 +MKMODULESENV+=	MAKEOBJDIRPREFIX=${.OBJDIR}/modules KMODDIR=${KODIR}
 +MKMODULESENV+=	MACHINE_CPUARCH=${MACHINE_CPUARCH}
 +MKMODULESENV+=	MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE_ARCH}
 +MKMODULESENV+=	MODULES_EXTRA="${MODULES_EXTRA}" WITHOUT_MODULES="${WITHOUT_MODULES}"
 +MKMODULESENV+=	ARCH_FLAGS="${ARCH_FLAGS}"
 +.if (${KERN_IDENT} == LINT)
 +MKMODULESENV+=	ALL_MODULES=LINT
 +.endif
 +.if defined(MODULES_OVERRIDE)
 +MKMODULESENV+=	MODULES_OVERRIDE="${MODULES_OVERRIDE}"
 +.endif
 +.if defined(DEBUG)
 +MKMODULESENV+=	DEBUG_FLAGS="${DEBUG}"
 +.endif
 +.if !defined(NO_MODULES)
 +MKMODULESENV+=	__MPATH="${__MPATH}"
 +.endif
 +
 +# Detect kernel config options that force stack frames to be turned on.
 +DDB_ENABLED!=	grep DDB opt_ddb.h || true ; echo
 +DTR_ENABLED!=	grep KDTRACE_FRAME opt_kdtrace.h || true ; echo
 +HWPMC_ENABLED!=	grep HWPMC opt_hwpmc_hooks.h || true ; echo
diff --cc sys/contrib/zstd/Makefile
index 2c1d34604fe9,000000000000..2832fb4752b8
mode 100644,000000..100644
--- a/sys/contrib/zstd/Makefile
+++ b/sys/contrib/zstd/Makefile
@@@ -1,414 -1,0 +1,420 @@@
 +# ################################################################
 +# Copyright (c) 2015-2020, Yann Collet, Facebook, Inc.
 +# All rights reserved.
 +#
 +# This source code is licensed under both the BSD-style license (found in the
 +# LICENSE file in the root directory of this source tree) and the GPLv2 (found
 +# in the COPYING file in the root directory of this source tree).
 +# You may select, at your option, one of the above-listed licenses.
 +# ################################################################
 +
++# verbose mode (print commands) on V=1 or VERBOSE=1
++Q = $(if $(filter 1,$(V) $(VERBOSE)),,@)
++
 +PRGDIR   = programs
 +ZSTDDIR  = lib
 +BUILDIR  = build
 +ZWRAPDIR = zlibWrapper
 +TESTDIR  = tests
 +FUZZDIR  = $(TESTDIR)/fuzz
 +
 +# Define nul output
 +VOID = /dev/null
 +
 +# When cross-compiling from linux to windows, you might
 +# need to specify this as "Windows." Fedora build fails
 +# without it.
 +#
 +# Note: mingw-w64 build from linux to windows does not
 +# fail on other tested distros (ubuntu, debian) even
 +# without manually specifying the TARGET_SYSTEM.
 +TARGET_SYSTEM ?= $(OS)
 +
 +ifneq (,$(filter Windows%,$(TARGET_SYSTEM)))
- EXT =.exe
++  EXT =.exe
 +else
- EXT =
++  EXT =
 +endif
 +
 +## default: Build lib-release and zstd-release
 +.PHONY: default
 +default: lib-release zstd-release
 +
 +.PHONY: all
 +all: allmost examples manual contrib
 +
 +.PHONY: allmost
 +allmost: allzstd zlibwrapper
 +
 +# skip zwrapper, can't build that on alternate architectures without the proper zlib installed
 +.PHONY: allzstd
 +allzstd: lib-all
- 	$(MAKE) -C $(PRGDIR) all
- 	$(MAKE) -C $(TESTDIR) all
++	$(Q)$(MAKE) -C $(PRGDIR) all
++	$(Q)$(MAKE) -C $(TESTDIR) all
 +
 +.PHONY: all32
 +all32:
 +	$(MAKE) -C $(PRGDIR) zstd32
 +	$(MAKE) -C $(TESTDIR) all32
 +
 +.PHONY: lib lib-release libzstd.a
++lib-all : lib
 +lib lib-release lib-all :
- 	@$(MAKE) -C $(ZSTDDIR) $@
++	$(Q)$(MAKE) -C $(ZSTDDIR) $@
 +
 +.PHONY: zstd zstd-release
 +zstd zstd-release:
- 	@$(MAKE) -C $(PRGDIR) $@
- 	cp $(PRGDIR)/zstd$(EXT) .
++	$(Q)$(MAKE) -C $(PRGDIR) $@
++	$(Q)ln -sf $(PRGDIR)/zstd$(EXT) zstd$(EXT)
 +
 +.PHONY: zstdmt
 +zstdmt:
- 	@$(MAKE) -C $(PRGDIR) $@
- 	cp $(PRGDIR)/zstd$(EXT) ./zstdmt$(EXT)
++	$(Q)$(MAKE) -C $(PRGDIR) $@
++	$(Q)cp $(PRGDIR)/zstd$(EXT) ./zstdmt$(EXT)
 +
 +.PHONY: zlibwrapper
 +zlibwrapper: lib
 +	$(MAKE) -C $(ZWRAPDIR) all
 +
 +## test: run long-duration tests
 +.PHONY: test
 +DEBUGLEVEL ?= 1
- test: MOREFLAGS += -g -DDEBUGLEVEL=$(DEBUGLEVEL) -Werror
++test: MOREFLAGS += -g -Werror
 +test:
- 	MOREFLAGS="$(MOREFLAGS)" $(MAKE) -j -C $(PRGDIR) allVariants
++	DEBUGLEVEL=$(DEBUGLEVEL) MOREFLAGS="$(MOREFLAGS)" $(MAKE) -j -C $(PRGDIR) allVariants
 +	$(MAKE) -C $(TESTDIR) $@
- 	ZSTD=../../programs/zstd $(MAKE) -C doc/educational_decoder test
++	ZSTD=../../programs/zstd $(MAKE) -C doc/educational_decoder $@
 +
 +## shortest: same as `make check`
 +.PHONY: shortest
 +shortest:
- 	$(MAKE) -C $(TESTDIR) $@
++	$(Q)$(MAKE) -C $(TESTDIR) $@
 +
 +## check: run basic tests for `zstd` cli
 +.PHONY: check
 +check: shortest
 +
 +.PHONY: automated_benchmarking
 +automated_benchmarking:
 +	$(MAKE) -C $(TESTDIR) $@
 +
 +.PHONY: benchmarking
 +benchmarking: automated_benchmarking
 +
- ## examples: build all examples in `/examples` directory
++## examples: build all examples in `examples/` directory
 +.PHONY: examples
 +examples: lib
- 	CPPFLAGS=-I../lib LDFLAGS=-L../lib $(MAKE) -C examples/ all
++	$(MAKE) -C examples all
 +
 +## manual: generate API documentation in html format
 +.PHONY: manual
 +manual:
 +	$(MAKE) -C contrib/gen_html $@
 +
 +## man: generate man page
 +.PHONY: man
 +man:
 +	$(MAKE) -C programs $@
 +
 +## contrib: build all supported projects in `/contrib` directory
 +.PHONY: contrib
 +contrib: lib
 +	$(MAKE) -C contrib/pzstd all
 +	$(MAKE) -C contrib/seekable_format/examples all
++	$(MAKE) -C contrib/seekable_format/tests test
 +	$(MAKE) -C contrib/largeNbDicts all
 +	cd contrib/single_file_libs/ ; ./build_decoder_test.sh
 +	cd contrib/single_file_libs/ ; ./build_library_test.sh
 +
 +.PHONY: cleanTabs
 +cleanTabs:
 +	cd contrib; ./cleanTabs
 +
 +.PHONY: clean
 +clean:
- 	@$(MAKE) -C $(ZSTDDIR) $@ > $(VOID)
- 	@$(MAKE) -C $(PRGDIR) $@ > $(VOID)
- 	@$(MAKE) -C $(TESTDIR) $@ > $(VOID)
- 	@$(MAKE) -C $(ZWRAPDIR) $@ > $(VOID)
- 	@$(MAKE) -C examples/ $@ > $(VOID)
- 	@$(MAKE) -C contrib/gen_html $@ > $(VOID)
- 	@$(MAKE) -C contrib/pzstd $@ > $(VOID)
- 	@$(MAKE) -C contrib/seekable_format/examples $@ > $(VOID)
- 	@$(MAKE) -C contrib/largeNbDicts $@ > $(VOID)
- 	@$(RM) zstd$(EXT) zstdmt$(EXT) tmp*
- 	@$(RM) -r lz4
++	$(Q)$(MAKE) -C $(ZSTDDIR) $@ > $(VOID)
++	$(Q)$(MAKE) -C $(PRGDIR) $@ > $(VOID)
++	$(Q)$(MAKE) -C $(TESTDIR) $@ > $(VOID)
++	$(Q)$(MAKE) -C $(ZWRAPDIR) $@ > $(VOID)
++	$(Q)$(MAKE) -C examples/ $@ > $(VOID)
++	$(Q)$(MAKE) -C contrib/gen_html $@ > $(VOID)
++	$(Q)$(MAKE) -C contrib/pzstd $@ > $(VOID)
++	$(Q)$(MAKE) -C contrib/seekable_format/examples $@ > $(VOID)
++	$(Q)$(MAKE) -C contrib/seekable_format/tests $@ > $(VOID)
++	$(Q)$(MAKE) -C contrib/largeNbDicts $@ > $(VOID)
++	$(Q)$(RM) zstd$(EXT) zstdmt$(EXT) tmp*
++	$(Q)$(RM) -r lz4
 +	@echo Cleaning completed
 +
 +#------------------------------------------------------------------------------
 +# make install is validated only for Linux, macOS, Hurd and some BSD targets
 +#------------------------------------------------------------------------------
 +ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD DragonFly NetBSD MSYS_NT Haiku))
 +
 +HOST_OS = POSIX
 +CMAKE_PARAMS = -DZSTD_BUILD_CONTRIB:BOOL=ON -DZSTD_BUILD_STATIC:BOOL=ON -DZSTD_BUILD_TESTS:BOOL=ON -DZSTD_ZLIB_SUPPORT:BOOL=ON -DZSTD_LZMA_SUPPORT:BOOL=ON -DCMAKE_BUILD_TYPE=Release
 +
 +HAVE_COLORNEVER = $(shell echo a | egrep --color=never a > /dev/null 2> /dev/null && echo 1 || echo 0)
 +EGREP_OPTIONS ?=
 +ifeq ($HAVE_COLORNEVER, 1)
 +EGREP_OPTIONS += --color=never
 +endif
 +EGREP = egrep $(EGREP_OPTIONS)
 +
 +# Print a two column output of targets and their description. To add a target description, put a
 +# comment in the Makefile with the format "## <TARGET>: <DESCRIPTION>".  For example:
 +#
 +## list: Print all targets and their descriptions (if provided)
 +.PHONY: list
 +list:
- 	@TARGETS=$$($(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null \
++	$(Q)TARGETS=$$($(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null \
 +		| awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' \
 +		| $(EGREP) -v  -e '^[^[:alnum:]]' | sort); \
 +	{ \
 +	    printf "Target Name\tDescription\n"; \
 +	    printf "%0.s-" {1..16}; printf "\t"; printf "%0.s-" {1..40}; printf "\n"; \
 +	    for target in $$TARGETS; do \
 +	        line=$$($(EGREP) "^##[[:space:]]+$$target:" $(lastword $(MAKEFILE_LIST))); \
 +	        description=$$(echo $$line | awk '{i=index($$0,":"); print substr($$0,i+1)}' | xargs); \
 +	        printf "$$target\t$$description\n"; \
 +	    done \
 +	} | column -t -s $$'\t'
 +
 +.PHONY: install armtest usan asan uasan
 +install:
- 	@$(MAKE) -C $(ZSTDDIR) $@
- 	@$(MAKE) -C $(PRGDIR) $@
++	$(Q)$(MAKE) -C $(ZSTDDIR) $@
++	$(Q)$(MAKE) -C $(PRGDIR) $@
 +
 +.PHONY: uninstall
 +uninstall:
- 	@$(MAKE) -C $(ZSTDDIR) $@
- 	@$(MAKE) -C $(PRGDIR) $@
++	$(Q)$(MAKE) -C $(ZSTDDIR) $@
++	$(Q)$(MAKE) -C $(PRGDIR) $@
 +
 +.PHONY: travis-install
 +travis-install:
 +	$(MAKE) install PREFIX=~/install_test_dir
 +
 +.PHONY: gcc5build
 +gcc5build: clean
 +	gcc-5 -v
 +	CC=gcc-5 $(MAKE) all MOREFLAGS="-Werror"
 +
 +.PHONY: gcc6build
 +gcc6build: clean
 +	gcc-6 -v
 +	CC=gcc-6 $(MAKE) all MOREFLAGS="-Werror"
 +
 +.PHONY: gcc7build
 +gcc7build: clean
 +	gcc-7 -v
 +	CC=gcc-7 $(MAKE) all MOREFLAGS="-Werror"
 +
 +.PHONY: clangbuild
 +clangbuild: clean
 +	clang -v
 +	CXX=clang++ CC=clang CFLAGS="-Werror -Wconversion -Wno-sign-conversion -Wdocumentation" $(MAKE) all
 +
 +m32build: clean
 +	gcc -v
 +	$(MAKE) all32
 +
 +armbuild: clean
 +	CC=arm-linux-gnueabi-gcc CFLAGS="-Werror" $(MAKE) allzstd
 +
 +aarch64build: clean
 +	CC=aarch64-linux-gnu-gcc CFLAGS="-Werror" $(MAKE) allzstd
 +
 +ppcbuild: clean
 +	CC=powerpc-linux-gnu-gcc CFLAGS="-m32 -Wno-attributes -Werror" $(MAKE) allzstd
 +
 +ppc64build: clean
 +	CC=powerpc-linux-gnu-gcc CFLAGS="-m64 -Werror" $(MAKE) allzstd
 +
 +armfuzz: clean
 +	CC=arm-linux-gnueabi-gcc QEMU_SYS=qemu-arm-static MOREFLAGS="-static" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) fuzztest
 +
 +aarch64fuzz: clean
 +	ld -v
 +	CC=aarch64-linux-gnu-gcc QEMU_SYS=qemu-aarch64-static MOREFLAGS="-static" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) fuzztest
 +
 +ppcfuzz: clean
 +	CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc-static MOREFLAGS="-static" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) fuzztest
 +
 +ppc64fuzz: clean
 +	CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc64-static MOREFLAGS="-m64 -static" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) fuzztest
 +
 +.PHONY: cxxtest
 +cxxtest: CXXFLAGS += -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror
 +cxxtest: clean
 +	$(MAKE) -C $(PRGDIR) all CC="$(CXX) -Wno-deprecated" CFLAGS="$(CXXFLAGS)"   # adding -Wno-deprecated to avoid clang++ warning on dealing with C files directly
 +
 +gcc5test: clean
 +	gcc-5 -v
 +	$(MAKE) all CC=gcc-5 MOREFLAGS="-Werror"
 +
 +gcc6test: clean
 +	gcc-6 -v
 +	$(MAKE) all CC=gcc-6 MOREFLAGS="-Werror"
 +
 +armtest: clean
 +	$(MAKE) -C $(TESTDIR) datagen   # use native, faster
 +	$(MAKE) -C $(TESTDIR) test CC=arm-linux-gnueabi-gcc QEMU_SYS=qemu-arm-static ZSTDRTTEST= MOREFLAGS="-Werror -static" FUZZER_FLAGS=--no-big-tests
 +
 +aarch64test:
 +	$(MAKE) -C $(TESTDIR) datagen   # use native, faster
 +	$(MAKE) -C $(TESTDIR) test CC=aarch64-linux-gnu-gcc QEMU_SYS=qemu-aarch64-static ZSTDRTTEST= MOREFLAGS="-Werror -static" FUZZER_FLAGS=--no-big-tests
 +
 +ppctest: clean
 +	$(MAKE) -C $(TESTDIR) datagen   # use native, faster
 +	$(MAKE) -C $(TESTDIR) test CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc-static ZSTDRTTEST= MOREFLAGS="-Werror -Wno-attributes -static" FUZZER_FLAGS=--no-big-tests
 +
 +ppc64test: clean
 +	$(MAKE) -C $(TESTDIR) datagen   # use native, faster
 +	$(MAKE) -C $(TESTDIR) test CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc64-static ZSTDRTTEST= MOREFLAGS="-m64 -static" FUZZER_FLAGS=--no-big-tests
 +
 +arm-ppc-compilation:
 +	$(MAKE) -C $(PRGDIR) clean zstd CC=arm-linux-gnueabi-gcc QEMU_SYS=qemu-arm-static ZSTDRTTEST= MOREFLAGS="-Werror -static"
 +	$(MAKE) -C $(PRGDIR) clean zstd CC=aarch64-linux-gnu-gcc QEMU_SYS=qemu-aarch64-static ZSTDRTTEST= MOREFLAGS="-Werror -static"
 +	$(MAKE) -C $(PRGDIR) clean zstd CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc-static ZSTDRTTEST= MOREFLAGS="-Werror -Wno-attributes -static"
 +	$(MAKE) -C $(PRGDIR) clean zstd CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc64-static ZSTDRTTEST= MOREFLAGS="-m64 -static"
 +
 +regressiontest:
 +	$(MAKE) -C $(FUZZDIR) regressiontest
 +
 +uasanregressiontest:
 +	$(MAKE) -C $(FUZZDIR) regressiontest CC=clang CXX=clang++ CFLAGS="-O3 -fsanitize=address,undefined" CXXFLAGS="-O3 -fsanitize=address,undefined"
 +
 +msanregressiontest:
 +	$(MAKE) -C $(FUZZDIR) regressiontest CC=clang CXX=clang++ CFLAGS="-O3 -fsanitize=memory" CXXFLAGS="-O3 -fsanitize=memory"
 +
 +# run UBsan with -fsanitize-recover=signed-integer-overflow
 +# due to a bug in UBsan when doing pointer subtraction
 +# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63303
 +
 +usan: clean
 +	$(MAKE) test CC=clang MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize-recover=signed-integer-overflow -fsanitize=undefined -Werror"
 +
 +asan: clean
 +	$(MAKE) test CC=clang MOREFLAGS="-g -fsanitize=address -Werror"
 +
 +asan-%: clean
 +	LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=address -Werror" $(MAKE) -C $(TESTDIR) $*
 +
 +msan: clean
 +	$(MAKE) test CC=clang MOREFLAGS="-g -fsanitize=memory -fno-omit-frame-pointer -Werror" HAVE_LZMA=0   # datagen.c fails this test for no obvious reason
 +
 +msan-%: clean
 +	LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=memory -fno-omit-frame-pointer -Werror" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) HAVE_LZMA=0 $*
 +
 +asan32: clean
 +	$(MAKE) -C $(TESTDIR) test32 CC=clang MOREFLAGS="-g -fsanitize=address"
 +
 +uasan: clean
 +	$(MAKE) test CC=clang MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize-recover=signed-integer-overflow -fsanitize=address,undefined -Werror"
 +
 +uasan-%: clean
 +	LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize-recover=signed-integer-overflow -fsanitize=address,undefined -Werror" $(MAKE) -C $(TESTDIR) $*
 +
 +tsan-%: clean
 +	LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=thread -Werror" $(MAKE) -C $(TESTDIR) $* FUZZER_FLAGS=--no-big-tests
 +
 +apt-install:
 +	sudo apt-get -yq --no-install-suggests --no-install-recommends --force-yes install $(APT_PACKAGES)
 +
 +apt-add-repo:
 +	sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
 +	sudo apt-get update -y -qq
 +
 +ppcinstall:
 +	APT_PACKAGES="qemu-system-ppc qemu-user-static gcc-powerpc-linux-gnu" $(MAKE) apt-install
 +
 +arminstall:
 +	APT_PACKAGES="qemu-system-arm qemu-user-static gcc-arm-linux-gnueabi libc6-dev-armel-cross gcc-aarch64-linux-gnu libc6-dev-arm64-cross" $(MAKE) apt-install
 +
 +valgrindinstall:
 +	APT_PACKAGES="valgrind" $(MAKE) apt-install
 +
 +libc6install:
 +	APT_PACKAGES="libc6-dev-i386 gcc-multilib" $(MAKE) apt-install
 +
 +gcc6install: apt-add-repo
 +	APT_PACKAGES="libc6-dev-i386 gcc-multilib gcc-6 gcc-6-multilib" $(MAKE) apt-install
 +
 +gcc7install: apt-add-repo
 +	APT_PACKAGES="libc6-dev-i386 gcc-multilib gcc-7 gcc-7-multilib" $(MAKE) apt-install
 +
 +gcc8install: apt-add-repo
 +	APT_PACKAGES="libc6-dev-i386 gcc-multilib gcc-8 gcc-8-multilib" $(MAKE) apt-install
 +
 +gpp6install: apt-add-repo
 +	APT_PACKAGES="libc6-dev-i386 g++-multilib gcc-6 g++-6 g++-6-multilib" $(MAKE) apt-install
 +
 +clang38install:
 +	APT_PACKAGES="clang-3.8" $(MAKE) apt-install
 +
 +# Ubuntu 14.04 ships a too-old lz4
 +lz4install:
 +	[ -e lz4 ] || git clone https://github.com/lz4/lz4 && sudo $(MAKE) -C lz4 install
 +
 +endif
 +
 +
 +ifneq (,$(filter MSYS%,$(shell uname)))
 +HOST_OS = MSYS
 +CMAKE_PARAMS = -G"MSYS Makefiles" -DCMAKE_BUILD_TYPE=Debug -DZSTD_MULTITHREAD_SUPPORT:BOOL=OFF -DZSTD_BUILD_STATIC:BOOL=ON -DZSTD_BUILD_TESTS:BOOL=ON
 +endif
 +
 +
 +#------------------------------------------------------------------------
 +# target specific tests
 +#------------------------------------------------------------------------
 +ifneq (,$(filter $(HOST_OS),MSYS POSIX))
 +cmakebuild:
 +	cmake --version
 +	$(RM) -r $(BUILDIR)/cmake/build
 +	mkdir $(BUILDIR)/cmake/build
 +	cd $(BUILDIR)/cmake/build; cmake -DCMAKE_INSTALL_PREFIX:PATH=~/install_test_dir $(CMAKE_PARAMS) ..
 +	$(MAKE) -C $(BUILDIR)/cmake/build -j4;
 +	$(MAKE) -C $(BUILDIR)/cmake/build install;
 +	$(MAKE) -C $(BUILDIR)/cmake/build uninstall;
 +	cd $(BUILDIR)/cmake/build; ctest -V -L Medium
 +
 +c89build: clean
 +	$(CC) -v
 +	CFLAGS="-std=c89 -Werror" $(MAKE) allmost  # will fail, due to missing support for `long long`
 +
 +gnu90build: clean
 +	$(CC) -v
 +	CFLAGS="-std=gnu90 -Werror" $(MAKE) allmost
 +
 +c99build: clean
 +	$(CC) -v
 +	CFLAGS="-std=c99 -Werror" $(MAKE) allmost
 +
 +gnu99build: clean
 +	$(CC) -v
 +	CFLAGS="-std=gnu99 -Werror" $(MAKE) allmost
 +
 +c11build: clean
 +	$(CC) -v
 +	CFLAGS="-std=c11 -Werror" $(MAKE) allmost
 +
 +bmix64build: clean
 +	$(CC) -v
 +	CFLAGS="-O3 -mbmi -Werror" $(MAKE) -C $(TESTDIR) test
 +
 +bmix32build: clean
 +	$(CC) -v
 +	CFLAGS="-O3 -mbmi -mx32 -Werror" $(MAKE) -C $(TESTDIR) test
 +
 +bmi32build: clean
 +	$(CC) -v
 +	CFLAGS="-O3 -mbmi -m32 -Werror" $(MAKE) -C $(TESTDIR) test
 +
 +# static analyzer test uses clang's scan-build
 +# does not analyze zlibWrapper, due to detected issues in zlib source code
 +staticAnalyze: SCANBUILD ?= scan-build
 +staticAnalyze:
 +	$(CC) -v
 +	CC=$(CC) CPPFLAGS=-g $(SCANBUILD) --status-bugs -v $(MAKE) allzstd examples contrib
 +endif
diff --cc sys/contrib/zstd/README.md
index 5c300fdc49aa,000000000000..dcca7662d2ff
mode 100644,000000..100644
--- a/sys/contrib/zstd/README.md
+++ b/sys/contrib/zstd/README.md
@@@ -1,193 -1,0 +1,199 @@@
 +<p align="center"><img src="https://raw.githubusercontent.com/facebook/zstd/dev/doc/images/zstd_logo86.png" alt="Zstandard"></p>
 +
 +__Zstandard__, or `zstd` as short version, is a fast lossless compression algorithm,
 +targeting real-time compression scenarios at zlib-level and better compression ratios.
 +It's backed by a very fast entropy stage, provided by [Huff0 and FSE library](https://github.com/Cyan4973/FiniteStateEntropy).
 +
 +The project is provided as an open-source dual [BSD](LICENSE) and [GPLv2](COPYING) licensed **C** library,
 +and a command line utility producing and decoding `.zst`, `.gz`, `.xz` and `.lz4` files.
 +Should your project require another programming language,
 +a list of known ports and bindings is provided on [Zstandard homepage](http://www.zstd.net/#other-languages).
 +
 +**Development branch status:**
 +
 +[![Build Status][travisDevBadge]][travisLink]
 +[![Build status][AppveyorDevBadge]][AppveyorLink]
 +[![Build status][CircleDevBadge]][CircleLink]
 +[![Build status][CirrusDevBadge]][CirrusLink]
 +[![Fuzzing Status][OSSFuzzBadge]][OSSFuzzLink]
 +
 +[travisDevBadge]: https://travis-ci.org/facebook/zstd.svg?branch=dev "Continuous Integration test suite"
 +[travisLink]: https://travis-ci.org/facebook/zstd
 +[AppveyorDevBadge]: https://ci.appveyor.com/api/projects/status/xt38wbdxjk5mrbem/branch/dev?svg=true "Windows test suite"
 +[AppveyorLink]: https://ci.appveyor.com/project/YannCollet/zstd-p0yf0
 +[CircleDevBadge]: https://circleci.com/gh/facebook/zstd/tree/dev.svg?style=shield "Short test suite"
 +[CircleLink]: https://circleci.com/gh/facebook/zstd
 +[CirrusDevBadge]: https://api.cirrus-ci.com/github/facebook/zstd.svg?branch=dev
 +[CirrusLink]: https://cirrus-ci.com/github/facebook/zstd
 +[OSSFuzzBadge]: https://oss-fuzz-build-logs.storage.googleapis.com/badges/zstd.svg
 +[OSSFuzzLink]: https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:zstd
 +
 +## Benchmarks
 +
 +For reference, several fast compression algorithms were tested and compared
 +on a server running Arch Linux (`Linux version 5.5.11-arch1-1`),
 +with a Core i9-9900K CPU @ 5.0GHz,
*** 2020 LINES SKIPPED ***



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202012251556.0BPFu9l7029902>