GCC fails to compile with libc++ 17 due to <vector> now implicitly including <locale> (https://github.com/llvm/llvm-project/commit/7e6bcb35a8116a653e4cdf660643e80459c5efce). The first issue is in system.h, where safe-ctype.h from libiberty gets included before <vector>, which causes an error because <locale> uses toupper and tolower, which safe-ctype.h just #defines to "do_not_use_isprint_with_safe_ctype." The second error is present in libcc1plugin.cc and libcp1plugin.cc, and is caused by some GCC header (not sure which) poisoning malloc and realloc, which <locale> also uses. This can be fixed by moving the <vector> include above the other includes in the afformentioned files (patch attached). Steps to reproduce: - Use LLVM profile - Install libc++ 17 - emerge -av sys-devel/gcc
Created attachment 867578 [details, diff] patch
Created attachment 867579 [details] build.log
Created attachment 867580 [details] build.log actually run through ansifilter (sorry sam)
Huh, I somehow missed this at the time..
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=60527e9c220e351f084106f80b836c2048cea8ee commit 60527e9c220e351f084106f80b836c2048cea8ee Author: Sam James <sam@gentoo.org> AuthorDate: 2023-10-01 02:26:04 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-10-01 02:26:04 +0000 sys-devel/gcc: add 13.2.1_p20230930 Bug: https://bugs.gentoo.org/912035 Signed-off-by: Sam James <sam@gentoo.org> sys-devel/gcc/Manifest | 2 + sys-devel/gcc/gcc-13.2.1_p20230930.ebuild | 65 +++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=9e320b0781c3505e9f6ff49b84f5b35d6016c653 commit 9e320b0781c3505e9f6ff49b84f5b35d6016c653 Author: Sam James <sam@gentoo.org> AuthorDate: 2023-10-01 01:50:47 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-10-01 02:28:48 +0000 13.2.0: add 50_all_PR111632_system_cxx_headers_libcxx.patch Bug: https://gcc.gnu.org/PR111632 Bug: https://bugs.gentoo.org/912035 Signed-off-by: Sam James <sam@gentoo.org> ...50_all_PR111632_system_cxx_headers_libcxx.patch | 134 +++++++++++++++++++++ 13.2.0/gentoo/README.history | 1 + 2 files changed, 135 insertions(+)
*** Bug 915652 has been marked as a duplicate of this bug. ***
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=62544765c5b0fdd996522ac756afbc8e9ac2c703 commit 62544765c5b0fdd996522ac756afbc8e9ac2c703 Author: Sam James <sam@gentoo.org> AuthorDate: 2023-10-15 15:52:53 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-10-15 15:52:58 +0000 sys-devel/gcc: keyword 13.2.1_p20231014 Closes: https://bugs.gentoo.org/912035 Bug: https://bugs.gentoo.org/914070 Signed-off-by: Sam James <sam@gentoo.org> sys-devel/gcc/gcc-13.2.1_p20231014.ebuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
This hasn't been fully fixed, as discussed on IRC. Attached patch should completely fix the issues.
Created attachment 883744 [details, diff] patch
AFAIK this should be fixed now for real on all branches.