LTO and -g for nonELF binary
Pavol Gono
pavol.gono@gmail.com
Thu Jan 15 21:31:27 GMT 2026
Hello
I am compiling C++ binary in the MSYS2+MINGW64 environment (Target:
x86_64-w64-mingw32), using the latest g++ version (15.2+).
I am using the RelWithDebInfo build type, which means options -O2 -g
(eventually -g1).
How risky is the usage of LTO (-flto) in addition? In documentation I read:
Link-time optimization does not work well with generation of debugging
information on systems other than those using a combination of ELF and
DWARF.
Is there a risk of incorrect debugging symbols or anything worse?
Thank you
Pavol
More information about the Gcc-help
mailing list