How safe is it to turn LTO on?
Moderator: Forum Moderators
- revolting_peasant
- Posts: 247
- Joined: May 29th, 2012, 5:45 pm
How safe is it to turn LTO on?
I noticed that, when I CMake-configure Wesnoth for building, LTO is turned off by default. Is this because it's somehow unsafe/unstable? If it is, can someone describe what behavior one can expect with LTO turned on?
- Pentarctagon
- Project Manager
- Posts: 5800
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: How safe is it to turn LTO on?
It's basically just another level of optimization, and the more you tell a compiler to optimize something the more likely it is to do something unintended because of some undefined behavior in the code base. It should be relatively safe though - the Steam Linux build has had LTO enabled for years now.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
take one down, patch it around
-2,147,483,648 little bugs in the code
Re: How safe is it to turn LTO on?
LTO also tends to make building longer (a very slow linking step that cannot be relieved by parallelism). So turning off LTO by default could have much more benign reasons.
Re: How safe is it to turn LTO on?
GCC does actually support parallelism for LTO; see documentation of the
-flto= option.Wesnoth-related GitHub repos:
General mods collection, SotBEEE, AToTBWaTD, The Earth's Gut, A Little Adventure, FtF
Social media: Mastodon: @egallager@treehouse.systems, Steam: egallager
General mods collection, SotBEEE, AToTBWaTD, The Earth's Gut, A Little Adventure, FtF
Social media: Mastodon: @egallager@treehouse.systems, Steam: egallager