https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98165 --- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> --- You can use -static-libubsan option to achieve the same effect as clang does, LLVM doesn't think linking dynamically is a good idea.