Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GCC 14 (remove 9) #103

Merged
merged 1 commit into from
May 8, 2024
Merged

Add GCC 14 (remove 9) #103

merged 1 commit into from
May 8, 2024

Conversation

tianon
Copy link
Member

@tianon tianon commented May 7, 2024

No description provided.

@tianon
Copy link
Member Author

tianon commented May 7, 2024

2024-05-07T17:46:44.8305138Z �[91m+ bash -Eeuo pipefail -xc  		deb="$(strings /usr/lib/*/libstdc++.so* | grep "^GLIBC" | sort -u)"; 		gcc="$(strings /usr/local/lib*/libstdc++.so | grep "^GLIBC" | sort -u)"; 		diff="$(comm -23 <(cat <<<"$deb") <(cat <<<"$gcc"))"; 		test -z "$diff"; 	
2024-05-07T17:46:44.8306208Z �[0m�[91m++ grep '^GLIBC'
2024-05-07T17:46:44.8306475Z ++ sort -u
2024-05-07T17:46:44.8307052Z �[0m�[91m++ strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30
2024-05-07T17:46:44.8558771Z �[0m�[91m+ deb='GLIBCXX_3.4
2024-05-07T17:46:44.8560033Z GLIBCXX_3.4.1
2024-05-07T17:46:44.8564109Z GLIBCXX_3.4.10
2024-05-07T17:46:44.8568545Z GLIBCXX_3.4.11
2024-05-07T17:46:44.8568948Z GLIBCXX_3.4.12
2024-05-07T17:46:44.8569334Z GLIBCXX_3.4.13
2024-05-07T17:46:44.8569706Z GLIBCXX_3.4.14
2024-05-07T17:46:44.8570086Z GLIBCXX_3.4.15
2024-05-07T17:46:44.8570469Z GLIBCXX_3.4.16
2024-05-07T17:46:44.8570849Z GLIBCXX_3.4.17
2024-05-07T17:46:44.8571304Z GLIBCXX_3.4.18
2024-05-07T17:46:44.8571697Z GLIBCXX_3.4.19
2024-05-07T17:46:44.8572077Z GLIBCXX_3.4.2
2024-05-07T17:46:44.8572468Z GLIBCXX_3.4.20
2024-05-07T17:46:44.8572835Z GLIBCXX_3.4.21
2024-05-07T17:46:44.8573216Z GLIBCXX_3.4.22
2024-05-07T17:46:44.8573588Z GLIBCXX_3.4.23
2024-05-07T17:46:44.8575640Z GLIBCXX_3.4.24
2024-05-07T17:46:44.8576069Z GLIBCXX_3.4.25
2024-05-07T17:46:44.8576348Z GLIBCXX_3.4.26
2024-05-07T17:46:44.8576669Z GLIBCXX_3.4.27
2024-05-07T17:46:44.8576882Z GLIBCXX_3.4.28
2024-05-07T17:46:44.8577094Z GLIBCXX_3.4.29
2024-05-07T17:46:44.8577382Z GLIBCXX_3.4.3
2024-05-07T17:46:44.8577612Z GLIBCXX_3.4.30
2024-05-07T17:46:44.8577836Z GLIBCXX_3.4.4
2024-05-07T17:46:44.8578045Z GLIBCXX_3.4.5
2024-05-07T17:46:44.8578279Z GLIBCXX_3.4.6
2024-05-07T17:46:44.8578554Z GLIBCXX_3.4.7
2024-05-07T17:46:44.8578754Z GLIBCXX_3.4.8
2024-05-07T17:46:44.8578957Z GLIBCXX_3.4.9
2024-05-07T17:46:44.8579180Z GLIBCXX_DEBUG_MESSAGE_LENGTH
2024-05-07T17:46:44.8579450Z GLIBC_2.14
2024-05-07T17:46:44.8579672Z GLIBC_2.16
2024-05-07T17:46:44.8580131Z GLIBC_2.17
2024-05-07T17:46:44.8580320Z GLIBC_2.18
2024-05-07T17:46:44.8580519Z GLIBC_2.2.5
2024-05-07T17:46:44.8580722Z GLIBC_2.25
2024-05-07T17:46:44.8580908Z GLIBC_2.3
2024-05-07T17:46:44.8581101Z GLIBC_2.3.2
2024-05-07T17:46:44.8581303Z GLIBC_2.32
2024-05-07T17:46:44.8581507Z GLIBC_2.33
2024-05-07T17:46:44.8581872Z GLIBC_2.34
2024-05-07T17:46:44.8582086Z GLIBC_2.36
2024-05-07T17:46:44.8582414Z GLIBC_2.4
2024-05-07T17:46:44.8582609Z GLIBC_2.6'
2024-05-07T17:46:44.8582899Z �[0m�[91m++ grep '^GLIBC'
2024-05-07T17:46:44.8583273Z �[0m�[91m++ strings /usr/local/lib64/libstdc++.so
2024-05-07T17:46:44.8583646Z ++ sort -u
2024-05-07T17:46:44.8780997Z �[0m�[91m+ gcc='GLIBCXX_3.4
2024-05-07T17:46:44.8781505Z GLIBCXX_3.4.1
2024-05-07T17:46:44.8781872Z GLIBCXX_3.4.10
2024-05-07T17:46:44.8782417Z GLIBCXX_3.4.11
2024-05-07T17:46:44.8782763Z GLIBCXX_3.4.12
2024-05-07T17:46:44.8783109Z GLIBCXX_3.4.13
2024-05-07T17:46:44.8783459Z GLIBCXX_3.4.14
2024-05-07T17:46:44.8783802Z GLIBCXX_3.4.15
2024-05-07T17:46:44.8784150Z GLIBCXX_3.4.16
2024-05-07T17:46:44.8784493Z GLIBCXX_3.4.17
2024-05-07T17:46:44.8784853Z GLIBCXX_3.4.18
2024-05-07T17:46:44.8786086Z GLIBCXX_3.4.19
2024-05-07T17:46:44.8786468Z GLIBCXX_3.4.2
2024-05-07T17:46:44.8786844Z GLIBCXX_3.4.20
2024-05-07T17:46:44.8787199Z GLIBCXX_3.4.21
2024-05-07T17:46:44.8787547Z GLIBCXX_3.4.22
2024-05-07T17:46:44.8788582Z GLIBCXX_3.4.23
2024-05-07T17:46:44.8788980Z GLIBCXX_3.4.24
2024-05-07T17:46:44.8789338Z GLIBCXX_3.4.25
2024-05-07T17:46:44.8789691Z GLIBCXX_3.4.26
2024-05-07T17:46:44.8790051Z GLIBCXX_3.4.27
2024-05-07T17:46:44.8790405Z GLIBCXX_3.4.28
2024-05-07T17:46:44.8791721Z GLIBCXX_3.4.29
2024-05-07T17:46:44.8792159Z GLIBCXX_3.4.3
2024-05-07T17:46:44.8792517Z GLIBCXX_3.4.30
2024-05-07T17:46:44.8792889Z GLIBCXX_3.4.31
2024-05-07T17:46:44.8793276Z GLIBCXX_3.4.32
2024-05-07T17:46:44.8793635Z GLIBCXX_3.4.33
2024-05-07T17:46:44.8793996Z GLIBCXX_3.4.4
2024-05-07T17:46:44.8794356Z GLIBCXX_3.4.5
2024-05-07T17:46:44.8794718Z GLIBCXX_3.4.6
2024-05-07T17:46:44.8795082Z GLIBCXX_3.4.7
2024-05-07T17:46:44.8795440Z GLIBCXX_3.4.8
2024-05-07T17:46:44.8795899Z GLIBCXX_3.4.9
2024-05-07T17:46:44.8796301Z GLIBCXX_DEBUG_MESSAGE_LENGTH
2024-05-07T17:46:44.8796783Z GLIBCXX_TUNABLES
2024-05-07T17:46:44.8797170Z GLIBC_2.14
2024-05-07T17:46:44.8797517Z GLIBC_2.17
2024-05-07T17:46:44.8797864Z GLIBC_2.18
2024-05-07T17:46:44.8798204Z GLIBC_2.2.5
2024-05-07T17:46:44.8798548Z GLIBC_2.25
2024-05-07T17:46:44.8798886Z GLIBC_2.26
2024-05-07T17:46:44.8799242Z GLIBC_2.3
2024-05-07T17:46:44.8799585Z GLIBC_2.3.2
2024-05-07T17:46:44.8799967Z GLIBC_2.32
2024-05-07T17:46:44.8800308Z GLIBC_2.33
2024-05-07T17:46:44.8800626Z GLIBC_2.34
2024-05-07T17:46:44.8800970Z GLIBC_2.36
2024-05-07T17:46:44.8801830Z GLIBC_2.4
2024-05-07T17:46:44.8802195Z GLIBC_2.6'
2024-05-07T17:46:44.8802723Z �[0m�[91m++ comm -23 /dev/fd/63 /dev/fd/62
2024-05-07T17:46:44.8803332Z �[0m�[91m+++ cat
2024-05-07T17:46:44.8803650Z �[0m�[91m+++ cat
2024-05-07T17:46:44.8803907Z �[0m�[91m+ diff=GLIBC_2.16
2024-05-07T17:46:44.8804214Z + test -z GLIBC_2.16
2024-05-07T17:46:44.9992858Z The command '/bin/sh -c set -ex; 	{ echo '/usr/local/lib64'; echo '/usr/local/lib'; } > /etc/ld.so.conf.d/000-local-lib.conf; 	ldconfig -v; 	bash -Eeuo pipefail -xc ' 		deb="$(strings /usr/lib/*/libstdc++.so* | grep "^GLIBC" | sort -u)"; 		gcc="$(strings /usr/local/lib*/libstdc++.so | grep "^GLIBC" | sort -u)"; 		diff="$(comm -23 <(cat <<<"$deb") <(cat <<<"$gcc"))"; 		test -z "$diff"; 	'' returned a non-zero code: 1

🤔

@tianon
Copy link
Member Author

tianon commented May 7, 2024

I clearly have no idea where to look because I can't find where the "GLIBC" ABI versions are in https://github.com/gcc-mirror/gcc (so I can try to trace the history and figure out why our builds of GCC 14 no longer support 2.16, which is probably expected but it'd still be good to understand 😭).

@kasperk81
Copy link
Contributor

libstdc++.so from gcc is missing GLIBC_2.16 symbol, but it has GLIBC_2.14 and GLIBC_2.17, GLIBC_2.18 etc. distro (debian) installed libstdc++.so has 2.16.

@andreas-schwab @jwakely do you have any insights why only 2.16 would be missing while 2.14 and 2.17 are present? (it's for main gcc:14 docker image)

@tianon
Copy link
Member Author

tianon commented May 7, 2024

Another interesting and useful data point is that GLIBC_2.16 is also missing from Debian Unstable's /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.33, which makes me feel a lot less like we're missing something important. 😄

@tianon
Copy link
Member Author

tianon commented May 7, 2024

Also unsurprising, but the same from /usr/lib/gcc/x86_64-linux-gnu/14/libstdc++.so (from libstdc++-14-dev), so I think we're probably OK and should update our test for this case. 🤔

@kasperk81
Copy link
Contributor

sounds good. a filter in system libstdc++ symbols list would do it.
https://github.com/infosiftr/gcc/blob/59d6ce103823b2eadd58d20b3c1506080abc0bc7/14/Dockerfile#L139

-		deb="$(strings /usr/lib/*/libstdc++.so* | grep "^GLIBC" | sort -u)"; \
+		deb="$(strings /usr/lib/*/libstdc++.so* | grep "^GLIBC" | grep -v "GLIBC_2.16" | sort -u)"; \

@kasperk81
Copy link
Contributor

yay, it's green! :shipit:

@jwakely
Copy link

jwakely commented May 8, 2024

libstdc++.so from gcc is missing GLIBC_2.16 symbol

It never had that symbol, that's not something defined in libstdc++.so, you're seeing a dependency from libstdc++.so on a symbol defined by glibc.

Using strings is a really bad way to look at what symbols a library provides, I don't know what that command is even trying to do.

@kasperk81
Copy link
Contributor

It never had that symbol, that's not something defined in libstdc++.so, you're seeing a dependency from libstdc++.so on a symbol defined by glibc.

thanks, if libstdc++'s build does not explicitly add GLIBC_XX symbols it's worth looking into glibc sources. we were thinking that it might not be intentional and it could be reported it as a bug (as this might be the first time in v14 cycle, since v13 release, which has caught it).

I don't know what that command is even trying to do.

that command collects a list of symbols insystem installed libstdc++ (from Debian distro package) and one from compiled gcc, then compare them, if there is a difference the sanity test fails.

Using strings is a really bad way to look at what symbols a library provides, I don't know what that command is even trying to do.

i agree we should be using nm, readelf or objdump etc. but as bad strings(1) maybe, this test was passing for various previous releases and it's the first time this difference is found (@tianon can correct me).

@jwakely
Copy link

jwakely commented May 8, 2024

thanks, if libstdc++'s build does not explicitly add GLIBC_XX symbols it's worth looking into glibc sources. we were thinking that it might not be intentional and it could be reported it as a bug

It's not a bug for libstdc++ to go from depending on e.g. memcpy@GLIBC_2.17 to memcpy@GLIBC_2.38 which would cause the change you're seeing. Depending on fewer symbols is not a problem!

If you used nm to compare the symbols instead of strings, you would be able to tell whether the "missing" symbol is something that libstdc++.so was supposed to export, or something it depends on that comes from elsewhere. Even better would be to use https://sourceware.org/libabigail/ which is explicitly designed for doing such comparisons.

@tianon
Copy link
Member Author

tianon commented May 8, 2024

Nice, thank you!! Yeah, strings was just the very quick-and-dirty way to make sure we didn't regress on past issues we've had packaging something like GCC 9 into a distro using a newer version (and thus breaking the ABI of libstdc++ for distro-provided applications 😭).

We definitely should switch that to something more purpose-suited 😅 ❤️ (and then remove our new special case! 🚀)

Really, really appreciate the added input/discussion/explanation! ❤️

@tianon tianon merged commit 28c22d3 into docker-library:master May 8, 2024
7 checks passed
@tianon tianon deleted the 14 branch May 8, 2024 17:06
tianon added a commit that referenced this pull request May 8, 2024
(follow-up to #103)
docker-library-bot added a commit to docker-library-bot/official-images that referenced this pull request May 8, 2024
Changes:

- docker-library/gcc@6d49ef0: Update latest to 14
- docker-library/gcc@28c22d3: Merge pull request docker-library/gcc#103 from infosiftr/14
- docker-library/gcc@243999e: Add GCC 14 (remove 9)
docker-library-bot added a commit to docker-library-bot/official-images that referenced this pull request May 8, 2024
Changes:

- docker-library/gcc@478283b: Merge pull request docker-library/gcc#104 from infosiftr/abigail
- docker-library/gcc@b1e7fc6: Use `abidiff` to verify ABI compatibility
- docker-library/gcc@6d49ef0: Update latest to 14
- docker-library/gcc@28c22d3: Merge pull request docker-library/gcc#103 from infosiftr/14
- docker-library/gcc@243999e: Add GCC 14 (remove 9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants