VOOZH about

URL: https://www.phoronix.com/news/Mesa-No-Build-LTO

⇱ Mesa Will Now Prevent Compiling With LTO Due To "Random Impossible-To-Debug Bugs" - Phoronix


👁 Phoronix

Mesa Will Now Prevent Compiling With LTO Due To "Random Impossible-To-Debug Bugs"

Written by Michael Larabel in Mesa on 4 February 2026 at 12:52 PM EST. 75 Comments
While link-time optimizations "LTO" can deliver some nice performance benefits out of this compiler optimization technique, it can make debugging said binaries more challenging. Due to various bugs in Mesa being attributed to the use of compiler link-time optimizations when compiling Mesa, the builds are being blocked on using LTO.

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.

👁 Mesa no LTO merge


The 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.

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.