From nobody Sun Dec 01 11:19:01 2024 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 4Y1PYy3NxWz5fTD2; Sun, 01 Dec 2024 11:19: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Y1PYy1rn0z43Hm; Sun, 1 Dec 2024 11:19:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733051942; 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=uoGN4+JcIZj+u15KLQDmoB84GDjHh55X/HpW5R4YSc8=; b=x109UGdLsgNZh091mLDly53wa2+cb79iXkF4m6uWKni9CKhA9nsACvAGMnbDMdT28r1PoS Pa3GtPf1Wioky4kmnjh1wVgjmsAzgbB4+ns4K1wXWpNZxjKGFElTu3xgel9Y/fBuB69rvp Ep429hL32bGtk/j63QKNKJAJKwwvk8a8EejwTD+yQ+TyEznY/ufQGZ2dDE9X8V6usY2ag8 lFbuGam5rYHYd1273qCl+3JEGPdK22oEQXx5ht/PGl/i/HwxjQX6Wbz4dVBIFdcbtwnkkz oweIg4eISqP3KUhrjcNJRwT1bdmKTsMC0eNzX8jEzjGLyBZGNLJ5sga6+jv7Ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733051942; 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=uoGN4+JcIZj+u15KLQDmoB84GDjHh55X/HpW5R4YSc8=; b=w4780ETSvZDM2beL0r369ZnJP9NtBwfGBYnAd2Ts63os3nRUmIJD4drBLP/lZkBxJuw0hv oOLK4BpVGeO+bgqBdROqq1pRLMvSu/V9vHJ+0B0k8z4V3J6NaxsErx/WSE1iz/nyEGXNux j5VrGX/HYEdvDrRKMaMCguT/mlh/kCgzoceKSCfwVVKVBa71KbOucBBMhNcsMPDbH+C3T6 YUJll9lK45iYI6G4Y4Mh7LsqFTCr87k0SnZx9nh3owCWwwOr2CiIgTBl24oBDT8B+uuIIo BtqHv0t60vtpXJp3gZjD0exw7wl8vHaAvYci7rKtbg7M60QApk74tnl5m1+0rg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1733051942; a=rsa-sha256; cv=none; b=Wr9O3K5W/kDbIn/9nW9PJcHv6KWQsw2Ca4Mx05sqFTCKTwMbcr9PapOPSQbpJVsy3NS/gY Avo/7fO3EpzK2NbG/OrUCZ84O236Tf3mhw42zHrPMOisU6XJ+yxDuqlBxnZgpiy+YojBjv IzRT96+cwdO+HtSPj6shjKomh43eUM67eF8SNuTFWUXVqCyW8JB5P6SimZFWgktmf3a4/8 bbSvP2E8R7MxS0FlpbsHjhBqUXqv9JgK2PPVg6nQoRFYnR+kWWVQhy+lw5O3Li70MapoHF iAQwKgd+AgGrIJ17f07fcuuReUESihiiMpgF37uHm1pTn4hdIFDZbnlT6ixEcg== 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 4Y1PYx73qwzqGY; Sun, 1 Dec 2024 11:19:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4B1BJ18d009041; Sun, 1 Dec 2024 11:19:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4B1BJ1Wq009038; Sun, 1 Dec 2024 11:19:01 GMT (envelope-from git) Date: Sun, 1 Dec 2024 11:19:01 GMT Message-Id: <202412011119.4B1BJ1Wq009038@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: 4ec4206356c0 - stable/14 - Fix buildworld with gcc 12 after llvm-19 import 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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/stable/14 X-Git-Reftype: branch X-Git-Commit: 4ec4206356c060c4dfab6ef13c248f00023b94ba Auto-Submitted: auto-generated The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=4ec4206356c060c4dfab6ef13c248f00023b94ba commit 4ec4206356c060c4dfab6ef13c248f00023b94ba Author: Dimitry Andric AuthorDate: 2024-10-25 16:07:59 +0000 Commit: Dimitry Andric CommitDate: 2024-12-01 11:17:16 +0000 Fix buildworld with gcc 12 after llvm-19 import Unfortunately gcc 12's is not yet capable of compiling all of libc++ 19's C++23 code, which results in errors similar to: /usr/src/freebsd/src/contrib/llvm-project/libcxx/include/__algorithm/ranges_contains.h:41:3: error: 'static constexpr bool std::__1::ranges::__contains::__fn::operator()(_Iter, _Sent, const _Type&, _Proj)' must be a non-static member function 41 | operator()(_Iter __first, _Sent __last, const _Type& __value, _Proj __proj = {}) { | ^~~~~~~~ /usr/src/freebsd/src/contrib/llvm-project/libcxx/include/__algorithm/ranges_contains.h:48:3: error: 'static constexpr bool std::__1::ranges::__contains::__fn::operator()(_Range&&, const _Type&, _Proj)' must be a non-static member function 48 | operator()(_Range&& __range, const _Type& __value, _Proj __proj = {}) { | ^~~~~~~~ Until we can get rid of gcc 12, work around this by making it compile libc++ in C++20 mode instead. NOTE: The resulting libc++ library will not be C++23 compatible! Please try to avoid shipping it, and use gcc 13 instead, if you must use gcc. PR: 280562 MFC after: 3 days (cherry picked from commit bc9e19dce0abee80750e6fa04aaf979873bfe0d2) --- contrib/llvm-project/libcxx/src/expected.cpp | 2 ++ lib/libc++/Makefile | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/contrib/llvm-project/libcxx/src/expected.cpp b/contrib/llvm-project/libcxx/src/expected.cpp index f30efb516479..ed3bf9e37e35 100644 --- a/contrib/llvm-project/libcxx/src/expected.cpp +++ b/contrib/llvm-project/libcxx/src/expected.cpp @@ -9,5 +9,7 @@ #include _LIBCPP_BEGIN_NAMESPACE_STD +#if _LIBCPP_STD_VER >= 23 const char* bad_expected_access::what() const noexcept { return "bad access to std::expected"; } +#endif _LIBCPP_END_NAMESPACE_STD diff --git a/lib/libc++/Makefile b/lib/libc++/Makefile index c01b5eccde4b..95b1bc298c98 100644 --- a/lib/libc++/Makefile +++ b/lib/libc++/Makefile @@ -105,7 +105,15 @@ CFLAGS+= -ffunction-sections CFLAGS+= -fno-semantic-interposition CFLAGS+= -fvisibility-inlines-hidden CFLAGS+= -fvisibility=hidden + +.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} < 130000 +# NOTE: gcc 12 cannot correctly compile all libc++'s C++23 code. To temporarily +# support gcc 12, compile libc++ in C++20 mode, but this will leave out any +# C++23 features. +CXXSTD?= c++20 +.else CXXSTD?= c++23 +.endif LIBADD+= cxxrt