FS#79376 - [gcc12] incompatible ABI with glibc 2.38

Attached to Project: Arch Linux
Opened by Jakub Klinkovský (lahwaacz) - Monday, 14 August 2023, 21:09 GMT
Last edited by Toolybird (Toolybird) - Tuesday, 15 August 2023, 06:39 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Sven-Hendrik Haase (Svenstaro)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

The gcc12 package was not rebuilt for the recent glibc 2.38 upgrade and it can't link any library built with the main gcc 13 due to ABI incompatibilities. The libstdc++.so contains only symbols up to GLIBCXX_3.4.30 (GLIBCXX_3.4.31 and GLIBCXX_3.4.32 are missing):

$ strings /usr/lib/gcc/x86_64-pc-linux-gnu/12.3.0/libstdc++.so | grep GLIBCXX
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_3.4.20
GLIBCXX_3.4.21
GLIBCXX_3.4.22
GLIBCXX_3.4.23
GLIBCXX_3.4.24
GLIBCXX_3.4.25
GLIBCXX_3.4.26
GLIBCXX_3.4.27
GLIBCXX_3.4.28
GLIBCXX_3.4.29
GLIBCXX_3.4.30

For some reason just rebuilding the gcc12 package did not solve it for me. Only making libs in /usr/lib/gcc/x86_64-pc-linux-gnu/12.3.0/ symlinks to those from the main gcc-libs package solved the problem and it is probably the easiest/most future-proof solution. See the attached patch (idea borrowed from the gcc11 package in AUR).
This task depends upon

Closed by  Toolybird (Toolybird)
Tuesday, 15 August 2023, 06:39 GMT
Reason for closing:  Fixed
Additional comments about closing:  gcc12 12.3.0-3
Comment by Jakub Klinkovský (lahwaacz) - Monday, 14 August 2023, 21:15 GMT
Actually the problem is not with linking *any* library, just those that have symbols with incompatible ABI. An example is libmpi_cxx from the openmpi package:

$ g++-12 test.cpp -lmpi_cxx
/usr/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/12.3.0/../../../../lib/libmpi_cxx.so: undefined reference to `std::ios_base_library_init()@GLIBCXX_3.4.32'
collect2: error: ld returned 1 exit status
Comment by Sven-Hendrik Haase (Svenstaro) - Monday, 14 August 2023, 22:50 GMT
Thanks, pushed to testing. Please check.
Comment by Jakub Klinkovský (lahwaacz) - Tuesday, 15 August 2023, 06:09 GMT
It works as far as I could test. Thanks for taking care of it.

Loading...