[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: enabling LTO by default is vastly inappropriate (was Re: Bug#1015386: dietlibc: ftbfs with LTO (link time optimization) enabled)



On Tue, Jul 19, 2022 at 05:15:32PM +0000, Thorsten Glaser wrote:
> Matthias Klose dixit:
> >The goal is to enable this optimization by default in an upcoming
> >Debian release in dpkg-buildflags for 64bit architectures.  The goal
> >is to get this package to build with link time optimizations, or to
> >explicitly disable link time optimizations for this package build.
> 
> This is daring, especially from the GCC maintainer.
> 
> GCC (both in Debian and upstream) have been ignoring many known
> bugs related to LTO (both in the -fwhole-program --combine and

I have tried LTO when it came out, on a number of quite large complex
codebases.  In the 4.* days it was indeed full of bugs.  But today,
the I would say it is good enough for being enabled by default.

> These bugs are subtile miscompilations. In mksh, only one test
> by accident fails due to the GCC LTO bug. It’s definitely *not*

What was the last version of gcc that you have tested?

> (As for dietlibc, it’s inappropriate there anyway, so it opts out.)

That's a shame, as it's specifically a library that could use reduced size
due to the compiler being able to notice and excise unnecessary bits.

A glance at the failure log shows that first we have an obvious bug that
has been uncovered now:

extern int main(int argc,char* argv[],char* envp[]);
vs
int main(int argc,char *argv[])

then some linker games.


Meow!
-- 
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ What kind of a drug are "base" and "red pill"?  I think acid is
⢿⡄⠘⠷⠚⠋⠀ LSD, which would make base... ?  Judging from the behaviour of
⠈⠳⣄⠀⠀⠀⠀ those "based and redpilled", something nasty.


Reply to: