https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68794
Manuel López-Ibáñez <manu at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |manu at gcc dot gnu.org --- Comment #2 from Manuel López-Ibáñez <manu at gcc dot gnu.org> --- (In reply to Matthias Klose from comment #0) > [forwarded from https://bugs.debian.org/805422] > > an option for -fsanitize=<foo> is accepted even if the corresponding library > is not available, e.g. undefined/ubsan on aarch64-linux-gnu. The compiler > should warn when building, not only failing when linking. "-c" implies compile-only. Thus, missing libraries are only detected during linking. This not different from any other library. I'm not sure it can be done differently, the path to libubsan may only be known to the linking step. One can create a configure test to check whether libubsan is available before compiling any file.