Mesa Will Now Prevent Compiling With LTO Due To "Random Impossible-To-Debug Bugs"
- Reference: 0001611092
- News link: https://www.phoronix.com/news/Mesa-No-Build-LTO
- Source link:
A merge today to Mesa Git adjusts the Meson build system integration to error out if the compiler "-flto" flag is set:
"Building Mesa with LTO is not supported. Please disable LTO for building Mesa."
Mesa is now explicitly rejecting LTO for building Mesa to avoid bugs. Though for those really serious about LTO'ing Mesa, they do add a "allow-broken-lto" option to Mesa to override this error and proceed with an LTO-optimized Mesa build.
The [2]merge request noted:
"LTO is not supported with Mesa. It has caused random impossible-to-debug bugs for a long time, and LTO bug reports are generally considered a "WONTFIX please disable LTO instead". Let's make this clear to users and packagers so they don't run into more weird issues that result in inactionable reports."
Hopefully the compiler LTO support with GCC and to a lesser extent LLVM/Clang will be improved with time that these checks can be revised for those wanting to LTO their Mesa build in the name of greater performance.
[1] https://www.phoronix.com/search/link-time+optimization
[2] https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39671