Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 912035 - sys-devel/gcc: compilation failure with libc++ 17
Summary: sys-devel/gcc: compilation failure with libc++ 17
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords: PATCH, PullRequest
: 915652 (view as bug list)
Depends on:
Blocks: systemwide-libcxx 912821
  Show dependency tree
 
Reported: 2023-08-10 17:02 UTC by Violet Purcell
Modified: 2024-01-30 18:48 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch (libcxx-17.patch,1.08 KB, patch)
2023-08-10 17:03 UTC, Violet Purcell
Details | Diff
build.log (build.log.zst,97.24 KB, application/zstd)
2023-08-10 17:03 UTC, Violet Purcell
Details
build.log actually run through ansifilter (sorry sam) (build.log.zst,97.15 KB, application/zstd)
2023-08-10 17:13 UTC, Violet Purcell
Details
patch (50_all_PR111632_system_cxx_headers_libcxx.patch,7.96 KB, patch)
2024-01-30 18:48 UTC, Violet Purcell
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Violet Purcell 2023-08-10 17:02:44 UTC
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
Comment 1 Violet Purcell 2023-08-10 17:03:03 UTC
Created attachment 867578 [details, diff]
patch
Comment 2 Violet Purcell 2023-08-10 17:03:44 UTC
Created attachment 867579 [details]
build.log
Comment 3 Violet Purcell 2023-08-10 17:13:32 UTC
Created attachment 867580 [details]
build.log actually run through ansifilter (sorry sam)
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-09-23 13:32:36 UTC
Huh, I somehow missed this at the time..
Comment 5 Larry the Git Cow gentoo-dev 2023-10-01 02:26:26 UTC
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(+)
Comment 6 Larry the Git Cow gentoo-dev 2023-10-01 02:28:51 UTC
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(+)
Comment 7 Arsen Arsenović gentoo-dev 2023-10-12 21:17:46 UTC
*** Bug 915652 has been marked as a duplicate of this bug. ***
Comment 8 Larry the Git Cow gentoo-dev 2023-10-15 15:53:35 UTC
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(-)
Comment 9 Violet Purcell 2024-01-30 18:47:25 UTC
This hasn't been fully fixed, as discussed on IRC. Attached patch should completely fix the issues.
Comment 10 Violet Purcell 2024-01-30 18:48:26 UTC
Created attachment 883744 [details, diff]
patch