On Sun, Apr 27, 2014 at 6:56 PM, Joshua Kinard <[email protected]> wrote: > > My curiosity, as I have not attempted LTO yet on any machine, is what are > the RAM requirements? Is it a hard limit, wherein the compiler simply fails > if there isn't enough RAM, or does it just start hitting swap real hard?
It just allocates RAM, and the OS does the rest. I've seen it invoke the OOM killer. That was back when I only had 8GB of RAM. Now I have 16GB and I only need to disable LTO on the really big packages. Of course, if you set an appropriate ulimit then the process will just terminate more gracefully. I'd highly recommend doing just that if you have a lot of swap available. > Those of us using older archs where the RAM is limited might have to be more > cautious w/ LTO. I.e., my SGI O2 maxes right now at 512MB. It can go to > 1GB if the odd memory/PROM issue is ever worked out. But 512MB is it for > now, so what are my odds of successfully using LTO on that? About zero. Well, I'm sure it will work fine for hello.c, especially if you eliminate any function calls inside of it. > > Especially if LTO helps to reduce the final binary size, that's less data > being shuffled around main memory and the CPU caches, which, although means > slower compile times, might hake such a machine a bit snippier. Though, I > dread how long GCC will take to build itself w/ LTO. The O2 already needs > ~18hrs for 4.8. I haven't tried 4.9 on it yet. Yeah, good luck with that... :) I'd be curious as to what you find. You can always try it out by picking a small package and doing a CFLAGS=foo emerge bar. Be sure to only use -j1 -flto=1 as well. Rich
