Hello, as suggested at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105368#c5 , I am trying to build gcc (trunk) with --with-build-config=bootstrap-ubsan , but the build fails to link in stage2 : ... make[5]: Entering directory '/repo/build-gcc-trunk-amd64/isl' /bin/sh ./libtool --tag=CXX --mode=link /repo/build-gcc-trunk-amd64/./ prev-gcc/xg++ -B/repo/build-gcc-trunk-amd64/./prev-gcc/ -B/repo/gcc-trunk// binary-trunk-r13-166-20220507001626-gea3fbfda608-checking-release-bootstrap- ubsan-amd64/x86_64-pc-linux-gnu/bin/ -nostdinc++ -B/repo/build-gcc-trunk-amd 64/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -B/repo/build-gcc-trunk- amd64/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs -I/repo/build- gcc-trunk-amd64/prev-x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc- linux-gnu -I/repo/build-gcc-trunk-amd64/prev-x86_64-pc-linux-gnu/libstdc++- v3/include -I/repo/gcc-trunk/libstdc++-v3/libsupc++ -L/repo/build-gcc-trunk -amd64/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -L/repo/build-gcc- trunk-amd64/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs -g -O2 - fno-checking -fsanitize=undefined -DUBSAN_BOOTSTRAP -static-libstdc++ - static-libgcc -fsanitize=undefined -static-libubsan -DUBSAN_BOOTSTRAP -B/ repo/build-gcc-trunk-amd64/prev-x86_64-pc-linux-gnu/libsanitizer/ -B/repo/ build-gcc-trunk-amd64/prev-x86_64-pc-linux-gnu/libsanitizer/ubsan/ -B/repo/ build-gcc-trunk-amd64/prev-x86_64-pc-linux-gnu/libsanitizer/ubsan/.libs -o isl_test_cpp isl_test_cpp-isl_test_cpp.o libisl.la /repo/build-gcc-trunk-amd 64/./gmp/libgmp.la libtool: link: /repo/build-gcc-trunk-amd64/./prev-gcc/xg++ -B/repo/build-gcc -trunk-amd64/./prev-gcc/ -B/repo/gcc-trunk//binary-trunk-r13-166- 20220507001626-gea3fbfda608-checking-release-bootstrap-ubsan-amd64/x86_64-pc -linux-gnu/bin/ -nostdinc++ -B/repo/build-gcc-trunk-amd64/prev-x86_64-pc- linux-gnu/libstdc++-v3/src/.libs -B/repo/build-gcc-trunk-amd64/prev-x86_64- pc-linux-gnu/libstdc++-v3/libsupc++/.libs -I/repo/build-gcc-trunk-amd64/prev -x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu -I/repo/build- gcc-trunk-amd64/prev-x86_64-pc-linux-gnu/libstdc++-v3/include -I/repo/gcc- trunk/libstdc++-v3/libsupc++ -g -O2 -fno-checking -fsanitize=undefined - DUBSAN_BOOTSTRAP -static-libstdc++ -static-libgcc -fsanitize=undefined - static-libubsan -DUBSAN_BOOTSTRAP -B/repo/build-gcc-trunk-amd64/prev-x86_64- pc-linux-gnu/libsanitizer/ -B/repo/build-gcc-trunk-amd64/prev-x86_64-pc- linux-gnu/libsanitizer/ubsan/ -B/repo/build-gcc-trunk-amd64/prev-x86_64-pc- linux-gnu/libsanitizer/ubsan/.libs -o isl_test_cpp isl_test_cpp-isl_test_ cpp.o -L/repo/build-gcc-trunk-amd64/prev-x86_64-pc-linux-gnu/libstdc++-v3/ src/.libs -L/repo/build-gcc-trunk-amd64/prev-x86_64-pc-linux-gnu/libstdc++-v 3/libsupc++/.libs ./.libs/libisl.a /repo/build-gcc-trunk-amd64/./gmp/.libs/ libgmp.a /usr/bin/x86_64-pc-linux-gnu-ld: /repo/build-gcc-trunk-amd64/prev-x86_64-pc- linux-gnu/libsanitizer/ubsan/.libs/libubsan.a(ubsan_type_hash_itanium.o): in function `findBaseAtOffset(__cxxabiv1::__class_type_info const*, long)': /repo/gcc-trunk/libsanitizer/ubsan/ubsan_type_hash_itanium.cpp:162: undefined reference to `__dynamic_cast' /usr/bin/x86_64-pc-linux-gnu-ld: /repo/gcc-trunk/libsanitizer/ubsan/ubsan_ type_hash_itanium.cpp:166: undefined reference to `typeinfo for __cxxabiv1:: __vmi_class_type_info' /usr/bin/x86_64-pc-linux-gnu-ld: /repo/gcc-trunk/libsanitizer/ubsan/ubsan_ type_hash_itanium.cpp:166: undefined reference to `__dynamic_cast' /usr/bin/x86_64-pc-linux-gnu-ld: /repo/build-gcc-trunk-amd64/prev-x86_64-pc- linux-gnu/libsanitizer/ubsan/.libs/libubsan.a(ubsan_type_hash_itanium.o): in function `isDerivedFromAtOffset(__cxxabiv1::__class_type_info const*, __ cxxabiv1::__class_type_info const*, long)': /repo/gcc-trunk/libsanitizer/ubsan/ubsan_type_hash_itanium.cpp:125: undefined reference to `__dynamic_cast' /usr/bin/x86_64-pc-linux-gnu-ld: /repo/gcc-trunk/libsanitizer/ubsan/ubsan_ type_hash_itanium.cpp:129: undefined reference to `typeinfo for __cxxabiv1:: __vmi_class_type_info' /usr/bin/x86_64-pc-linux-gnu-ld: /repo/gcc-trunk/libsanitizer/ubsan/ubsan_ type_hash_itanium.cpp:129: undefined reference to `__dynamic_cast' /usr/bin/x86_64-pc-linux-gnu-ld: /repo/build-gcc-trunk-amd64/prev-x86_64-pc- linux-gnu/libsanitizer/ubsan/.libs/libubsan.a(ubsan_type_hash_itanium.o): in function `__ubsan::checkDynamicType(void*, void*, unsigned long)': /repo/gcc-trunk/libsanitizer/ubsan/ubsan_type_hash_itanium.cpp:233: undefined reference to `__dynamic_cast' collect2: error: ld returned 1 exit status I am configuring as: $ /repo/build-gcc-trunk-amd64/./prev-gcc/xgcc -v Using built-in specs. COLLECT_GCC=/repo/build-gcc-trunk-amd64/./prev-gcc/xgcc Target: x86_64-pc-linux-gnu Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++ -- enable-valgrind-annotations --disable-nls --enable-checking=release --with- build-config=bootstrap-ubsan --with-cloog --with-ppl --with-isl --build=x86_ 64-pc-linux-gnu --host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu -- with-ld=/usr/bin/x86_64-pc-linux-gnu-ld --with-as=/usr/bin/x86_64-pc-linux- gnu-as --disable-libstdcxx-pch --prefix=/repo/gcc-trunk//binary-trunk-r13- 166-20220507001626-gea3fbfda608-checking-release-bootstrap-ubsan-amd64 Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 13.0.0 20220507 (experimental) (GCC) The libraries were downloaded by: $ contrib/download_prerequisites gmp-6.2.1.tar.bz2: OK mpfr-4.1.0.tar.bz2: OK mpc-1.2.1.tar.gz: OK isl-0.24.tar.bz2: OK All prerequisites downloaded successfully. Is there anything obvious I am doing wrong? Thanks in advance, Zdenek