https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98414
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Likely it just is the first TU that needs -fsanitize=vptr sanitization... Seems -lubsan comes after -lstdc++ when linking with -fsanitize=undefined -static-libstdc++ -static-libubsan so if the vptr checking code needs to be linked, it isn't satisfied.