From nobody Sat Jul 09 05:03:30 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 949C53E593C; Sat, 9 Jul 2022 05:03:30 +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 4Lfyhy2xV0z3N5B; Sat, 9 Jul 2022 05:03:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657343010; 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=ThADQQ5kb27EaQBOyf1Wlb4smIuI2jdHEkeC5xahYdQ=; b=bmRuYwo6TWg5iK1iZBstCPnfa0CxmmDwOOURpl/PSMWVs8ipwg8JQ7yOfmpvfpHr6lBg6j OPQq8Zqu9/9LwTckak2JFYDaZE749ys4kmELv7kJoXGLxHrWKRNPX/eS7vQxeuedR6FDbV zZ+FJBD4cAhVu1e2mMiVq94wWKFl+ine0RAyA7uROFPVeh4D8chhgRRaVFRoMUy2LOM/Qa GZ9kKOwPvE5NdvZ/1qwiByFofrqfghXfDcQA1khjmLAPeQVV42PSpAceOCboxJpLT676fR 9HjsoSoM27PCIsgMwUaPAgi/tlY7eivpbI7/5kfCTpWKiGEOGpELoYm+GaxmSg== 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 4Lfyhy22xdzZJR; Sat, 9 Jul 2022 05:03:30 +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 26953UYK099959; Sat, 9 Jul 2022 05:03:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26953UrG099958; Sat, 9 Jul 2022 05:03:30 GMT (envelope-from git) Date: Sat, 9 Jul 2022 05:03:30 GMT Message-Id: <202207090503.26953UrG099958@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: b0a337d50192 - main - stand: Fix inclusion of sys/blake3.h 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: b0a337d501927d12098891131341a7736a9125ee Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657343010; 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=ThADQQ5kb27EaQBOyf1Wlb4smIuI2jdHEkeC5xahYdQ=; b=VHyynvhUNsGpm0wJP43aZUf/A5zYdqD238EoAHaOaSY2PbjvMNWl2sfnuVTlaJA7kjGq4K 91Av9L99zjWui8UyANu4UUIMC8EsFeQy/NECcQxKXpNsgY6scOW6FaTqMBMa3heOBeEgCr 349kp6DeCznvMcjGM1PPGnjnlRj2ttPkEpXuQzhAzwq03bAI9ROOLDjvH6RtKTUB71OQU8 QSYJTxL6j1HDa4T7ubulUnFCqGEDLacg+tyHJcGRDtxiFPaGM4UIIh5OvI/n9U/w9+8NWD Efw+QJcDzHX6GljtgtieI7d0G3Il47H8oMklEiTkvi4SXSI1GD5mcbM224Q23w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1657343010; a=rsa-sha256; cv=none; b=S2FqipCRcLp2SEwZjSALswCeXm54wcju8GB4R6jMhMFwNnEpecPsNVTzDfHIs3Cn37NSlc d6syVJvwBP5b8lICwAV3SWnyWlcyjFABVRg21avqCw/i03EXAUDDbAxO47HtHkSrt2Hh+b 0CJEZKTn/nEaxpO/jhpnRhQePuN2R5rmFR4ZgUYWk0MjB3wdVXHoMN+FhxOWayH+JYYFCm 92HHTnahCI9Wbs6rWCBkbYQctRUWWly+jW4G20XnTsaRTPjSHP1YoeFTAh2cPWkIsU8IWM DV0MkNnedaOM+A6V3KHfnz3xIcKastdHML0h1pskNohOeYXzUoauuwpA4uW1HQ== 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=b0a337d501927d12098891131341a7736a9125ee commit b0a337d501927d12098891131341a7736a9125ee Author: Warner Losh AuthorDate: 2022-07-08 23:34:53 +0000 Commit: Warner Losh CommitDate: 2022-07-09 04:49:55 +0000 stand: Fix inclusion of sys/blake3.h sys/blake3.h is not safe to include in a standalone environment. It assumes, unwisely, that there's only kernel or userland. The userland choice is bad due to imperfections in how we handle stdlib.h in this environment (we wind up including the host's stdlib.h, it expects a standard FreeBSD setup which the gymnastics we've done to create a OpenSolaris/Illumos-like environment interfere with). Thankfully, in this case we can just pretend to be the kernel for a little bit by defining _KERNEL and the undefing it after we exit. Sponsored by: Netflix Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D35750 --- stand/libsa/zfs/spl/sys/blake3.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/stand/libsa/zfs/spl/sys/blake3.h b/stand/libsa/zfs/spl/sys/blake3.h new file mode 100644 index 000000000000..aa2d3b7e55cc --- /dev/null +++ b/stand/libsa/zfs/spl/sys/blake3.h @@ -0,0 +1,17 @@ +/* + * Copyright 2022, Netflix, Inc + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#pragma once + +/* + * Gross and ugly hack to cope with upstream's sys/blake3.h not being standalone + * safe. + */ +#define _KERNEL + +#include_next + +#undef _KERNEL