In fact -O* flags need to be passed to the linker too for LTO to do any
optimizations at all.

So if I call gcc -O2 -flto x.o y.o, libtool will need to pass both -O2
and -flto. And of course any -f* -m* flags that affect code generation.
Also -fuser-linker-plugin needs to be passed on by libtool.


P.S.:
In fact for LTO I think it'd make sense to pass all of CFLAGS/CXXFLAGS
to the linker, since they affect code generation at link time now.
Or document the fact that you need to export LDFLAGS="$CFLAGS" if you
want LTO to work.

Best regards,
--Edwin




-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to