From nobody Fri Oct 06 17:50:54 2023 X-Original-To: dev-commits-ports-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 4S2GDt4rh1z4w0hR; Fri, 6 Oct 2023 17:50:54 +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 4S2GDt3lPHz4cTq; Fri, 6 Oct 2023 17:50:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696614654; 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=UNZM190i53Dh/5aGx87jfn/QM63R5Q6owzGU0hmIJ0c=; b=MaIWQcPJXlj79KjwfQiqWjHsSNHfIxGSv/qGd91vCZMoxRF6pjdp8qZUo5h0EGsj0BB/4m Py7tjRqopuEFVd5yANwD1Frjb7jF879c8hcC5uWwpt96P19dnf0DHMwMHlLZNYTKhAMDDb k5cD1kVXzAwm3ugEfbvrYZfPW17hvQS9GKbKBw8/wxu9jT/TtUjXZUxqNkrZHmxUi9wgb+ 0xa/ET4HIBCKX7DO6RvCWlg/8lt4ajWSNtjEKE169a0EmOhVQPuCjNbNpkyrtsF4ITxayN etVltg3VER/J1fhxqYXwv5Ir7vpoTH82wk8EFG0q1/hRGjMhBM/z4AeTyY+r9g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1696614654; a=rsa-sha256; cv=none; b=Rh5GqeicfKgszRrm+mXHOdCBXJOOrUdMefpy9Rb95Nw8s4PDxT5b3S0RYE9+icPMANrcdB ikPw7xLEM9qtur+yQyMx31PaUtvWjSKkvj+kYYWM0ATZClcbrgqaVdXLzv+6zi8as6fxLD pFEUhtYAkVuwAlstcSY2327nkAj7veyAOyFy2Y8IhHBap0NysCsEGG3P8nPywk5vNeGHR6 uufHoYyc46/uhOsKY+FaWEhAZKvGNhBb8kwbRrVCdhHUp0DWQNx/RWubkDYzeJBSHDZox2 bP1CGWms3giWYSKKH3nsqlTczrQ9U1NHA6i6qjfiRSOjpXsQRpNde4rcW7Ozew== 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=1696614654; 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=UNZM190i53Dh/5aGx87jfn/QM63R5Q6owzGU0hmIJ0c=; b=wyhH1ktmPNMUroI+gcBO6OdP53ueNZ7kYrk06YSStFC56YkZL3NE6XzXHMi95HXbQMIT8d wjn9fWdepvW1iTSQV6hrowWuxoF2AjaYPYXXMBqC5PAGYd07pbUa65BjLQ1P4iigdYK5G0 IOu6cB53zLYL2EU3YMKHyTwzZ9NK1pNVxBx+XiDslXYRjRklz9JJ+nZCk0OapT6jufpbBX fgIPl1AW2guVXuYs6bfz+ndp5EGGTwf2AtB6CJp7bIslLnmSwDuODyWwZbTiJ5bkA2bxVs qWUJ4W39tym2uY035958y6TUqZjfgxhzT7NCn9N+8wu9nwVlOXjaI6VzzWXiYA== 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 4S2GDt2rf2zxZB; Fri, 6 Oct 2023 17:50:54 +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 396Hos2W039139; Fri, 6 Oct 2023 17:50:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 396HosL1039136; Fri, 6 Oct 2023 17:50:54 GMT (envelope-from git) Date: Fri, 6 Oct 2023 17:50:54 GMT Message-Id: <202310061750.396HosL1039136@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Dimitry Andric Subject: git: b7833e78f7bd - main - lang/gcc10 lang/gcc11 lang/gcc11-devel lang/gcc12 lang/gcc12-devel lang/gcc13 lang/gcc13-devel lang/gcc14-devel: fix build with libc++ 17 List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-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: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b7833e78f7bdf5b00b5b0d25ed983f1b8d413e32 Auto-Submitted: auto-generated The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/ports/commit/?id=b7833e78f7bdf5b00b5b0d25ed983f1b8d413e32 commit b7833e78f7bdf5b00b5b0d25ed983f1b8d413e32 Author: Dimitry Andric AuthorDate: 2023-09-21 17:49:57 +0000 Commit: Dimitry Andric CommitDate: 2023-10-06 17:48:53 +0000 lang/gcc10 lang/gcc11 lang/gcc11-devel lang/gcc12 lang/gcc12-devel lang/gcc13 lang/gcc13-devel lang/gcc14-devel: fix build with libc++ 17 When building relatively recent gcc ports (with C++ in them) against libc++ 17, you get errors similar to: In file included from /wrkdirs/usr/ports/lang/gcc12/work/gcc-12.2.0/gcc/cp/module.cc:208: In file included from /wrkdirs/usr/ports/lang/gcc12/work/gcc-12.2.0/gcc/system.h:239: In file included from /usr/include/c++/v1/vector:321: In file included from /usr/include/c++/v1/__format/formatter_bool.h:20: In file included from /usr/include/c++/v1/__format/formatter_integral.h:32: In file included from /usr/include/c++/v1/locale:202: /usr/include/c++/v1/__locale:546:5: error: '__abi_tag__' attribute only applies to structs, variables, functions, and namespaces 546 | _LIBCPP_INLINE_VISIBILITY | ^ /usr/include/c++/v1/__config:813:37: note: expanded from macro '_LIBCPP_INLINE_VISIBILITY' 813 | # define _LIBCPP_INLINE_VISIBILITY _LIBCPP_HIDE_FROM_ABI | ^ /usr/include/c++/v1/__config:792:26: note: expanded from macro '_LIBCPP_HIDE_FROM_ABI' 792 | __attribute__((__abi_tag__(_LIBCPP_TOSTRING(_LIBCPP_VERSIONED_IDENTIFIER)))) | ^ In file included from /wrkdirs/usr/ports/lang/gcc12/work/gcc-12.2.0/gcc/cp/module.cc:208: In file included from /wrkdirs/usr/ports/lang/gcc12/work/gcc-12.2.0/gcc/system.h:239: In file included from /usr/include/c++/v1/vector:321: In file included from /usr/include/c++/v1/__format/formatter_bool.h:20: In file included from /usr/include/c++/v1/__format/formatter_integral.h:32: In file included from /usr/include/c++/v1/locale:202: /usr/include/c++/v1/__locale:547:37: error: expected ';' at end of declaration list 547 | char_type toupper(char_type __c) const | ^ /usr/include/c++/v1/__locale:553:48: error: too many arguments provided to function-like macro invocation 553 | const char_type* toupper(char_type* __low, const char_type* __high) const | ^ /wrkdirs/usr/ports/lang/gcc12/work/gcc-12.2.0/gcc/../include/safe-ctype.h:146:9: note: macro 'toupper' defined here 146 | #define toupper(c) do_not_use_toupper_with_safe_ctype | ^ This is because gcc/system.h includes safe-ctype.h which redefines ctype macros such as toupper, tolower, etc to "poison" them. However, it should only include the safe-ctype.h header *after* any C++ headers, such as , , , etc, otherwise these might transitively include internal ctype headers (such as with libc++ 17), causing the above conflicts. Fix it by moving the safe-ctype.h inclusion to later in gcc/system.h, which solves this issue, and makes it possible to build against libc++ 17. See also: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111632 PR: 274041 Approved by: salvadore (maintainer) MFH: 2023Q4 --- lang/gcc10/files/patch-gcc_system.h | 42 +++++++++++++++++++++++++++++++ lang/gcc11-devel/files/patch-gcc_system.h | 42 +++++++++++++++++++++++++++++++ lang/gcc11/files/patch-gcc_system.h | 42 +++++++++++++++++++++++++++++++ lang/gcc12-devel/files/patch-gcc_system.h | 42 +++++++++++++++++++++++++++++++ lang/gcc12/files/patch-gcc_system.h | 42 +++++++++++++++++++++++++++++++ lang/gcc13-devel/files/patch-gcc_system.h | 42 +++++++++++++++++++++++++++++++ lang/gcc13/files/patch-gcc_system.h | 42 +++++++++++++++++++++++++++++++ lang/gcc14-devel/files/patch-gcc_system.h | 42 +++++++++++++++++++++++++++++++ 8 files changed, 336 insertions(+) diff --git a/lang/gcc10/files/patch-gcc_system.h b/lang/gcc10/files/patch-gcc_system.h new file mode 100644 index 000000000000..11b26521c550 --- /dev/null +++ b/lang/gcc10/files/patch-gcc_system.h @@ -0,0 +1,42 @@ +--- gcc/system.h.orig 2022-06-28 08:54:28 UTC ++++ gcc/system.h +@@ -203,19 +203,6 @@ extern int fprintf_unlocked (FILE *, const char *, ... + #endif + #endif + +-/* There are an extraordinary number of issues with . +- The last straw is that it varies with the locale. Use libiberty's +- replacement instead. */ +-#include "safe-ctype.h" +- +-#include +- +-#include +- +-#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO +-extern int errno; +-#endif +- + #ifdef __cplusplus + #if defined (INCLUDE_ALGORITHM) || !defined (HAVE_SWAP_IN_UTILITY) + # include +@@ -235,6 +222,19 @@ extern int errno; + # include + # include + # include ++#endif ++ ++/* There are an extraordinary number of issues with . ++ The last straw is that it varies with the locale. Use libiberty's ++ replacement instead. */ ++#include "safe-ctype.h" ++ ++#include ++ ++#include ++ ++#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO ++extern int errno; + #endif + + /* Some of glibc's string inlines cause warnings. Plus we'd rather diff --git a/lang/gcc11-devel/files/patch-gcc_system.h b/lang/gcc11-devel/files/patch-gcc_system.h new file mode 100644 index 000000000000..082e08ef73c8 --- /dev/null +++ b/lang/gcc11-devel/files/patch-gcc_system.h @@ -0,0 +1,42 @@ +--- gcc/system.h.orig 2023-09-14 22:32:14 UTC ++++ gcc/system.h +@@ -203,19 +203,6 @@ extern int fprintf_unlocked (FILE *, const char *, ... + #endif + #endif + +-/* There are an extraordinary number of issues with . +- The last straw is that it varies with the locale. Use libiberty's +- replacement instead. */ +-#include "safe-ctype.h" +- +-#include +- +-#include +- +-#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO +-extern int errno; +-#endif +- + #ifdef __cplusplus + #if defined (INCLUDE_ALGORITHM) || !defined (HAVE_SWAP_IN_UTILITY) + # include +@@ -242,6 +229,19 @@ extern int errno; + # include + # include + # include ++#endif ++ ++/* There are an extraordinary number of issues with . ++ The last straw is that it varies with the locale. Use libiberty's ++ replacement instead. */ ++#include "safe-ctype.h" ++ ++#include ++ ++#include ++ ++#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO ++extern int errno; + #endif + + /* Some of glibc's string inlines cause warnings. Plus we'd rather diff --git a/lang/gcc11/files/patch-gcc_system.h b/lang/gcc11/files/patch-gcc_system.h new file mode 100644 index 000000000000..87259b346ecc --- /dev/null +++ b/lang/gcc11/files/patch-gcc_system.h @@ -0,0 +1,42 @@ +--- gcc/system.h.orig 2022-04-21 07:58:53 UTC ++++ gcc/system.h +@@ -203,19 +203,6 @@ extern int fprintf_unlocked (FILE *, const char *, ... + #endif + #endif + +-/* There are an extraordinary number of issues with . +- The last straw is that it varies with the locale. Use libiberty's +- replacement instead. */ +-#include "safe-ctype.h" +- +-#include +- +-#include +- +-#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO +-extern int errno; +-#endif +- + #ifdef __cplusplus + #if defined (INCLUDE_ALGORITHM) || !defined (HAVE_SWAP_IN_UTILITY) + # include +@@ -242,6 +229,19 @@ extern int errno; + # include + # include + # include ++#endif ++ ++/* There are an extraordinary number of issues with . ++ The last straw is that it varies with the locale. Use libiberty's ++ replacement instead. */ ++#include "safe-ctype.h" ++ ++#include ++ ++#include ++ ++#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO ++extern int errno; + #endif + + /* Some of glibc's string inlines cause warnings. Plus we'd rather diff --git a/lang/gcc12-devel/files/patch-gcc_system.h b/lang/gcc12-devel/files/patch-gcc_system.h new file mode 100644 index 000000000000..46a725f37714 --- /dev/null +++ b/lang/gcc12-devel/files/patch-gcc_system.h @@ -0,0 +1,42 @@ +--- gcc/system.h.orig 2023-09-15 22:32:10 UTC ++++ gcc/system.h +@@ -203,19 +203,6 @@ extern int fprintf_unlocked (FILE *, const char *, ... + #endif + #endif + +-/* There are an extraordinary number of issues with . +- The last straw is that it varies with the locale. Use libiberty's +- replacement instead. */ +-#include "safe-ctype.h" +- +-#include +- +-#include +- +-#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO +-extern int errno; +-#endif +- + #ifdef __cplusplus + #if defined (INCLUDE_ALGORITHM) || !defined (HAVE_SWAP_IN_UTILITY) + # include +@@ -243,6 +230,19 @@ extern int errno; + # include + # include + # include ++#endif ++ ++/* There are an extraordinary number of issues with . ++ The last straw is that it varies with the locale. Use libiberty's ++ replacement instead. */ ++#include "safe-ctype.h" ++ ++#include ++ ++#include ++ ++#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO ++extern int errno; + #endif + + /* Some of glibc's string inlines cause warnings. Plus we'd rather diff --git a/lang/gcc12/files/patch-gcc_system.h b/lang/gcc12/files/patch-gcc_system.h new file mode 100644 index 000000000000..7a18af14077a --- /dev/null +++ b/lang/gcc12/files/patch-gcc_system.h @@ -0,0 +1,42 @@ +--- gcc/system.h.orig 2022-08-19 08:09:53 UTC ++++ gcc/system.h +@@ -203,19 +203,6 @@ extern int fprintf_unlocked (FILE *, const char *, ... + #endif + #endif + +-/* There are an extraordinary number of issues with . +- The last straw is that it varies with the locale. Use libiberty's +- replacement instead. */ +-#include "safe-ctype.h" +- +-#include +- +-#include +- +-#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO +-extern int errno; +-#endif +- + #ifdef __cplusplus + #if defined (INCLUDE_ALGORITHM) || !defined (HAVE_SWAP_IN_UTILITY) + # include +@@ -243,6 +230,19 @@ extern int errno; + # include + # include + # include ++#endif ++ ++/* There are an extraordinary number of issues with . ++ The last straw is that it varies with the locale. Use libiberty's ++ replacement instead. */ ++#include "safe-ctype.h" ++ ++#include ++ ++#include ++ ++#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO ++extern int errno; + #endif + + /* Some of glibc's string inlines cause warnings. Plus we'd rather diff --git a/lang/gcc13-devel/files/patch-gcc_system.h b/lang/gcc13-devel/files/patch-gcc_system.h new file mode 100644 index 000000000000..b359d059c510 --- /dev/null +++ b/lang/gcc13-devel/files/patch-gcc_system.h @@ -0,0 +1,42 @@ +--- gcc/system.h.orig 2023-09-16 22:32:44 UTC ++++ gcc/system.h +@@ -203,19 +203,6 @@ extern int fprintf_unlocked (FILE *, const char *, ... + #endif + #endif + +-/* There are an extraordinary number of issues with . +- The last straw is that it varies with the locale. Use libiberty's +- replacement instead. */ +-#include "safe-ctype.h" +- +-#include +- +-#include +- +-#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO +-extern int errno; +-#endif +- + #ifdef __cplusplus + #if defined (INCLUDE_ALGORITHM) || !defined (HAVE_SWAP_IN_UTILITY) + # include +@@ -243,6 +230,19 @@ extern int errno; + # include + # include + # include ++#endif ++ ++/* There are an extraordinary number of issues with . ++ The last straw is that it varies with the locale. Use libiberty's ++ replacement instead. */ ++#include "safe-ctype.h" ++ ++#include ++ ++#include ++ ++#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO ++extern int errno; + #endif + + /* Some of glibc's string inlines cause warnings. Plus we'd rather diff --git a/lang/gcc13/files/patch-gcc_system.h b/lang/gcc13/files/patch-gcc_system.h new file mode 100644 index 000000000000..d31fb72931b5 --- /dev/null +++ b/lang/gcc13/files/patch-gcc_system.h @@ -0,0 +1,42 @@ +--- gcc/system.h.orig 2023-04-26 07:09:40 UTC ++++ gcc/system.h +@@ -203,19 +203,6 @@ extern int fprintf_unlocked (FILE *, const char *, ... + #endif + #endif + +-/* There are an extraordinary number of issues with . +- The last straw is that it varies with the locale. Use libiberty's +- replacement instead. */ +-#include "safe-ctype.h" +- +-#include +- +-#include +- +-#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO +-extern int errno; +-#endif +- + #ifdef __cplusplus + #if defined (INCLUDE_ALGORITHM) || !defined (HAVE_SWAP_IN_UTILITY) + # include +@@ -243,6 +230,19 @@ extern int errno; + # include + # include + # include ++#endif ++ ++/* There are an extraordinary number of issues with . ++ The last straw is that it varies with the locale. Use libiberty's ++ replacement instead. */ ++#include "safe-ctype.h" ++ ++#include ++ ++#include ++ ++#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO ++extern int errno; + #endif + + /* Some of glibc's string inlines cause warnings. Plus we'd rather diff --git a/lang/gcc14-devel/files/patch-gcc_system.h b/lang/gcc14-devel/files/patch-gcc_system.h new file mode 100644 index 000000000000..f7696f4625cb --- /dev/null +++ b/lang/gcc14-devel/files/patch-gcc_system.h @@ -0,0 +1,42 @@ +--- gcc/system.h.orig 2023-09-17 22:32:37 UTC ++++ gcc/system.h +@@ -203,19 +203,6 @@ extern int fprintf_unlocked (FILE *, const char *, ... + #endif + #endif + +-/* There are an extraordinary number of issues with . +- The last straw is that it varies with the locale. Use libiberty's +- replacement instead. */ +-#include "safe-ctype.h" +- +-#include +- +-#include +- +-#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO +-extern int errno; +-#endif +- + #ifdef __cplusplus + #if defined (INCLUDE_ALGORITHM) || !defined (HAVE_SWAP_IN_UTILITY) + # include +@@ -243,6 +230,19 @@ extern int errno; + # include + # include + # include ++#endif ++ ++/* There are an extraordinary number of issues with . ++ The last straw is that it varies with the locale. Use libiberty's ++ replacement instead. */ ++#include "safe-ctype.h" ++ ++#include ++ ++#include ++ ++#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO ++extern int errno; + #endif + + /* Some of glibc's string inlines cause warnings. Plus we'd rather