From nobody Mon Jan 01 16:42:41 2024 X-Original-To: dev-commits-src-branches@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 4T3hc21tkdz573Wc; Mon, 1 Jan 2024 16:42:42 +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 4T3hc216P2z3Dt7; Mon, 1 Jan 2024 16:42:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704127362; 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=HENutWzpGBfK/7FsTY1YI+SpRaw5qqLVAB47csTJ87g=; b=p4w+Ria90LfkImk5CfdGWmul6oaKJpwY+K89EqtUgkc6bwmQe5u0Myz4uITTu3KpRmJo95 RRI/ho4Zo7b7S4ArrBcUxJmAa0YBSF1R7HnC9eomx04GHbGQ+CcHJktY/bS7RLnv61SnQZ E0bVB1yMq/42hC01PutGwVFGkCsat3oxGPUw8rAyn4Set+RtCeCvmSbRmQUKVK5OX3i5XH OT2+euwg4d0syHG4DK1RCUOuAhSp7C3OU21LgK9yO4+u9W0u+K1P+N5zw76J3ib1eJSYyA JZnutGAKHOYR+ELHrhsZojFVybdvui4zI59XfSzUN6gMOomI6YjUSIq1kHf6MQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704127362; a=rsa-sha256; cv=none; b=tQxdkpTnMdT7M3YSsmxCXP0sp1Wz4ZVWtGHmr9kNotys+hUrYyIJSuBO2dnAVSQPL9JZCE zKyXavIeNnA7knKa+57nBkyn8SmbLFUo5ZzXPp59CnUc4DwBo17whhhbWKJA/x+4AqexJV 1z22WJ1Zw5IfmswknRw0qvNSIxfY1VcXeEUug57C6PTVC0sWPaQN7WWhfAvCPCj0JYSqU4 i2U75rvrazgMZwEkRDb2DQ5Yvr3AUkbAkh4l9VyUsgEU9wG06c40DadHtpZgCP4tNBFt5y dDTRinkJ+bmx/7mi7yFS58RcqpjZHRpYFeoGqjq0utRxeZ/r/bP8AGLQ7mlUjA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704127362; 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=HENutWzpGBfK/7FsTY1YI+SpRaw5qqLVAB47csTJ87g=; b=us0XOQCRYkdhwgdll3R7wJ8NxFkGdOeJHgGtD/rDIUYAVVXnB6M7iYkGoTX12krO7HG6hu Th5lhCpemtF357Y49i7e6Wym8bZ+fz9D9EPrpt9R5u0TtHWWxnNaw41l7zE7on2E/QYrfo pPS4x1ifPBNyh/46wB+IK6AK047leBtLShpMRhn+edqYhL48EXxzCfq8qXUdDIxERYOUF/ G9Fd/tTaHSE4fyUmMHJQfdIv5gnxl2rQBjPcfe27M7SZFgDwb/YjdePDQ2HLW4dmE7bdyd +aLtj/6sgmpvie4FBfqIK0abQ/w/cPepAdP3yIADWuko8qQE2QuAbOOlSoKSaA== 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 4T3hc2093Gz9GX; Mon, 1 Jan 2024 16:42:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 401GgfLI089358; Mon, 1 Jan 2024 16:42:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 401GgflD089355; Mon, 1 Jan 2024 16:42:41 GMT (envelope-from git) Date: Mon, 1 Jan 2024 16:42:41 GMT Message-Id: <202401011642.401GgflD089355@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 9606dfe4620e - stable/14 - Minimize libc++ errno-related header diffs with upstream List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9606dfe4620e23e4bff508f8444579f125e16cc3 Auto-Submitted: auto-generated The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=9606dfe4620e23e4bff508f8444579f125e16cc3 commit 9606dfe4620e23e4bff508f8444579f125e16cc3 Author: Dimitry Andric AuthorDate: 2023-12-25 17:18:31 +0000 Commit: Dimitry Andric CommitDate: 2024-01-01 16:37:01 +0000 Minimize libc++ errno-related header diffs with upstream In commit 88640c0e8b6f5 the new EINTEGRITY errno value was added, and this caused us to carry a patch for upstream libc++ since that time. Because it can cause merge conflicts when importing libc++ code from upstream, I have submitted an upstream pull request to get most of that patch integrated. It turns out that we do not need the errno.h part of it at all, since all supported FreeBSD versions define EOWNERDEAD and ENOTRECOVERABLE, and therefore the block that juggles with ELAST values is never used in FreeBSD. At the moment it only applies to older versions of Linux, or possibly other platforms. Therefore the only part that needs to stay is the definition of a enum errc value for EINTEGRITY, and this is made optional upon EINTEGRITY being defined, to make it suitable for upstreaming. No functional change is intended. MFC after: 1 week (cherry picked from commit 1ff41cad716adeba0d408652c92c81e59e3ba316) --- contrib/llvm-project/libcxx/include/__errc | 2 + contrib/llvm-project/libcxx/include/errno.h | 62 +++++++---------------------- 2 files changed, 16 insertions(+), 48 deletions(-) diff --git a/contrib/llvm-project/libcxx/include/__errc b/contrib/llvm-project/libcxx/include/__errc index f0c27b1c60a1..f939c99f7ed6 100644 --- a/contrib/llvm-project/libcxx/include/__errc +++ b/contrib/llvm-project/libcxx/include/__errc @@ -143,7 +143,9 @@ _LIBCPP_DECLARE_STRONG_ENUM(errc) identifier_removed = EIDRM, illegal_byte_sequence = EILSEQ, inappropriate_io_control_operation = ENOTTY, +#ifdef EINTEGRITY integrity_check_failed = EINTEGRITY, +#endif interrupted = EINTR, invalid_argument = EINVAL, invalid_seek = ESPIPE, diff --git a/contrib/llvm-project/libcxx/include/errno.h b/contrib/llvm-project/libcxx/include/errno.h index ea96c3a0f004..7b02d2b47953 100644 --- a/contrib/llvm-project/libcxx/include/errno.h +++ b/contrib/llvm-project/libcxx/include/errno.h @@ -34,79 +34,49 @@ Macros: #ifdef __cplusplus -#if !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE) || !defined(EINTEGRITY) +#if !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE) -#if defined(ELAST) +#ifdef ELAST static const int __elast1 = ELAST+1; static const int __elast2 = ELAST+2; -static const int __elast3 = ELAST+3; #else static const int __elast1 = 104; static const int __elast2 = 105; -static const int __elast3 = 106; #endif -#if !defined(EOWNERDEAD) && !defined(ENOTRECOVERABLE) && !defined(EINTEGRITY) -#define ENOTRECOVERABLE __elast1 -#define EOWNERDEAD __elast2 -#define EINTEGRITY __elast3 -#if defined(ELAST) -#undef ELAST -#define ELAST EINTEGRITY -#endif - -#elif !defined(EOWNERDEAD) && !defined(ENOTRECOVERABLE) && defined(EINTEGRITY) -#define ENOTRECOVERABLE __elast1 -#define EOWNERDEAD __elast2 -#if defined(ELAST) -#undef ELAST -#define ELAST EOWNERDEAD -#endif +#ifdef ENOTRECOVERABLE -#elif !defined(EOWNERDEAD) && defined(ENOTRECOVERABLE) && !defined(EINTEGRITY) #define EOWNERDEAD __elast1 -#define EINTEGRITY __elast2 -#if defined(ELAST) -#undef ELAST -#define ELAST EINTEGRITY -#endif -#elif !defined(EOWNERDEAD) && defined(ENOTRECOVERABLE) && defined(EINTEGRITY) -#define EOWNERDEAD __elast1 -#if defined(ELAST) +#ifdef ELAST #undef ELAST #define ELAST EOWNERDEAD #endif -#elif defined(EOWNERDEAD) && !defined(ENOTRECOVERABLE) && !defined(EINTEGRITY) -#define ENOTRECOVERABLE __elast1 -#define EINTEGRITY __elast2 -#if defined(ELAST) -#undef ELAST -#define ELAST EINTEGRITY -#endif +#elif defined(EOWNERDEAD) -#elif defined(EOWNERDEAD) && !defined(ENOTRECOVERABLE) && defined(EINTEGRITY) #define ENOTRECOVERABLE __elast1 -#if defined(ELAST) +#ifdef ELAST #undef ELAST #define ELAST ENOTRECOVERABLE #endif -#elif defined(EOWNERDEAD) && defined(ENOTRECOVERABLE) && !defined(EINTEGRITY) -#define EINTEGRITY __elast1 -#if defined(ELAST) +#else // defined(EOWNERDEAD) + +#define EOWNERDEAD __elast1 +#define ENOTRECOVERABLE __elast2 +#ifdef ELAST #undef ELAST -#define ELAST EINTEGRITY +#define ELAST ENOTRECOVERABLE #endif -#endif // !defined(OWNERDEAD) && !defined(NOTRECOVERABLE) && !defined(INTEGRITY) +#endif // defined(EOWNERDEAD) -#endif // !defined(OWNERDEAD) || !defined(NOTRECOVERABLE) || !defined(INTEGRITY) +#endif // !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE) // supply errno values likely to be missing, particularly on Windows @@ -424,10 +394,6 @@ static const int __elast3 = 106; #define EMLINK 9979 #endif -#ifndef EINTEGRITY -#define EINTEGRITY 9980 -#endif - #endif // __cplusplus #endif // _LIBCPP_ERRNO_H