From nobody Fri Feb 11 16:51:38 2022 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C8C0719B1A93; Fri, 11 Feb 2022 16:51:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JwKQL4DKzz4WGG; Fri, 11 Feb 2022 16:51:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644598298; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hfzch3GmpzRjFEdnWu9WRLcnGDNaCS4n/iKkfwkWEEg=; b=hq9HvcxgaHCvDFNMUlXqCmsJ+y656zKFk7F2mXPmzmMHKj1A4IxNAe8QRt/jc3nEWUlJo3 eU0IxlrL+LzID+noeOKCrbK237zsPrdK+myqWa97IA0GdYoOQS69qHZYauSwdPkr+XuNF0 3zInlNAyQh3BciT5R4BWZPEYgXxtZmhoT0FUpt81qZK4eHcS7DmmjHOVfMZJHRUBxLxMkW e19OCHctk+XbisGQ1HpzRrzuawHbDD6S+hg5G9+Tt3xpc88ZPh3VyKUcfMARgtUt+Sgo7i IhfDo+/8NAkHqAHBwfXJjaz+i59sy1cwhtc02B8cstEmb75u0yKEnRPwURf1uw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6F65917C5A; Fri, 11 Feb 2022 16:51:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 21BGpclQ032603; Fri, 11 Feb 2022 16:51:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21BGpc3d032602; Fri, 11 Feb 2022 16:51:38 GMT (envelope-from git) Date: Fri, 11 Feb 2022 16:51:38 GMT Message-Id: <202202111651.21BGpc3d032602@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 284434f7a6fc - stable/13 - Disable clang 14 warning about bitwise operators in zstd List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 284434f7a6fcae8f2a151862aeb9be3bb668ca87 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644598298; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hfzch3GmpzRjFEdnWu9WRLcnGDNaCS4n/iKkfwkWEEg=; b=kH7vKINF0ewBfnXPme9d/vGT2ce5eSgcbSAX6bu7uBGp9Zy4parR3uSmSyuLXQ+oYy5eAQ T8HJLbgTXEbsXb16FkIeY75dUmAAx1SJh51w8pn5/5vJY6DME130gtdUrXOs6MCJfAIVEL 9kDyAN5pZXbpdg2IpRfILXx9HSGS//XyAUv3+u7UC/SrtwbBMnm8V0td27JeahWGR5yBTO rJsTdyWBU+sXXbLviGb9YECCiZ7X1/6+A4VRyRx3bu1o4Lt52ItxjKGcLV+D+ho2zx5Ifs LYAxfyNZrr38RvFvWkNdhce4XAGgm6rzOlu5o/v/aAv4ktQfKEl909jDuxSFfw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1644598298; a=rsa-sha256; cv=none; b=ctJK0PaCZ7qg9+RHsEEtm0P/PNJ5mgQqosB5JNNh4vsZhx/Esw0UNv5oDdCx1YLS2mcGh6 vSYpa3PTwWc6M6PqJts9ThXrrBtVGU9ZCMP+IJQb5MXrd/xlqDK0gd9TgVXFyPKArhF8YZ r1REMbBTElkYFLVhVt5P6DFootP88O9TBgF4IOvqCJJ3jmP1YKhK9AsUjcFf8+pGxBDGi5 legkqP7eDmp7GtWZR8oxEraa5dAvCPuyKg0VxPIome72iL/K872bIMmX/iV7QMWSvG0/iw HIFUqY1FgWHWKzbTpKWBYvDWtQ6weN2vneLwtKktjUHBhDk31lpIkoi0QxobaQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=284434f7a6fcae8f2a151862aeb9be3bb668ca87 commit 284434f7a6fcae8f2a151862aeb9be3bb668ca87 Author: Dimitry Andric AuthorDate: 2022-02-08 20:46:03 +0000 Commit: Dimitry Andric CommitDate: 2022-02-11 16:42:30 +0000 Disable clang 14 warning about bitwise operators in zstd Parts of zstd, used in openzfs and other places, trigger a new clang 14 -Werror warning: ``` sys/contrib/zstd/lib/decompress/huf_decompress.c:889:25: error: use of bitwise '&' with boolean operands [-Werror,-Wbitwise-instead-of-logical] (BIT_reloadDStreamFast(&bitD1) == BIT_DStream_unfinished) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` While the warning is benign, it should ideally be fixed upstream and then vendor-imported, but for now silence it selectively. MFC after: 3 days (cherry picked from commit 5f2aca83940097d7d23b4137073fb601f8e74232) --- cddl/lib/libzpool/Makefile | 1 + lib/libzstd/Makefile | 2 ++ share/mk/bsd.sys.mk | 3 +++ sys/conf/files | 2 +- sys/conf/kern.mk | 3 +++ sys/modules/zfs/Makefile | 1 + 6 files changed, 11 insertions(+), 1 deletion(-) diff --git a/cddl/lib/libzpool/Makefile b/cddl/lib/libzpool/Makefile index 6893e31ff20a..0e5d24bd0ec5 100644 --- a/cddl/lib/libzpool/Makefile +++ b/cddl/lib/libzpool/Makefile @@ -263,5 +263,6 @@ CFLAGS+= -g -DDEBUG=1 CFLAGS.zfs_zstd.c= -Wno-cast-qual -Wno-pointer-arith CFLAGS.zstd.c+= -fno-tree-vectorize +CFLAGS.zstd.c+= ${NO_WBITWISE_INSTEAD_OF_LOGICAL} .include diff --git a/lib/libzstd/Makefile b/lib/libzstd/Makefile index 5f7cd8248d88..e4f034f288a2 100644 --- a/lib/libzstd/Makefile +++ b/lib/libzstd/Makefile @@ -49,6 +49,8 @@ ZSTDDIR= ${SRCTOP}/sys/contrib/zstd .include +CFLAGS.huf_decompress.c+= ${NO_WBITWISE_INSTEAD_OF_LOGICAL} + # 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 diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index 745382a32bc9..3bbe7aa849b4 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -111,6 +111,9 @@ CWARNFLAGS.clang+= -Wno-array-bounds ${COMPILER_TYPE} == "gcc") CWARNFLAGS+= -Wno-misleading-indentation .endif # NO_WMISLEADING_INDENTATION +.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 140000 +NO_WBITWISE_INSTEAD_OF_LOGICAL= -Wno-bitwise-instead-of-logical +.endif .endif # WARNS .if defined(FORMAT_AUDIT) diff --git a/sys/conf/files b/sys/conf/files index 9b0342287b22..ce212c83a5e1 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -726,7 +726,7 @@ contrib/zstd/lib/decompress/zstd_decompress.c optional zstdio compile-with ${ZST # See comment in sys/conf/kern.pre.mk contrib/zstd/lib/decompress/zstd_decompress_block.c optional zstdio \ compile-with "${ZSTD_C} ${ZSTD_DECOMPRESS_BLOCK_FLAGS}" -contrib/zstd/lib/decompress/huf_decompress.c optional zstdio compile-with ${ZSTD_C} +contrib/zstd/lib/decompress/huf_decompress.c optional zstdio compile-with "${ZSTD_C} ${NO_WBITWISE_INSTEAD_OF_LOGICAL}" # Blake 2 contrib/libb2/blake2b-ref.c optional crypto | ipsec | ipsec_support | !random_loadable random_fenestrasx \ compile-with "${NORMAL_C} -I$S/crypto/blake2 -Wno-cast-qual -DSUFFIX=_ref -Wno-unused-function" diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index f6767ba76a46..476997bfa01f 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -28,6 +28,9 @@ NO_WTAUTOLOGICAL_POINTER_COMPARE= -Wno-tautological-pointer-compare .if ${COMPILER_VERSION} >= 100000 NO_WMISLEADING_INDENTATION= -Wno-misleading-indentation .endif +.if ${COMPILER_VERSION} >= 140000 +NO_WBITWISE_INSTEAD_OF_LOGICAL= -Wno-bitwise-instead-of-logical +.endif # Several other warnings which might be useful in some cases, but not severe # enough to error out the whole kernel build. Display them anyway, so there is # some incentive to fix them eventually. diff --git a/sys/modules/zfs/Makefile b/sys/modules/zfs/Makefile index d185fdf259a5..81f3202975b8 100644 --- a/sys/modules/zfs/Makefile +++ b/sys/modules/zfs/Makefile @@ -339,3 +339,4 @@ CFLAGS.zstd.c= -U__BMI__ -fno-tree-vectorize .if ${MACHINE_CPUARCH} == "aarch64" CFLAGS.zstd.c+= -include ${SRCDIR}/zstd/include/aarch64_compat.h .endif +CFLAGS.zstd.c+= ${NO_WBITWISE_INSTEAD_OF_LOGICAL}