[Bug bootstrap/105688] Cannot build GCC 11.3 on Fedora 36
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105688 --- Comment #28 from Artem S. Tashkinov --- (In reply to Jonathan Wakely from comment #27) > (In reply to Artem S. Tashkinov from comment #25) > > Can you please try with the script I posted in comment #4? > > That works fine on F35 and F36. I've just tried again, the result is the same. I have 100% standard Fedora 36 (sans a few custom environment variables defined - see below, nothing GCC related) with all the updates installed. The below commands are all run under the root user (not sudo, an actual login under root). # md5sum gcc-11.3.0.tar.xz 4ee3e8c4c99e7b3444eb79f00f5f7a7e gcc-11.3.0.tar.xz # ld --version GNU gold (version 2.37-27.fc36) 1.16 # gcc --version gcc (GCC) 12.1.1 20220507 (Red Hat 12.1.1-1) # ./build.sh ... skipped ... libtool: compile: /tmp/OBJDIR/./gcc/xgcc -shared-libgcc -B/tmp/OBJDIR/./gcc -nostdinc++ -L/tmp/OBJDIR/x86_64-pc-linux-gnu/32/libstdc++-v3/src -L/tmp/OBJDIR/x86_64-pc-linux-gnu/32/libstdc++-v3/src/.libs -L/tmp/OBJDIR/x86_64-pc-linux-gnu/32/libstdc++-v3/libsupc++/.libs -B/opt/gcc/x86_64-pc-linux-gnu/bin/ -B/opt/gcc/x86_64-pc-linux-gnu/lib/ -isystem /opt/gcc/x86_64-pc-linux-gnu/include -isystem /opt/gcc/x86_64-pc-linux-gnu/sys-include -fno-checking -m32 -I/tmp/OBJDIR/x86_64-pc-linux-gnu/32/libstdc++-v3/include/x86_64-pc-linux-gnu -I/tmp/OBJDIR/x86_64-pc-linux-gnu/32/libstdc++-v3/include -I/tmp/gcc-11.3.0/libstdc++-v3/libsupc++ -std=gnu++98 -fPIC -DPIC -fno-implicit-templates -Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi=2 -fdiagnostics-show-location=once -ffunction-sections -fdata-sections -frandom-seed=compatibility.lo -g -O2 -pipe -mtune=generic -D_GNU_SOURCE -m32 -fcf-protection -mshstk -c /tmp/gcc-11.3.0/libstdc++-v3/src/c++98/compatibility.cc -o compatibility.o >/dev/null 2>&1 /bin/sh ../libtool --tag CXX --mode=link /tmp/OBJDIR/./gcc/xgcc -shared-libgcc -B/tmp/OBJDIR/./gcc -nostdinc++ -L/tmp/OBJDIR/x86_64-pc-linux-gnu/32/libstdc++-v3/src -L/tmp/OBJDIR/x86_64-pc-linux-gnu/32/libstdc++-v3/src/.libs -L/tmp/OBJDIR/x86_64-pc-linux-gnu/32/libstdc++-v3/libsupc++/.libs -B/opt/gcc/x86_64-pc-linux-gnu/bin/ -B/opt/gcc/x86_64-pc-linux-gnu/lib/ -isystem /opt/gcc/x86_64-pc-linux-gnu/include -isystem /opt/gcc/x86_64-pc-linux-gnu/sys-include -fno-checking -m32 -Wl,-O1 -Wl,-z,relro -Wl,--gc-sections -std=gnu++98 -fPIC -DPIC -fno-implicit-templates -Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi=2 -fdiagnostics-show-location=once -ffunction-sections -fdata-sections -frandom-seed=libstdc++.la '-m32' -o libstdc++.la -version-info 6:29:0 -Wl,--version-script=libstdc++-symbols.ver -lm -rpath /opt/gcc/lib/../lib compatibility.lo compatibility-debug_list.lo compatibility-debug_list-2.lo compatibility-c++0x.lo compatibility-atomic-c++0x.lo compatibility-thread-c++0x.lo compatibility-chrono.lo compatibility-condvar.lo ../libsupc++/libsupc++convenience.la ../src/c++98/libc++98convenience.la ../src/c++11/libc++11convenience.la ../src/c++17/libc++17convenience.la ../src/c++20/libc++20convenience.la libtool: link: /tmp/OBJDIR/./gcc/xgcc -shared-libgcc -B/tmp/OBJDIR/./gcc -nostdinc++ -L/tmp/OBJDIR/x86_64-pc-linux-gnu/32/libstdc++-v3/src -L/tmp/OBJDIR/x86_64-pc-linux-gnu/32/libstdc++-v3/src/.libs -L/tmp/OBJDIR/x86_64-pc-linux-gnu/32/libstdc++-v3/libsupc++/.libs -B/opt/gcc/x86_64-pc-linux-gnu/bin/ -B/opt/gcc/x86_64-pc-linux-gnu/lib/ -isystem /opt/gcc/x86_64-pc-linux-gnu/include -isystem /opt/gcc/x86_64-pc-linux-gnu/sys-include -fno-checking -m32 -fPIC -DPIC -D_GLIBCXX_SHARED -shared -nostdlib /lib/../lib/crti.o /tmp/OBJDIR/./gcc/32/crtbeginS.o .libs/compatibility.o .libs/compatibility-debug_list.o .libs/compatibility-debug_list-2.o .libs/compatibility-c++0x.o .libs/compatibility-atomic-c++0x.o .libs/compatibility-thread-c++0x.o .libs/compatibility-chrono.o .libs/compatibility-condvar.o -Wl,--whole-archive ../libsupc++/.libs/libsupc++convenience.a ../src/c++98/.libs/libc++98convenience.a ../src/c++11/.libs/libc++11convenience.a ../src/c++17/.libs/libc++17convenience.a ../src/c++20/.libs/libc++20convenience.a -Wl,--no-whole-archive -L/tmp/OBJDIR/x86_64-pc-linux-gnu/32/libstdc++-v3/libsupc++/.libs -L/tmp/OBJDIR/x86_64-pc-linux-gnu/32/libstdc++-v3/src -L/tmp/OBJDIR/x86_64-pc-linux-gnu/32/libstdc++-v3/src/.libs -lm -L/tmp/OBJDIR/./gcc/32 -L/lib/../lib -L/usr/lib/../lib -L/tmp/OBJDIR/./gcc -lc -lgcc_s /tmp/OBJDIR/./gcc/32/crtendS.o /lib/../lib/crtn.o -m32 -Wl,-O1 -Wl,-z -Wl,relro -Wl,--gc-sections -m32 -Wl,--version-script=libstdc++-symbols.ver -Wl,-soname -Wl,libstdc++.so.6 -o .libs/libstdc++.so.6.0.29 /usr/bin/ld: /tmp/OBJDIR/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /usr/bin/ld) collect2: error: ld returned 1 exit status make[10]: *** [Makefile:732: libstdc++.la] Error 1 make[10]: Leaving directory '/tmp/OBJDIR/x86_64-pc-linux-gnu/32/libstdc++-v3/src' make[9]: *** [Makefile:765: all-recursive] Error 1 make[9]: Leaving directory
[Bug bootstrap/105688] Cannot build GCC 11.3 on Fedora 36
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105688 --- Comment #27 from Jonathan Wakely --- (In reply to Artem S. Tashkinov from comment #25) > Can you please try with the script I posted in comment #4? That works fine on F35 and F36.
[Bug bootstrap/105688] Cannot build GCC 11.3 on Fedora 36
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105688 --- Comment #26 from Vincent Lefèvre --- (In reply to Jonathan Wakely from comment #23) > (In reply to Vincent Lefèvre from comment #21) > > I suppose that LD_LIBRARY_PATH is set because it is needed in order to use > > built libraries. > > It is not needed except when running the testsuite, and should not be set. Indeed, for most projects. IIRC, for some project (was it Subversion?), using built libraries was needed also during a part of the build, but that said, since this is rather specific, this is probably not a reason to change LD_LIBRARY_PATH globally, in case this is what libtool does. (In reply to Sam James from comment #24) > (In reply to Vincent Lefèvre from comment #21) > > I have a similar issue under Debian/unstable with GCC old of a few months, > > where in x86_64-pc-linux-gnu/libstdc++-v3/po, msgfmt fails with an error > > like > > > > /usr/bin/msgfmt: > > /home/vlefevre/software/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs/ > > libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by > > /usr/lib/x86_64-linux-gnu/libicuuc.so.71) > > This issue is, I think, slightly different: https://bugs.gentoo.org/843119. I think that the cause is the same (and the fix should be the same): LD_LIBRARY_PATH is changed somewhere to point to some build directories. As mentioned by https://bugs.gentoo.org/843119#c10 this shouldn't be done there. > It might end up being related but I've only ever seen *that* issue in the > context of installing libstdc++ when doing the gcc build when NLS is enabled > and using a newer GCC to do the build of an older version. While disabling NLS (Gentoo's fix) would be OK for most testing of older GCC, I doubt that this is the right solution.
[Bug bootstrap/105688] Cannot build GCC 11.3 on Fedora 36
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105688 --- Comment #25 from Artem S. Tashkinov --- (In reply to Jonathan Wakely from comment #22) > (In reply to Artem S. Tashkinov from comment #19) > > I'm curious: Fedora 36 takes probably half an hour to be downloaded and > > installed in a VM/chroot/etc., so you could probably debug the issue in a > > few minutes ;-) > > GCC 11.3 builds fine for me on F36. Can you please try with the script I posted in comment #4?
[Bug bootstrap/105688] Cannot build GCC 11.3 on Fedora 36
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105688 --- Comment #24 from Sam James --- (In reply to Vincent Lefèvre from comment #21) > I have a similar issue under Debian/unstable with GCC old of a few months, > where in x86_64-pc-linux-gnu/libstdc++-v3/po, msgfmt fails with an error like > > /usr/bin/msgfmt: > /home/vlefevre/software/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs/ > libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by > /usr/lib/x86_64-linux-gnu/libicuuc.so.71) > This issue is, I think, slightly different: https://bugs.gentoo.org/843119. It might end up being related but I've only ever seen *that* issue in the context of installing libstdc++ when doing the gcc build when NLS is enabled and using a newer GCC to do the build of an older version.
[Bug bootstrap/105688] Cannot build GCC 11.3 on Fedora 36
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105688 --- Comment #23 from Jonathan Wakely --- (In reply to Vincent Lefèvre from comment #21) > I suppose that LD_LIBRARY_PATH is set because it is needed in order to use > built libraries. It is not needed except when running the testsuite, and should not be set.
[Bug bootstrap/105688] Cannot build GCC 11.3 on Fedora 36
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105688 --- Comment #22 from Jonathan Wakely --- (In reply to Artem S. Tashkinov from comment #19) > I'm curious: Fedora 36 takes probably half an hour to be downloaded and > installed in a VM/chroot/etc., so you could probably debug the issue in a > few minutes ;-) GCC 11.3 builds fine for me on F36.
[Bug bootstrap/105688] Cannot build GCC 11.3 on Fedora 36
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105688 --- Comment #21 from Vincent Lefèvre --- I have a similar issue under Debian/unstable with GCC old of a few months, where in x86_64-pc-linux-gnu/libstdc++-v3/po, msgfmt fails with an error like /usr/bin/msgfmt: /home/vlefevre/software/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /usr/lib/x86_64-linux-gnu/libicuuc.so.71) A msgfmt wrapper with "printenv LD_LIBRARY_PATH" shows that LD_LIBRARY_PATH is set to /home/vlefevre/software/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs:/home/vlefevre/software/gcc-build/x86_64-pc-linux-gnu/libsanitizer/.libs:/home/vlefevre/software/gcc-build/x86_64-pc-linux-gnu/libvtv/.libs:/home/vlefevre/software/gcc-build/x86_64-pc-linux-gnu/libssp/.libs:/home/vlefevre/software/gcc-build/x86_64-pc-linux-gnu/libgomp/.libs:/home/vlefevre/software/gcc-build/x86_64-pc-linux-gnu/libitm/.libs:/home/vlefevre/software/gcc-build/x86_64-pc-linux-gnu/libatomic/.libs:/home/vlefevre/software/gcc-build/./gcc:/home/vlefevre/software/gcc-build/./prev-gcc This bug is probably still present in master: I do not get any failure, probably because the built libstdc++.so.6 is recent enough to be similar to the one currently provided by Debian/unstable, but the wrapper still shows that LD_LIBRARY_PATH is set to the above string (or similar), so that the bug could still occur when the system libstdc++.so.6 gets something new. I suppose that LD_LIBRARY_PATH is set because it is needed in order to use built libraries. But perhaps that instead, a run path should be used together with --disable-new-dtags (so that it overrides the user's LD_LIBRARY_PATH).
[Bug bootstrap/105688] Cannot build GCC 11.3 on Fedora 36
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105688 --- Comment #20 from Andrew Pinski --- Note gcc sources have its own local copy of libtool so it does not matter what the distros have.
[Bug bootstrap/105688] Cannot build GCC 11.3 on Fedora 36
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105688 --- Comment #19 from Artem S. Tashkinov --- I'm curious: Fedora 36 takes probably half an hour to be downloaded and installed in a VM/chroot/etc., so you could probably debug the issue in a few minutes ;-)
[Bug bootstrap/105688] Cannot build GCC 11.3 on Fedora 36
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105688 --- Comment #18 from Artem S. Tashkinov --- (In reply to Sam James from comment #17) > libtool recently got a new maintainer and had a new release (2.4.7). It's > possible 2.4.7 is related. Fedora 36 still features an old version: libtool-2.4.6-50.fc36.x86_64 Here's its changelog: https://src.fedoraproject.org/rpms/libtool/commits/f36
[Bug bootstrap/105688] Cannot build GCC 11.3 on Fedora 36
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105688 Sam James changed: What|Removed |Added CC||toolchain at gentoo dot org --- Comment #17 from Sam James --- libtool recently got a new maintainer and had a new release (2.4.7). It's possible 2.4.7 is related.
[Bug bootstrap/105688] Cannot build GCC 11.3 on Fedora 36
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105688 --- Comment #16 from Andrew Pinski --- (In reply to Artem S. Tashkinov from comment #14) > Created attachment 53022 [details] > lddebug.tar.xz Thanks this confirms that it is working like it should be and something is setting LD_LIBRARY_PATH when it should not be ... It definitely looks like a libtool issue. libtool is almost not maintained either ...
[Bug bootstrap/105688] Cannot build GCC 11.3 on Fedora 36
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105688 --- Comment #15 from Andrew Pinski --- Hmm, now this might be a libtool issue
[Bug bootstrap/105688] Cannot build GCC 11.3 on Fedora 36
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105688 --- Comment #14 from Artem S. Tashkinov --- Created attachment 53022 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53022=edit lddebug.tar.xz (In reply to Andrew Pinski from comment #13) > Can you run the following command: > > In /tmp/OBJDIR/x86_64-pc-linux-gnu/32/libstdc++-v3/src directory and provide > the ldout.* files? >
[Bug bootstrap/105688] Cannot build GCC 11.3 on Fedora 36
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105688 --- Comment #13 from Andrew Pinski --- Can you run the following command: LD_DEBUG=all LD_DEBUG_OUTPUT=ldout /tmp/OBJDIR/./gcc/xgcc -shared-libgcc -B/tmp/OBJDIR/./gcc -nostdinc++ -L/tmp/OBJDIR/x86_64-pc-linux-gnu/32/libstdc++-v3/src -L/tmp/OBJDIR/x86_64-pc-linux-gnu/32/libstdc++-v3/src/.libs -L/tmp/OBJDIR/x86_64-pc-linux-gnu/32/libstdc++-v3/libsupc++/.libs -B/opt/gcc/x86_64-pc-linux-gnu/bin/ -B/opt/gcc/x86_64-pc-linux-gnu/lib/ -isystem /opt/gcc/x86_64-pc-linux-gnu/include -isystem /opt/gcc/x86_64-pc-linux-gnu/sys-include -fno-checking -m32 -fPIC -DPIC -D_GLIBCXX_SHARED -shared -nostdlib /lib/../lib/crti.o /tmp/OBJDIR/./gcc/32/crtbeginS.o .libs/compatibility.o .libs/compatibility-debug_list.o .libs/compatibility-debug_list-2.o .libs/compatibility-c++0x.o .libs/compatibility-atomic-c++0x.o .libs/compatibility-thread-c++0x.o .libs/compatibility-chrono.o .libs/compatibility-condvar.o -Wl,--whole-archive ../libsupc++/.libs/libsupc++convenience.a ../src/c++98/.libs/libc++98convenience.a ../src/c++11/.libs/libc++11convenience.a ../src/c++17/.libs/libc++17convenience.a ../src/c++20/.libs/libc++20convenience.a -Wl,--no-whole-archive -L/tmp/OBJDIR/x86_64-pc-linux-gnu/32/libstdc++-v3/libsupc++/.libs -L/tmp/OBJDIR/x86_64-pc-linux-gnu/32/libstdc++-v3/src -L/tmp/OBJDIR/x86_64-pc-linux-gnu/32/libstdc++-v3/src/.libs -lm -L/tmp/OBJDIR/./gcc/32 -L/lib/../lib -L/usr/lib/../lib -L/tmp/OBJDIR/./gcc -lc -lgcc_s /tmp/OBJDIR/./gcc/32/crtendS.o /lib/../lib/crtn.o -m32 -Wl,-O1 -Wl,-z -Wl,relro -Wl,--gc-sections -m32 -Wl,--version-script=libstdc++-symbols.ver -Wl,-soname -Wl,libstdc++.so.6 -o .libs/libstdc++.so.6.0.29 In /tmp/OBJDIR/x86_64-pc-linux-gnu/32/libstdc++-v3/src directory and provide the ldout.* files? I don't see anywhere where the /tmp/OBJDIR/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs/ directory should have been added. There should be no way the 32bit mutli-lib is referencing the libraries in the 64bit multi-lib directory at this point.
[Bug bootstrap/105688] Cannot build GCC 11.3 on Fedora 36
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105688 Alexander Monakov changed: What|Removed |Added CC||amonakov at gcc dot gnu.org --- Comment #12 from Alexander Monakov --- (In reply to Andrew Pinski from comment #7) > /usr/bin/ld: > /tmp/OBJDIR/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6: > version `GLIBCXX_3.4.30' not found (required by /usr/bin/ld) > > > The problem is not realted to GCC directly but rather ld being linked > against a newer version of libstdc++ and now you just compiled an older > version of libstdc++ and that is in the LD_LIBRARY_PATH some how ... Which > should not happen Could libtool be erroneously populating LD_LIBRARY_PATH? > If anything this should be reported to binutils and have ld (I suspect gold > here) use -static-libstdc++ -static-libgcc while linking just the same way > GCC does. No, this doesn't make sense, ld shouldn't work around wrong LD_LIBRARY_PATH setting.
[Bug bootstrap/105688] Cannot build GCC 11.3 on Fedora 36
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105688 --- Comment #11 from Artem S. Tashkinov --- Created attachment 53020 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53020=edit gcc-11.3.0.build.log.xz
[Bug bootstrap/105688] Cannot build GCC 11.3 on Fedora 36
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105688 --- Comment #10 from Artem S. Tashkinov --- (In reply to Andrew Pinski from comment #8) > Do you have the full log? The full build log? I can generate one right away. (In reply to Andrew Pinski from comment #9) > Also can you provide the full output of "env" ? # env SHELL=/bin/bash HOSTNAME=fedora PWD=/root LOGNAME=root HOME=/root LANG=en_US.UTF-8 XDG_CACHE_HOME=/var/tmp/xdgcache-root TERM=xterm-256color LESSOPEN=||/usr/bin/lesspipe.sh %s USER=root SHLVL=1 DEBUGINFOD_URLS=https://debuginfod.fedoraproject.org/ which_declare=declare -f PATH=/root/.local/bin:/root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/opt/wine/bin MAIL=/var/spool/mail/root BASH_FUNC_which%%=() { ( alias; eval ${which_declare} ) | /usr/bin/which --tty-only --read-alias --read-functions --show-tilde --show-dot $@ } _=/usr/bin/env
[Bug bootstrap/105688] Cannot build GCC 11.3 on Fedora 36
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105688 --- Comment #9 from Andrew Pinski --- Also can you provide the full output of "env" ?
[Bug bootstrap/105688] Cannot build GCC 11.3 on Fedora 36
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105688 Andrew Pinski changed: What|Removed |Added Ever confirmed|0 |1 Status|UNCONFIRMED |WAITING Last reconfirmed|2022-05-22 00:00:00 |2022-05-23 Component|c |bootstrap --- Comment #8 from Andrew Pinski --- Do you have the full log?