From nobody Sun Dec 01 12:54:34 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 4Y1RhB4xQgz5fZwG; Sun, 01 Dec 2024 12:54:34 +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 4Y1RhB3t5Pz4Pgt; Sun, 1 Dec 2024 12:54:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733057674; 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=gsn0+Jr7BqajJChmsKSeLoo+MedUhsfFUjHE5/dTDY8=; b=XmQHg4EWMjLdbT7ANGGBmYgVsTdJAbPVMlVj/XrbdSGEdkfuD+sJFrcWc1WS0RXAQwAKrS 5faQe/V289/+Sp+QXMIr0n6k7c4FuhfMXhPpLG/7018EfhhDZ9pK5EXwWYgXauO01aD/6Y K3SmfR3lYcVv4AiNqt9wASsc4CKyRnwR6YfLAgDuIgbJRuu20c0r9ntBYPOc9mNt7RTaqB iM1tf9B5CdJk+5Q//e9vzfbyRDGNygznUcC3vbrMCCiPr57h54PdOyiub2zYHsrK9o4gwR a9/sDyqxoKJv3ebFVvs0ZyhtJHSx/sOUxXoTkQelrKj3HbO9bJtTxt8K3MgqLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733057674; 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=gsn0+Jr7BqajJChmsKSeLoo+MedUhsfFUjHE5/dTDY8=; b=SFJwC0Puoq+20+K/50rmoVJpBL5lb8JhG2jdKOA/beUyd5nzVtW1I5gf0IfoIwVMqDRZwt jIyVGao1auxa9cseJ/c8+FqtNUwFThEmc1P+PSuKbtbwnLARIdb0MyTDZYblVTh4Ymehd3 SLb1q4Wtpi7pmKk17XobGiAvY13kZdDouLOOnMPuEkxu8JTII5DZ8L0/9o5N42Zv68zSJx rumBIUcB9YXGwhaKBJ1Et6xFVHG87lMtjdMLK/a5Cqe4qZNSYbTJdIn73SKLSI7ZPqWLPE yY1pIOmIduDfxX6FYBMbeLOLAxDa6zz5o9rrXwGgCMZ2OrHfXyn6sEL0rqKPHg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1733057674; a=rsa-sha256; cv=none; b=ozFIRbU4Q+RdbOjBB7fmz1utDD/o73Jnua4JL4avy2ZBNu2ZjmcqPTE3wijd8JeNOxO2a7 ckfHtFVBcMRKQKNvni+PC/ovUAmj7XFnWu7yBNshN4CaUEDBC8LZxRrMuwllQL9Vk4H1ms uaq3dsqWMUdd61J372yxOEYSli0mcHeinrH05qXMYHXqP4ujuAQU4OqDij2lEY2TQ5kXrK h689Fr8MlMw9ESVsqqepX7tMLIfmtAbAdAbd0bOTS0WXKqGL36AR1ZRm5dHefDNMepux62 sWWgkj9KDkJ0dd2ep0YhF/odzyQXdI1cQrGfHhLnJHE3Ukp8EtjTjiHEQon8rQ== 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 4Y1RhB3VDKztKx; Sun, 1 Dec 2024 12:54:34 +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 4B1CsY5W094623; Sun, 1 Dec 2024 12:54:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4B1CsYqj094618; Sun, 1 Dec 2024 12:54:34 GMT (envelope-from git) Date: Sun, 1 Dec 2024 12:54:34 GMT Message-Id: <202412011254.4B1CsYqj094618@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: 7954b908bdb1 - stable/13 - 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/13 X-Git-Reftype: branch X-Git-Commit: 7954b908bdb1b5c5aae962bc9d9dbe197345f875 Auto-Submitted: auto-generated The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=7954b908bdb1b5c5aae962bc9d9dbe197345f875 commit 7954b908bdb1b5c5aae962bc9d9dbe197345f875 Author: Dimitry Andric AuthorDate: 2024-10-25 16:07:59 +0000 Commit: Dimitry Andric CommitDate: 2024-12-01 12:32:46 +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 048a84ba6bf4..32687cb5a1b4 100644 --- a/lib/libc++/Makefile +++ b/lib/libc++/Makefile @@ -103,7 +103,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