[llvm-bugs] [Bug 33717] New: rerunning cmake causes binaries to be relinked regardless of repo changes

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Jul 8 03:53:08 PDT 2017


https://bugs.llvm.org/show_bug.cgi?id=33717

            Bug ID: 33717
           Summary: rerunning cmake causes binaries to be relinked
                    regardless of repo changes
           Product: new-bugs
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: matthias.krueger at famsik.de
                CC: llvm-bugs at lists.llvm.org

Running cmake causes binaries to be relinked even if neither repo files nor
cmake config changed since last build, this is quite strange and a huge time
sink in case of LTO builds.

I don't clearly remember this behaviour being present a week or two ago. 

I can repro like this:

After doing an initial build:

cd build_dir
ninja-build clang LLVMgold llvm-ar llvm-ranlib lld
=> no files are rebuilt, everything ok

However if I run cmake before (as part my build script):

cd build_dir
cmake ../llvm -G "Ninja" \
        -DCMAKE_BUILD_TYPE=Release \
        -DLLVM_BINUTILS_INCDIR=/usr/include \
        -DCMAKE_C_FLAGS="-march=native -O3 -g0 -DNDEBUG" \
        -DCMAKE_CXX_FLAGS="-march=native -O3 -g0 -DNDEBUG" \
        -DLLVM_PARALLEL_LINK_JOBS=1 \
        -DLLVM_TARGETS_TO_BUILD="X86" \
        -DLLVM_OPTIMIZED_TABLEGEN=1 \
        -DLLVM_BUILD_TOOLS=0 
ninja-build clang LLVMgold llvm-ar llvm-ranlib lld

=> these 12 files will be rebuilt:
lib/Object/CMakeFiles/LLVMObject.dir/IRSymtab.cpp.o
lib/libLLVMObject.a
bin/llvm-ar
bin/llvm-ranlib
bin/clang-offload-bundler
lib/LTO/CMakeFiles/LLVMLTO.dir/ThinLTOCodeGenerator.cpp.o
lib/LTO/CMakeFiles/LLVMLTO.dir/LTO.cpp.o
lib/libLLVMLTO.a
lib/LLVMgold.so
bin/clang-5.0
bin/clang
bin/lld


In case of tests (check-llvm check-clang check-lld), 72 targets are being
rebuilt every time 

Now for "normal" builds this is not a huge issue but in case of lto, this can
prolong subsequent builds by several hours. :/

Did anyone else run into this?


Said script:
https://github.com/matthiaskrgr/llvm_bootstrap/blob/master/build_git.sh

cmake 3.5
ninja-build 1.7.2

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170708/0b987a89/attachment.html>


More information about the llvm-bugs mailing list