[llvm-dev] (Thin)LTO llvm build

Teresa Johnson via llvm-dev llvm-dev at lists.llvm.org
Mon Sep 26 06:52:14 PDT 2016


On Mon, Sep 26, 2016 at 6:33 AM, Carsten Mattner <carstenmattner at gmail.com>
wrote:

> I finally got around to trying to build with LTO=Thin as discussed earlier.
>
> The results so far are negative, so I must have done something wrong.
>
> $ export CXX=clang CC=clang
>
> $ cmake \
>     -G Ninja \
>     -DCMAKE_BUILD_TYPE=Release \
>     -DLLVM_BINUTILS_INCDIR=/usr/include \
>     -DCMAKE_INSTALL_PREFIX=$PREFIX \
>     -DLLVM_TARGETS_TO_BUILD="X86" \
>     -DLLVM_ENABLE_BACKTRACES=OFF \
>     -DLLVM_BUILD_EXAMPLES=OFF \
>     -DLLVM_INCLUDE_EXAMPLES=OFF \
>     -DLLVM_BUILD_TESTS=OFF \
>     -DLLVM_INCLUDE_TESTS=OFF \
>     -DLLVM_BUILD_DOCS=OFF \
>     -DLLVM_INCLUDE_DOCS=OFF \
>     -DLLVM_ENABLE_DOXYGEN=OFF \
>     -DLLVM_ENABLE_SPHINX=OFF \
>     -DLLDB_DISABLE_PYTHON=ON \
>     -DCLANG_PLUGIN_SUPPORT=OFF \
>     -DLLVM_ENABLE_LTO=Thin \
>     -DCMAKE_AR=$PREFIX/bin/llvm-ar \
>     -DCMAKE_RANLIB=$PREFIX/bin/llvm-ranlib
>
> $ ninja -j4
> /usr/bin/ld: error: Could not create temporary file: Too many open files
>

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:

$ ulimit -n

and

$ sysctl fs.file-max

Teresa


clang-3.9: error: unable to execute command: Segmentation fault (core
> dumped)
> clang-3.9: error: linker command failed due to signal (use -v to see
> invocation)
> [1289/3332] Linking CXX shared module lib/LLVMgold.so
>
> $ ninja -j2
> /usr/bin/ld: error: Could not create temporary file: Too many open files
> clang-3.9: error: unable to execute command: Segmentation fault (core
> dumped)
> clang-3.9: error: linker command failed due to signal (use -v to see
> invocation)
> [1289/3332] Linking CXX shared module lib/LLVMgold.so
>
> $ ninja -j1
> /usr/bin/ld: error: Could not create temporary file: Too many open files
> clang-3.9: error: unable to execute command: Segmentation fault (core
> dumped)
> clang-3.9: error: linker command failed due to signal (use -v to see
> invocation)
> ninja: build stopped: subcommand failed.
> Command exited with non-zero status 1
>
> $ ls -l /tmp/lto*|wc -l
> 1310
>



-- 
Teresa Johnson |  Software Engineer |  tejohnson at google.com |  408-460-2413
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160926/c1b2e11e/attachment.html>


More information about the llvm-dev mailing list