Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
The correct way to enable LTO
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Petross404
n00b
n00b


Joined: 27 Sep 2016
Posts: 40

PostPosted: Tue Aug 29, 2017 8:11 am    Post subject: The correct way to enable LTO Reply with quote

Hello there, I 've latelly experimenting with LTO. From what I 've read so far
Code:
-flto
has to be present both at C(XX)FLAGS and LDFLAGS. But some people use it this way in the LDFLAGS:
Code:
 ... -Wl,-flto ...
while others use it like this :
Code:
 ...-flto...


So which is the correct way? FFmpeg for example failes at configure because "compiler can not create executables" when the first option is used, while other ebuilds don't fail.
Back to top
View user's profile Send private message
fcl
n00b
n00b


Joined: 31 Dec 2016
Posts: 71

PostPosted: Tue Aug 29, 2017 3:44 pm    Post subject: Reply with quote

I'm very interested in this. I have a very shallow understanding of the subject but to me LTO seems to be one of the next good things where Gentoo can shine compared to other distros. Stuff like this just needs to be well documented so more people will test it, hack it and enjoy it.
We really need a good LTO guide here in the forums and a comprehensive page over at wiki.gentoo.org. Sorry for sounding like a beggar but it's just my two cents
Back to top
View user's profile Send private message
NTU
Tux's lil' helper
Tux's lil' helper


Joined: 17 Jul 2015
Posts: 126

PostPosted: Sun Sep 03, 2017 1:54 pm    Post subject: Reply with quote

CFLAGS+="-flto -fuse-linker-plugin"
LDFLAGS+="-flto -fuse-linker-plugin"

Use Gold linker instead of BFD. LTO the right way. Finally, that's settled.
Back to top
View user's profile Send private message
42n4
n00b
n00b


Joined: 10 Feb 2015
Posts: 8

PostPosted: Tue Jul 17, 2018 9:18 am    Post subject: Reply with quote

As I describe in other threads, scripts from the site: https://github.com/InBetweenNames/gentooLTO work very good with gcc 8.1.0 !
Look at
https://forums.gentoo.org/viewtopic-p-8241956.html#8241956
_________________
gentoo gcc 8.1.0 lto graphite, arm rpi3 7.3.0,
http://bit.ly/gen2ls
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum