https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67092
Bug ID: 67092 Summary: bootstrap failure with CFLAGS/CXXFLAGS/BOOT_CFLAGS="-O0 -g" in running genpreds Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: other Assignee: unassigned at gcc dot gnu.org Reporter: vries at gcc dot gnu.org Target Milestone: --- While doing a bootstrap with CFLAGS/CXXFLAGS/BOOT_CFLAGS="-O0 -g", I run into the following problem in stage2: ... build/genpreds: /usr/local/tools/gcc-4.7.3/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by build/genpreds) build/genpreds: /usr/local/tools/gcc-4.7.3/lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by build/genpreds) make[3]: *** [s-constrs-h] Error 1 ... While building stage2 genpreds, we link in the stage1 libstdc++ libs: ... obj/gcc-mainline-0-x86_64-unknown-linux-gnu-x86_64-unknown-linux-gnu/./prev-gcc/xg++ -Bobj/gcc-mainline-0-x86_64-unknown-linux-gnu-x86_64-unknown-linux-gnu/./prev-gcc/ -Binstall/x86_64-unknown-linux-gnu/bin/ -nostdinc++ -Bobj/gcc-mainline-0-x86_64-unknown-linux-gnu-x86_64-unknown-linux-gnu/prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs -Bobj/gcc-mainline-0-x86_64-unknown-linux-gnu-x86_64-unknown-linux-gnu/prev-x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs -Iobj/gcc-mainline-0-x86_64-unknown-linux-gnu-x86_64-unknown-linux-gnu/prev-x86_64-unknown-linux-gnu/libstdc++-v3/include/x86_64-unknown-linux-gnu -Iobj/gcc-mainline-0-x86_64-unknown-linux-gnu-x86_64-unknown-linux-gnu/prev-x86_64-unknown-linux-gnu/libstdc++-v3/include -Isrc/gcc-mainline/libstdc++-v3/libsupc++ -Lobj/gcc-mainline-0-x86_64-unknown-linux-gnu-x86_64-unknown-linux-gnu/prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs -Lobj/gcc-mainline-0-x86_64-unknown-linux-gnu-x86_64-unknown-linux-gnu/prev-x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs -g -O0 -gtoggle -DIN_GCC -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common -DHAVE_CONFIG_H -DGENERATOR_FILE -fno-PIE -no-pie -o build/genpreds build/genpreds.o build/rtl.o build/read-rtl.o build/ggc-none.o build/vec.o build/min-insn-modes.o build/gensupport.o build/print-rtl.o build/hash-table.o build/read-md.o build/errors.o .././libiberty/libiberty.a ... But while running genpreds, we use the libstdc++ from the system, or in this case the one found in LD_LIBRARY_PATH, which doesn't provide the version that was linked against, and genpreds fails to load.