From nobody Tue Jan 24 22:10:48 2023 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 4P1h4S64gcz3bf4D; Tue, 24 Jan 2023 22:10:48 +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 4P1h4S5MxXz4Ljb; Tue, 24 Jan 2023 22:10:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674598248; 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=efkJEP9r72iHHv49FBT2TWY0n9i+mY8bvCaVRQkH8ks=; b=dTA5DrX3BvjudO1vEmuicI5vLMUG5DiqJciYWe0Y12NFvJT445q5LEtuac7rjfGRoNbQyq OgSTLvUGEezY1f2xggm9D2aRkOmp1AxNCtcuJOtWDlcEyZsCrL7XIDwnKwc0Lc2b1m8bbX DOHt0XSMIfRd+j/2ng523H39TbE+5ENAFsPAX8HuwZxFd7hGwsnnoBECpVJN2rlCWFHMWL T0Qf9RtS41dzWWbALPoMVuh39L/zgKmKvyq1oRGDzeHynzql24APsDqVy3u+N1T2e0MWpu XXouslYZU0XuEKAoTfDtafUC70u4P5gk4kMeo53XYoK83AC1wpZuenkKJDL+ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674598248; 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=efkJEP9r72iHHv49FBT2TWY0n9i+mY8bvCaVRQkH8ks=; b=b9NBk1QOyvwVnNAnn7u+Ev2kKFdwKHFyLNrgyBQj9HvanWKCJmprXUYwjSHbD2TnWCXMNT rOC+o+K35hmpxf+FAn2liZsXPBMfCNdJ3t5jRnxzloEGmf+I6EtcmUpthbe+bpVqdJCjN4 4PlxZ3FB3Bskcay8esqxrGkL+dbcJay8QUKkb47CX5BOb7x7qJ+DPj7KD00FdmijO59VeG WSlog1ASK0HAB807D7LcMmRl1RX/kWno86+x2RB1PAVN4s1ZDHf8mN7Dy2w61ySdekS05r Qtw2E/0lPfyFcnRsV1R8dP6ewZTi95/PCp7vQwIJdUPwddxYuntZ0IL8fWoHoA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674598248; a=rsa-sha256; cv=none; b=yKCfgQC6OBEkJSD2F3Pq+1EYd7WS7VeVeyuBtyDInJH73OoBcbXp4AwE0soREu/oKByvWM qMcjlC2k5+1J6lf4Z8+d7d5HojjQ2uHJP2CHlFbeRI7/2jcume8aqgCrax8iDSoTO73bAv 1l51XHPyIjvARV0Y1VCadP1WVk2k2HfXkZaRzB0e0vcK38AK9uSjwtU2eghxt+3eKCsYde 51loCB/SuEx850UR5q/IcEEX8A9ovdCgA1AT8zhEm0X+GPAKsI4zm+lx/Rss7Ndhkzq5/G uvgPyzMFPPwxkr/5UXrvn+Or9rQ7yAhyfgx2UhCaV0lsN9rmKrcsXI0Wgkq7hQ== 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 4P1h4S3dTlzPmj; Tue, 24 Jan 2023 22:10:48 +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 30OMAmAZ080555; Tue, 24 Jan 2023 22:10:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30OMAmGt080554; Tue, 24 Jan 2023 22:10:48 GMT (envelope-from git) Date: Tue, 24 Jan 2023 22:10:48 GMT Message-Id: <202301242210.30OMAmGt080554@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: a61eb269dec4 - stable/13 - 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/stable/13 X-Git-Reftype: branch X-Git-Commit: a61eb269dec47797752ff651924ac030d7754816 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=a61eb269dec47797752ff651924ac030d7754816 commit a61eb269dec47797752ff651924ac030d7754816 Author: Warner Losh AuthorDate: 2022-07-08 23:34:53 +0000 Commit: Warner Losh CommitDate: 2023-01-24 21:49:23 +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 (cherry picked from commit b0a337d501927d12098891131341a7736a9125ee) --- 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