http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59106
--- Comment #14 from Yury Gribov <y.gribov at samsung dot com> --- Sent to gcc-patches: http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01990.html As for libubsan, it does not seem to support static link anyway: /home/ygribov/install/gcc-master/bin/gcc -g repro.i -fsanitize=undefined -static-libubsan ... /sanitizer_linux_libcdep.cc:71: undefined reference to `pthread_getattr_np' /sanitizer_linux_libcdep.cc:74: undefined reference to `pthread_attr_getstack' /sanitizer_linux_libcdep.cc:85: undefined reference to `dlsym' ... Once it does, we can go with the same per-file flags hack that we do e.g. in libstdc++-v3/src/Makefile.am.