From nobody Fri Oct 25 16:08:51 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 4XZnlS475Dz5Ztdg; Fri, 25 Oct 2024 16:08:52 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XZnlR4jfNz3y9n; Fri, 25 Oct 2024 16:08:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729872531; 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=vh0uD4KnWnVIHlO07SxwmcuQnHyP8yy6tEAWJcI2g8M=; b=A60D2PpxRMX6b1kBpZR2gofOeCb4kM8l0YTh82jZ/f94WRbALyHb4XWg9jUb5mjPxLpqO1 DJ5ltyUqr6OJ8lPZD/ulG5xQoMedYOtXBpHT3cS0V5Sxz0lhfileE6GakSRcBkHOQk19Ca ec41RG2LVPodX0ZTe4NYbIAifkD67DeboN/JpHMBl2jLRI8KjJKQPE36D14htR2oWNwfIa Cm6FdRou7ecOa7ROstwmFWe7n+LzON2Ldl/ui7ScqVU9zDUT5Ym4Uo2Nsh9Dup+rlFAjGd E7QFas5JH7VZqxPq+ueBxwJ70wfEHs1JO2BLrtU98C3QgCqUyrRBZZc/z/I3Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729872531; 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=vh0uD4KnWnVIHlO07SxwmcuQnHyP8yy6tEAWJcI2g8M=; b=vqhtxY87ZxksanzXQE6uQZ//F7v6dPw5hhs7vJ6l0neeuLJZi5le7Q9nQusTIssHzDIXAo 3xd/cR/mKV+YdSwyFLL68bYQY13dP7a8jJ1YXMQtoHVFr4UqCtc0kId9+VT/J/o2ouD0x7 zsMZq9UB4gfCcoiwA5t1N21znj8NMvB1pmeX8UvATAXXKqifM0AIjOYbmpAzl9/pC4UMSH HmU6RkR9na3ILNcgG9Z6CY9ba62t4rV9oSZOremV3gnx5jMKOkqg7TLu85bpiIy2k+N7nI szfjjoZ4Z6qL33Dj80Pi4L2lDIl3hUgfcF/4GajlGyqwpXBkDK2dlPzv80/Vfw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729872531; a=rsa-sha256; cv=none; b=sSIrxFwBKs95Nak5v9sv04Xeo3y/+MRZ/8j6EFZIaIB1iaLhb13AQgAhLficeIZn/zKOtU 82nlIuFdqUYiEd943Bc9MiUbdmpXTnyCQN0pyaG/eAyDOO2RNKOlCqwerNTeqPHvRCdI/D SR4dG29Ug9rCZO3L+xGt6PRmOswa/O/c4o7LuvjTQ3pi0pXbPPasygphpn/YrXMjNqew7u q6hcBO1DCBaBnHv9YHzii5POrVJEnMX4pct9J4Jyhz/wYKa3AxMvpwq+eozOj2vJhriO3t x1Kq+Fadl+5bK5vt9DgWfPGZlH2MR8aWqhFbmoywfJ4a5awoLl6K94be7jmmMg== 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 4XZnlR31CzzXpQ; Fri, 25 Oct 2024 16:08:51 +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 49PG8ptK044796; Fri, 25 Oct 2024 16:08:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49PG8pSI044793; Fri, 25 Oct 2024 16:08:51 GMT (envelope-from git) Date: Fri, 25 Oct 2024 16:08:51 GMT Message-Id: <202410251608.49PG8pSI044793@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: bc9e19dce0ab - main - 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/main X-Git-Reftype: branch X-Git-Commit: bc9e19dce0abee80750e6fa04aaf979873bfe0d2 Auto-Submitted: auto-generated The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=bc9e19dce0abee80750e6fa04aaf979873bfe0d2 commit bc9e19dce0abee80750e6fa04aaf979873bfe0d2 Author: Dimitry Andric AuthorDate: 2024-10-25 16:07:59 +0000 Commit: Dimitry Andric CommitDate: 2024-10-25 16:08:32 +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 --- 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 b30eefd6e2f7..9c12f419f6f1 100644 --- a/lib/libc++/Makefile +++ b/lib/libc++/Makefile @@ -104,7 +104,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