<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 26, 2016 at 6:33 AM, Carsten Mattner <span dir="ltr"><<a href="mailto:carstenmattner@gmail.com" target="_blank">carstenmattner@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I finally got around to trying to build with LTO=Thin as discussed earlier.<br>
<br>
The results so far are negative, so I must have done something wrong.<br>
<br>
$ export CXX=clang CC=clang<br>
<br>
$ cmake \<br>
    -G Ninja \<br>
    -DCMAKE_BUILD_TYPE=Release \<br>
    -DLLVM_BINUTILS_INCDIR=/usr/<wbr>include \<br>
    -DCMAKE_INSTALL_PREFIX=$PREFIX \<br>
    -DLLVM_TARGETS_TO_BUILD="X86" \<br>
    -DLLVM_ENABLE_BACKTRACES=OFF \<br>
    -DLLVM_BUILD_EXAMPLES=OFF \<br>
    -DLLVM_INCLUDE_EXAMPLES=OFF \<br>
    -DLLVM_BUILD_TESTS=OFF \<br>
    -DLLVM_INCLUDE_TESTS=OFF \<br>
    -DLLVM_BUILD_DOCS=OFF \<br>
    -DLLVM_INCLUDE_DOCS=OFF \<br>
    -DLLVM_ENABLE_DOXYGEN=OFF \<br>
    -DLLVM_ENABLE_SPHINX=OFF \<br>
    -DLLDB_DISABLE_PYTHON=ON \<br>
    -DCLANG_PLUGIN_SUPPORT=OFF \<br>
    -DLLVM_ENABLE_LTO=Thin \<br>
    -DCMAKE_AR=$PREFIX/bin/llvm-ar \<br>
    -DCMAKE_RANLIB=$PREFIX/bin/<wbr>llvm-ranlib<br>
<br>
$ ninja -j4<br>
/usr/bin/ld: error: Could not create temporary file: Too many open files<br></blockquote><div><br></div><div>ThinLTO needs to create as many temporary files as there are input modules to the link. From your 'ls' below, it doesn't look like there is an incredibly huge amount already created, can you check your limits? What is the output of:</div><div><br></div><div>$ ulimit -n</div><div><br></div><div>and</div><div><br></div><div>$ sysctl fs.file-max</div><div><br></div><div>Teresa</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
clang-3.9: error: unable to execute command: Segmentation fault (core dumped)<br>
clang-3.9: error: linker command failed due to signal (use -v to see invocation)<br>
[1289/3332] Linking CXX shared module lib/LLVMgold.so<br>
<br>
$ ninja -j2<br>
/usr/bin/ld: error: Could not create temporary file: Too many open files<br>
clang-3.9: error: unable to execute command: Segmentation fault (core dumped)<br>
clang-3.9: error: linker command failed due to signal (use -v to see invocation)<br>
[1289/3332] Linking CXX shared module lib/LLVMgold.so<br>
<br>
$ ninja -j1<br>
/usr/bin/ld: error: Could not create temporary file: Too many open files<br>
clang-3.9: error: unable to execute command: Segmentation fault (core dumped)<br>
clang-3.9: error: linker command failed due to signal (use -v to see invocation)<br>
ninja: build stopped: subcommand failed.<br>
Command exited with non-zero status 1<br>
<br>
$ ls -l /tmp/lto*|wc -l<br>
1310<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><span style="font-family:times;font-size:medium"><table cellspacing="0" cellpadding="0"><tbody><tr style="color:rgb(85,85,85);font-family:sans-serif;font-size:small"><td nowrap style="border-top:2px solid rgb(213,15,37)">Teresa Johnson |</td><td nowrap style="border-top:2px solid rgb(51,105,232)"> Software Engineer |</td><td nowrap style="border-top:2px solid rgb(0,153,57)"> <a href="mailto:tejohnson@google.com" target="_blank">tejohnson@google.com</a> |</td><td nowrap style="border-top:2px solid rgb(238,178,17)"> 408-460-2413</td></tr></tbody></table></span></div>
</div></div>