From owner-dev-commits-src-main@freebsd.org Sun Dec 27 23:03:40 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6CF8E4CA5E6; Sun, 27 Dec 2020 23:03:40 +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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3x7J2jrvz3rtN; Sun, 27 Dec 2020 23:03:40 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 503137270; Sun, 27 Dec 2020 23:03:40 +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 0BRN3erX008681; Sun, 27 Dec 2020 23:03:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BRN3ekD008680; Sun, 27 Dec 2020 23:03:40 GMT (envelope-from git) Date: Sun, 27 Dec 2020 23:03:40 GMT Message-Id: <202012272303.0BRN3ekD008680@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Libby Subject: git: e67d933d9c06 - main - Merge commit 3fcd73747 from openzfs git (by Adrian Chadd): MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rlibby X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e67d933d9c068328781cce46df400fc8782e6365 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 23:03:40 -0000 The branch main has been updated by rlibby: URL: https://cgit.FreeBSD.org/src/commit/?id=e67d933d9c068328781cce46df400fc8782e6365 commit e67d933d9c068328781cce46df400fc8782e6365 Author: Ryan Libby AuthorDate: 2020-12-27 22:33:13 +0000 Commit: Ryan Libby CommitDate: 2020-12-27 22:33:13 +0000 Merge commit 3fcd73747 from openzfs git (by Adrian Chadd): Fix compiling on FreeBSD + gcc - don't assume illmnos bits This looks like it was once from the illumnos compat code. FreeBSD doesn't have cmn_err as a compiler format attribute, so it definitely errors out. It doesn't show up on LLVM because it doesn't trigger at all. Add in the format flags but keep them behind #if 0 for now; there are too many format issues that trigger when one does format checking in the shared code. Reviewed-by: Brian Behlendorf Reviewed-by: Ryan Moeller Signed-off-by: adrian chadd Closes #11068 Closes #11069 --- .../openzfs/include/os/freebsd/spl/sys/ccompile.h | 32 ++++++++++++++-------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h b/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h index cf1e0a8a6376..a02e8f098540 100644 --- a/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h +++ b/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h @@ -48,6 +48,7 @@ extern "C" { #if defined(__ATTRIBUTE_IMPLEMENTED) || defined(__GNUC__) +#if 0 /* * analogous to lint's PRINTFLIKEn */ @@ -56,20 +57,28 @@ extern "C" { #define __sun_attr___VPRINTFLIKE__(__n) \ __attribute__((__format__(printf, __n, 0))) -/* - * Handle the kernel printf routines that can take '%b' too - */ -#if __GNUC_VERSION < 30402 -/* - * XX64 at least this doesn't work correctly yet with 3.4.1 anyway! - */ #define __sun_attr___KPRINTFLIKE__ __sun_attr___PRINTFLIKE__ #define __sun_attr___KVPRINTFLIKE__ __sun_attr___VPRINTFLIKE__ #else -#define __sun_attr___KPRINTFLIKE__(__n) \ - __attribute__((__format__(cmn_err, __n, (__n)+1))) -#define __sun_attr___KVPRINTFLIKE__(__n) \ - __attribute__((__format__(cmn_err, __n, 0))) +/* + * Currently the openzfs codebase has a lot of formatting errors + * which are not picked up in the linux build because they're not + * doing formatting checks. LLVM's kprintf implementation doesn't + * actually do format checks! + * + * For FreeBSD these break under gcc! LLVM shim'ed cmn_err as a + * format attribute but also didn't check anything. If one + * replaces it with the above, all of the format issues + * in the codebase show up. + * + * Once those format string issues are addressed, the above + * should be flipped on once again. + */ +#define __sun_attr___PRINTFLIKE__(__n) +#define __sun_attr___VPRINTFLIKE__(__n) +#define __sun_attr___KPRINTFLIKE__(__n) +#define __sun_attr___KVPRINTFLIKE__(__n) + #endif /* @@ -77,7 +86,6 @@ extern "C" { */ #define __sun_attr___noreturn__ __attribute__((__noreturn__)) - /* * This is an appropriate label for functions that do not * modify their arguments, e.g. strlen()