From nobody Sat Jul 09 05:03:29 2022 X-Original-To: dev-commits-src-all@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 E21683E5A85; Sat, 9 Jul 2022 05:03:29 +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 4Lfyhx22rbz3Mj5; Sat, 9 Jul 2022 05:03:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657343009; 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=Npg+REC4DFkWzHQ+fg38BiWcMcLKOuLDjU8c3GfOdss=; b=AjQfBl9agWTxPSOcdR3o+1d4B6GKbPBK7saLKn36c6SJuFZFVmV/OyV+h6WclV0b9Loix6 /d2FUPD1718/LLkRyO3wUjLLErGryx1KGqrg2GndOXYlLgy95fkH8k/09bfAKMoFdxkwhX 5pwnlG0bCkdkvdYNiUXWbVJ9lpZrfGe4YWzEK6Zh08Zvih6TpK5h8yJYzt+oI3Q2Mt6Ryz /FSpMkqGuMregRIpLh0J+FssPpZMrTuXS9JJ9X1bS021/9Qros3uyCB13lSW1c6sOO8ySf TuOtTczCLlEnIvHR74YeDfb4QR6wL/s/F6cbv1nM+rLgmU28Dhwjq0HsMgRn/w== 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 4Lfyhx18kszZ3y; Sat, 9 Jul 2022 05:03:29 +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 26953Tfi099929; Sat, 9 Jul 2022 05:03:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26953TQU099928; Sat, 9 Jul 2022 05:03:29 GMT (envelope-from git) Date: Sat, 9 Jul 2022 05:03:29 GMT Message-Id: <202207090503.26953TQU099928@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: faf25f48d601 - main - stand: Work around upstream issues in the standalone environment List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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: faf25f48d601ae39f5752602f3020e2e92605625 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657343009; 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=Npg+REC4DFkWzHQ+fg38BiWcMcLKOuLDjU8c3GfOdss=; b=Aor5w7Tg7HYwF715Ut590uByHrrss5wJET5eJTJ9Pf6tZmDrqJbey060C/SjCGTKQKjMQl wbwUQP+EO5ZAuel80qLXs1q/SWnuyKitKp4mH3tUKarHOWYhC1A/IDZ1bmcrdBOuvD9E4e q8JaVRws2r7IGt6Rc+5kvGKQBDp0tJFnIGxgkMwJvwj6lJPQQINFA/pvT9YrJPpYQyoaPD G9KMYAaZBpUxJgauNkptTE2Pj8TkgC7OyOQXwYjcJAqjCGyme2y3hAjcj1ZofRxE54IEda xlc0flNJXJFiOxaaNoVcCz+iDnznz2b5fG3r5qQ+wHv3CQigJLlilbA8LFKFsA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1657343009; a=rsa-sha256; cv=none; b=p6/o/JZ2HXNnN9teocEXkDuOdTyuEZAMeodjbwDTHZI/nFIS4uPoWwY5PmB47nZxvIqRxa z95m3opVtAs4TutTlobWkxFFwlH1Hla2G1L8VkcS2qLEYf7jUhL4BDhR30sTvxGc1c6Y86 gb8tekauk/eslDFa2PkCBMjxgE11EqBrK0QSjtjQ6Qp0ulMkUDWOlGvX2Y0LSNOSJL7pzj HiYxDV4o7K/ySXcImT4Y6UnzXTIlJ1MEBi5hus7ssEZxe49RuSDaGhS82nmYZrxDd73cn6 4oNrm5deCg+etckwtiw2D5fmknBOZe+gRNe1xNHd3lPTwc/+ar8V/9kjvvoVQQ== 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=faf25f48d601ae39f5752602f3020e2e92605625 commit faf25f48d601ae39f5752602f3020e2e92605625 Author: Warner Losh AuthorDate: 2022-07-08 23:34:46 +0000 Commit: Warner Losh CommitDate: 2022-07-09 04:49:55 +0000 stand: Work around upstream issues in the standalone environment There's a number of issues with including zfs_context.h from a standalone environment. First, sys/uio_imp.h isn't at all safe for this environment, so define its guard #defines so that its contents are skipped. Next, there's a problem including string.h to get the mem* routines, so just define them here. ZFS_MODULE_PARAM_ARGS isn't defined properly. I had wanted to define it when I was upstreaming changes to include/os/freebsd/spl/sys/zfs_context.h, but they ran into resistance so I'm defining that here now (it is also defined in zstd_shim.c, but that will disappear once the issues it works around are cleared). Finally, sys/sysmacros.h has to be included now before sys/atomic.h, but upstream includes it after so include it here so that the guards make the out-of-order includes in upstream irrelevant. Sponsored by: Netflix Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D35750 --- stand/libsa/zfs/spl/sys/zfs_context.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/stand/libsa/zfs/spl/sys/zfs_context.h b/stand/libsa/zfs/spl/sys/zfs_context.h new file mode 100644 index 000000000000..48f164317611 --- /dev/null +++ b/stand/libsa/zfs/spl/sys/zfs_context.h @@ -0,0 +1,32 @@ +/* + * Copyright 2022, Netflix, Inc + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#pragma once + +/* TODO: openzfs/include/sys/uio_impl.h must not be included in stand */ +#ifndef _SYS_UIO_IMPL_H +#define _SYS_UIO_IMPL_H +#endif + +/* + * sys/atomic.h must be included after sys/sysmacros.h. The latter includes + * machine/atomic.h, which interferes. Sadly, upstream includes them in the + * wrong order, so we include it here to fix that. + */ +#include + +#include_next + +#define ZFS_MODULE_PARAM_ARGS void + +/* + * Not sure why I need these, but including the canonical stand.h fails because + * the normal string.h doesn't like all the other shenanigans in this environment. + */ +void *memcpy(void *dst, const void *src, size_t len); +void *memset(void *dest, int c, size_t len); +void *memmem(const void *big, size_t big_len, const void *little, + size_t little_len);