https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99190
--- Comment #4 from Vittorio Zecca <zeccav at gmail dot com> --- To generate a sanitized version of libgfortran I built whole sanitized gcc with the following command: CFLAGS="-g -O0 -fsanitize=undefined -lubsan" LIBS="-lubsan" CXXFLAGS=$CFLAGS ../gcc-150221/configure --prefix=/home/vitti/local/gcc-150221-undefined --enable-languages=c,c++,fortran --disable-multilib --disable-lto --disable-plugin --disable-bootstrap But I remember I had to tweak the build here and there. It is not trivial.