From nobody Mon Dec 25 17:20:02 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 4SzPmL6cBtz552n2; Mon, 25 Dec 2023 17:20:02 +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 4SzPmL5ffcz4VZH; Mon, 25 Dec 2023 17:20:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703524802; 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=6gcA1v9SPwnVsUz+QKqKe2cdGt88SlqpPyCAwpcUu+o=; b=K/gYcJepJ5SuYyqLwbsyfTTL5gI+dnmaUQiH4rZAkIed1QUW20p5LFz3fbh8bEPZQ4HDON t/85iJC2l3Y6LJV7UzI6/TZSBqpCZpavv9twDLCNCsRx9SenYbKcj++M9lZlYGCfRwxbd/ ODHye5I+SWwIVhF0xd77KzJnfdh+vsjQG2VcUR9ZMfNwXTAkNuHzeQcukajN1+JBLql9T0 s5MT8kNNeALZXtADt8rQtcMZq7aYU4BnZc/ps5b3CoWS6fkJj9df3aB+XUJTWIG7zHcJHe S3XlaIu2TDzCE2cGpMt/8g9ZlIdRIrpuRxupUH193Jp00lqk10p7uskrN+Oj7Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703524802; a=rsa-sha256; cv=none; b=INxNu4Ngf4PUAKNZFcFd2rJdjSDO8dygsXDfQnNWh0K6fZCrokXT5RAEt4Q3ySy7FsRXhj NWVS3mZXDB+jSvceEYgp5pOKAD+B92cgX/v0umbineyMzGwRAB/Yr5IPPBic587762n6ve CHIvi1NUKGw7bSQcENE2m+XuPqHpZRtB1QqJa58leJOgJksT6gw3l+BH7rtcL/C14xeo1x rbNmE1VlUlKnGMf9eh9Vm/A2rmAcd5I43bWXErX8hTuHM93PZaaryI95e5WJO2w43wLwfm gXcSjNWiwnxVmEuoyhe6Wn9IPPo7kkJfRc4X2QSCg75ovII8lcCxozqLsJyjXg== 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=1703524802; 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=6gcA1v9SPwnVsUz+QKqKe2cdGt88SlqpPyCAwpcUu+o=; b=bC16b8EhHUNY0/1QFVbIEdMY8W4rE/l57xhdXdoO+okWqfQy0vX+ZwPuvzwnizT2gFHaG9 0esQiGte1mOJ/SBSj+7tvfTqXT8hl3i53u2nMd5ZFk/zNRPFy/Ew+jA00q5A2nfoVtrp8I FZkBVDUzk6nOcBf58os40KBlMZEheV0k7Pgk7PDPMORI5yN9MiB4mb9qANpzK27FTV8OSI 6bGmLcrMDQ17VEt1l1TONXcWHDN93WxNxEE5UL+mavsWuhuchJZ8MHZfA4ClJwjgVnc9ac +BsQA8f+A3da/fxoMdfWhrhPV3G/8/kaiSmLcTVd0BaJ7n4cxUfj38GNlodbvQ== 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 4SzPmL4c5hz5MQ; Mon, 25 Dec 2023 17:20:02 +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 3BPHK2ZX016855; Mon, 25 Dec 2023 17:20:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BPHK2Y4016852; Mon, 25 Dec 2023 17:20:02 GMT (envelope-from git) Date: Mon, 25 Dec 2023 17:20:02 GMT Message-Id: <202312251720.3BPHK2Y4016852@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 1ff41cad716a - main - Minimize libc++ errno-related header diffs with upstream 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: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1ff41cad716adeba0d408652c92c81e59e3ba316 Auto-Submitted: auto-generated The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=1ff41cad716adeba0d408652c92c81e59e3ba316 commit 1ff41cad716adeba0d408652c92c81e59e3ba316 Author: Dimitry Andric AuthorDate: 2023-12-25 17:18:31 +0000 Commit: Dimitry Andric CommitDate: 2023-12-25 17:19:12 +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 --- .../libcxx/include/__system_error/errc.h | 2 + contrib/llvm-project/libcxx/include/errno.h | 62 +++++----------------- 2 files changed, 16 insertions(+), 48 deletions(-) diff --git a/contrib/llvm-project/libcxx/include/__system_error/errc.h b/contrib/llvm-project/libcxx/include/__system_error/errc.h index f0c27b1c60a1..f939c99f7ed6 100644 --- a/contrib/llvm-project/libcxx/include/__system_error/errc.h +++ b/contrib/llvm-project/libcxx/include/__system_error/errc.h @@ -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