https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120266
--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> --- You can use it for all your own code, and and other libraries you rely on, you just can't build libstdc++.a with LTO. Last I heard, the same is true for glibc. But sure, if you think it's not worth using it if it can't be used on every part of the whole program, don't use it. In fact, maybe you should just use -O0 for everything. Why bother optimizing at all.