[Bug general/24498] 0.176: isn't LTO ready

marxin.liska at gmail dot com sourceware-bugzilla@sourceware.org
Wed Apr 15 07:07:05 GMT 2020


https://sourceware.org/bugzilla/show_bug.cgi?id=24498

--- Comment #11 from Martin Liška <marxin.liska at gmail dot com> ---
(In reply to kloczek from comment #10)
> > I would add a configure option --enable-lto that will append -flto to {C,LD}FLAGS.
> 
> Please don't do that.
> 
> LTO can be driven using only env variable.
> 
> % CFLAGS="<clto_cflags>" LDFLAGS="<lto_ldflags>" ./configure

Works for me.

> 
> Please use KISS principle and do not implement something which can be
> already done other way *without* touching existing code.
> 
> PS. Changing {C,LD}FLAGS is not only part of using LTO. You need to pass NM,
> RANLIB and AR env variables.

Not necessarily. Typical Linux systems, like openSUSE, utilize auto-loading
mechanism of LTO plugins:

$ strace -f -s512 nm foo.o 2>&1 | grep plugin
...
openat(AT_FDCWD, "/usr/bin/../bin/../lib/bfd-plugins/liblto_plugin.so.0.0.0",
O_RDONLY|O_CLOEXEC) = 5

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Elfutils-devel mailing list