https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78708
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Works? You mean it doesn't ICE? As soon as there are any libasan routine calls, it can't really link properly, at least not unless you g++ test.o -lasan Anyway, this is related to PR69254, probably when streaming in LTO bytecode and seeing there ASAN_MARK internal function with flag_sanitize & SANITIZE_ADDRESS not set we should set it. Similarly when streaming in the various UBSAN_* internal functions, so we don't ICE because sanopt pass has not been invoked. Of course, the result will not really link, but that is user fault.