https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87858
--- Comment #6 from Matthew Krupcale <mkrupcale at matthewkrupcale dot com> --- (In reply to Andrew Pinski from comment #5) > Best way to support this really is to build a 4.8 cross compiler and then > build a canandian cross GCC 4.8 and then bootstrap a 4.8.x using that newly > build canandian cross compiler. I'm not sure I follow exactly because I wasn't trying to build a cross compiler, although I suppose once you have a GCC 4.8 compiler built (cross or not), you wouldn't have a problem building 4.8.x with it in theory. But the problem is building that initial GCC 4.8 (cross or not) with the newer GCC version. > New enough GCC uses -static-libstdc++ and that avoids the shared library > problem mentioned here. This won't help during stage1 of the bootstrap build if you don't have the static libstdc++ library installed on the build host. Once the static libstdc++ library is built, this problem won't happen during the later stages. For stage1, however, GCC will currently attempt to use the build host libstdc++ and its newer symbols for building host executables. When the old libstdc++ is built then--and in the absence of a static libstdc++ on the build host--the host executables will fail to load due to the old libstdc++ being on LD_LIBRARY_PATH and lacking the newer symbols required by the host executables. Note that as far as I'm aware, this issue still exists in modern versions of GCC and is not exclusive to building only GCC 4.8. As shown by comment 3 and comment 4, this problem is demonstrable by building GCC v8.2.1 or v10 with GCC 11 and possibly other versions. I was also able to confirm in comment 3 that my patch for GCC 8.2 did resolve the issue when building with GCC 11.