https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109231
--- Comment #15 from Jakub Jelinek <jakub at gcc dot gnu.org> --- So, after installing gcc 11 I've tried PATH=/export/home/jakub/gcc-11-inst/bin:$PATH LD_LIBRARY_PATH=/export/home/jakub/gcc-11-inst/lib/ ../configure --prefix=/export/home/jakub/gcc-inst --enable-languages=c,c++,d --disable-libssp --disable-libsanitizer --disable-nls --with-gmp=/opt/csw --with-ld=/usr/ccs/bin/ld --without-gnu-ld --with-as=/opt/csw/bin/gas --with-gnu-as --with-libiconv-prefix=/opt/csw --with-mpfr=/opt/csw --enable-libphobos --disable-multilib --enable-obsolete PATH=/export/home/jakub/gcc-11-inst/bin:$PATH LD_LIBRARY_PATH=/export/home/jakub/gcc-11-inst/lib/ gmake -j16 > LOG 2>&1 but that failed miserably during stage1: g++ -std=c++11 -no-pie -g -DIN_GCC -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wmissing-format-attribute -Wconditionally-supported -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common -DHAVE_CONFIG_H -static-libstdc++ -static-libgcc -o lto1 lto/lto-lang.o lto/lto.o lto/lto-object.o attribs.o lto/lto-partition.o lto/lto-symtab.o lto/lto-common.o libbackend.a main.o libcommon-target.a libcommon.a ../libcpp/libcpp.a ../libdecnumber/libdecnumber.a -lisl -L/opt/csw/lib -L/opt/csw/lib -lmpc -lmpfr -lgmp -L./../zlib -lz libcommon.a ../libcpp/libcpp.a /opt/csw/lib/libiconv.so -R/opt/csw/lib ../libbacktrace/.libs/libbacktrace.a ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a Undefined first referenced symbol in file _ZSt28__throw_bad_array_new_lengthv libbackend.a(auto-profile.o) ld: fatal: symbol referencing errors collect2: error: ld returned 1 exit status gmake[3]: *** [../../gcc/lto/Make-lang.in:96: lto1] Error 1 Strangely, /export/home/jakub/gcc-11-inst/lib/gcc/sparc*/11*/ directory only contains *.a libraries and no *.so symlinks, I've linked there ../../../lib*.so but it still fails with that. Is that because the various --with-*=/opt/csw options added -L/opt/csw/lib and that directory contains the oldish libstdc++.a? Do I need to use CC='gcc -L/export/home/jakub/gcc-11-inst/lib -R/export/home/jakub/gcc-11-inst/lib/' CXX='g++ -L/export/home/jakub/gcc-11-inst/lib -R/export/home/jakub/gcc-11-inst/lib/' as workaround?