From nobody Sun Jul 24 22:55:49 2022 X-Original-To: dev-commits-src-main@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 4LrdnL1mHQz3yvWw; Sun, 24 Jul 2022 22:55:50 +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 4LrdnK5LXqz422D; Sun, 24 Jul 2022 22:55:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658703349; 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=3bnHec+YKpH2Uj5zu5Pa+bLQ3l+IwOcorINACpy+h0A=; b=Lfea5A/qf/f5lAafVcfCPY0SodzcKIKXHKzNuzBn0EjKGjYJUVr27riIQ0OZkYW+11UHvQ VW7fGprkrpR8jZBdJeWetv7NtX4oA5G+qzXndEWv5kVUjxGcZGaWFgfSHjJFirJlIZNsil PIowMB630CNlbMbHPgYN2eWXs7j6sgNWnJSStVB3YWHluPLWrOMIZM5cCER9EDqNr1UWb7 lmghTb8ddPATVReF3W3B1uUbZ/Cyu9RAv4a/n271i/iUG3Tlrr1ogzYXQqmRR1El6GaLiS 6WUhrKGj11aZw6Wm2doca1UJ+0YSHTiqHNcRsV8eA/S6dKPGoytSmb1O/7e6og== 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 4LrdnK4R48zblD; Sun, 24 Jul 2022 22:55:49 +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 26OMtn6f004728; Sun, 24 Jul 2022 22:55:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26OMtnso004727; Sun, 24 Jul 2022 22:55:49 GMT (envelope-from git) Date: Sun, 24 Jul 2022 22:55:49 GMT Message-Id: <202207242255.26OMtnso004727@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 1306a5dc0747 - main - stand/libsa: zfs use standard ZFS_EARLY stuff List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1306a5dc0747fa2b9ecc7ba2429ef4a3b9f6dcd0 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658703349; 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=3bnHec+YKpH2Uj5zu5Pa+bLQ3l+IwOcorINACpy+h0A=; b=ugliF/FfMf69mtfqID2dri0YkFsTJMnBzgr4UJe0FPD3Q6ZbKw9cZ7wdAJlNUYBBhgTNED ynwDUQ8n2bHs4Gs/jHA32ercQITQp6mV++t1g2d5clupwB0XBupcTPJ0ZL9BuQ6vBmH6rm F0C5qMO24/Mo7w+vq0+asA24NVRahsbZDYj8yR5vjnK6ERP9CSK6dCJzkoKeHs8CrBFBKB mzawgzS90p8Ebjaf1fF7WVL/zSKbGNC++pRtfo3DvTWaZVhJXzw8jOlq8rfFx/CacknEEw gcm6z8rJ8o2Dw/E3DTIdm61xYj5iFX6mVysaMzOiNsdZdNPyeWBrp4yQI9FBSg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1658703349; a=rsa-sha256; cv=none; b=B88b/LEZBKXs5vpO52A+DkwLe1VYHmr9YUPFREBpBcydCBzoaAqMIydw9AV8zhcOu/cl/c VoseQ31ngCi27QxmlRBfnKwFfjL3wFndCQfykoepZRFMEdrgGm9+ZVu/acmSVe3Pypv8uP UEX+MDxwtNmrcathI7gppTJlbYXxns/gMFHaRPVzprN2AjgkQSEBcPMia0EkdmUU4lzCkw ReW8Ls0l21++YCSYigVpzp11BQ9ndpdXp5dcAPV6GRjl3CcDu+pZJKvf1qbrs76Vn2aw7U 65BBpMtqUzR+Eh2mcJlKY2XhprPK99Sq9kXeFWruojd1buJA9Aff5+Nyf/xhDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=1306a5dc0747fa2b9ecc7ba2429ef4a3b9f6dcd0 commit 1306a5dc0747fa2b9ecc7ba2429ef4a3b9f6dcd0 Author: Warner Losh AuthorDate: 2022-07-24 21:53:56 +0000 Commit: Warner Losh CommitDate: 2022-07-24 22:53:36 +0000 stand/libsa: zfs use standard ZFS_EARLY stuff Now that the minor issues preventing zfs.c from using CFLAGS_EARLY have been fixed, use that mechanism like everything else that needs the OpenZFS spl headers. This simplifies things somewhat. Update comments to document why zfs.c is still special, though in different ways. Note: We also use the fact that NEED_SOLARIS_BOOLEAN is only defined in an environment where the solaris compat boolean stuff will be defined prior to this point (eg, when we're building zfs.c in libsa), but not in other environments (like when we're building mkimage and stand-alone boot loaders that don't use libsa). These latter uses should be changed to use the same ZFS compile env, but aren't as part of this commit. This has to be done in the same change as the ZFS_EARLY change to not break zfs.c building for one commit affecting bisectabiltiy. Sponsored by: Netflix Reviewed by: tsoome, delphij Differential Revision: https://reviews.freebsd.org/D35894 --- stand/libsa/zfs/Makefile.inc | 15 ++++++++------- sys/cddl/boot/zfs/zfsimpl.h | 2 ++ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/stand/libsa/zfs/Makefile.inc b/stand/libsa/zfs/Makefile.inc index 15a4c8bf3018..d91d83e8bdba 100644 --- a/stand/libsa/zfs/Makefile.inc +++ b/stand/libsa/zfs/Makefile.inc @@ -54,18 +54,19 @@ CFLAGS_EARLY.blake3_impl_hack.c+= ${ZFS_EARLY} CFLAGS_EARLY.list.c+= ${ZFS_EARLY} CFLAGS_EARLY.zfs_zstd.c+= ${ZFS_EARLY} CFLAGS_EARLY.nvlist.c+= ${ZFS_EARLY} +CFLAGS_EARLY.zfs.c += ${ZFS_EARLY} -# Can't use the early flags because there's two conflicting definitions of boolean_t in -# the zfs code that need to be unified, as well as a number of other hacks for pre-openzfs -# code still in the tree that needs to be fixed. +# +# zfs.c is special: we need to define HAS_ZSTD_ZFS to get zfssubr.c to initialize zstd +# properly. We need to have the cddl boot compat directory in the include path for zfssubr.c +# to be found, and we need a couple of other include paths for skein and lz4. Finally we +# temporarily need LDRSRC to pick up disk.h until that layering violation is corrected. +# CFLAGS.zfs.c+= -DHAS_ZSTD_ZFS \ -I${SYSDIR}/cddl/boot/zfs \ -I${LDRSRC} \ -I${SYSDIR}/crypto/skein \ - -I${ZFSOSINC}/spl \ - -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/lz4 \ - -I${ZFSOSINC}/zfs \ - -I${OZFS}/include + -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/lz4 # # ZSTD coding style has some issues, so suppress clang's warnings. Also, zstd's diff --git a/sys/cddl/boot/zfs/zfsimpl.h b/sys/cddl/boot/zfs/zfsimpl.h index d6e8900f6a97..843565607a49 100644 --- a/sys/cddl/boot/zfs/zfsimpl.h +++ b/sys/cddl/boot/zfs/zfsimpl.h @@ -76,7 +76,9 @@ #define AVL_PCMP(a, b) \ (((uintptr_t)(a) > (uintptr_t)(b)) - ((uintptr_t)(a) < (uintptr_t)(b))) +#if !defined(NEED_SOLARIS_BOOLEAN) /* Only defined when we'll define this elsewhere */ typedef enum { B_FALSE, B_TRUE } boolean_t; +#endif /* CRC64 table */ #define ZFS_CRC64_POLY 0xC96C5795D7870F42ULL /* ECMA-182, reflected form */