[llvm-dev] (Thin)LTO llvm build

Carsten Mattner via llvm-dev llvm-dev at lists.llvm.org
Mon Sep 26 06:33:14 PDT 2016


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
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


More information about the llvm-dev mailing list