https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106097
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- by using the --with-build-config=bootstrap-ubsan option at configure time or BUILD_CONFIG variable to build time. See https://gcc.gnu.org/install/build.html