<div dir="ltr">How big is your project?<div>LTO eats RAM even faster than chrome. For example linking clang with LTO could take 16GB of ram. </div><div><br></div><div>Have you tried using LTO on your project on that machine, or is it your first time?</div><div><br></div><div>Piotr</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jul 23, 2016 at 2:42 AM, Sedat Dilek via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Thu, Jul 21, 2016 at 12:01 PM, Sedat Dilek <<a href="mailto:sedat.dilek@gmail.com">sedat.dilek@gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
> unfortunately, my build somehow hangs when linking clang binary and my<br>
> system is in an unusable state.<br>
><br>
> My toolchain is clang-3.8, gold-1.11 and LLVMgold.so from binutils<br>
> v2.26.1 (both selfmade) and LTO-flag is enabled.<br>
> My buildsystem uses cmake-3.6.0 and ninja-1.7.1 (both prebuilt).<br>
> I have 52 last steps left in my 3rd build.<br>
><br>
> My Linux-kernel is v3.13.0-92 from official Ubuntu repositories.<br>
><br>
> On my Ubuntu/precise AMD64 I have ***4GiB RAM and 256MiB SWAP***.<br>
> Is this not enough RAM/SWAP for building/linking?<br>
><br>
> Need some additional informations?<br>
><br>
> Any help appreciated.<br>
><br>
> Regards,<br>
> - Sedat -<br>
><br>
> [1] <a href="http://llvm.org/docs/GoldPlugin.html" rel="noreferrer" target="_blank">http://llvm.org/docs/GoldPlugin.html</a><br>
><br>
> P.S.: More informations...<br>
><br>
> [ First toolchain build ]<br>
><br>
> I built a 1st llvm-toolchain v3.8.1 with GCC v4.9.2 and binutils v2.22.<br>
> No speedup settings, no extra-patches applied etc.<br>
><br>
> [ Selfmade binutils ]<br>
><br>
> As binutils v2.22 was somehow not able to generate a LLVMgold.so on<br>
> Ubuntu/precise AMD64, I have built binutils v2.26.1 manually and use<br>
> all its binaries for building/linking (GOLD for linking).<br>
><br>
> [ 2nd llvm-toolchain LLVMgold.so ]<br>
><br>
> In a 2nd llvm-toolchain v3.8.1 build a LLVMgold.so was generated.<br>
> I placed LLVMgold.so into my selfmade<br>
> /opt/binutils-2.26.1/lib/bfd-plugins/ directory.<br>
> ( I had to create a bfd-plugins subdir manually. )<br>
><br>
> [ 3rd llvm-toolchain LTO ]<br>
><br>
> Now, I am able with backported LTO-flag from upstream to build with '-flto'.<br>
><br>
> - EOT -<br>
<br>
</div></div>Hi,<br>
<br>
in the meantime I tried with Linux v4.4.y LTS and 2GiB swap-space.<br>
So I have 4 GiB RAM and 2GiB SWAP in total 6GiB.<br>
<br>
Paul Rouschal recommended to reduce parallel-compile-jobs from 2 to 1...<br>
<br>
LLVM_PARALLEL_COMPILE_JOBS=1<br>
LLVM_PARALLEL_LINK_JOBS=1<br>
<br>
...but that did not help.<br>
<br>
My Ubuntu/precise hangs and looking at top shows MEM/SWAP to be eaten.<br>
<br>
Anyone has experiences how much RAM or SWAP I need when building a<br>
LTO-optimized llvm-toolchain with Clang, GNU/gold and LLVMgold-Plugin?<br>
<br>
My build-script is attached.<br>
<br>
Thanks.<br>
<br>
Regards,<br>
- Sedat -<br>
<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div>