[llvm-dev] CMakeTestCCompiler fails

Itaru Kitayama via llvm-dev llvm-dev at lists.llvm.org
Mon Feb 3 16:33:01 PST 2020


Trunk clang does not pass CMake C Compiler test like below:

CMake Error at
/home/usr4/c74014i/opt/cmake-3.16.3-Linux-x86_64/share/cmake-3.16/Modules/CMakeTestCCompiler.cmake:60
(message):
  The C compiler

    "/home/usr4/c74014i/opt/clang/current/bin/clang"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir:
/home/usr4/c74014i/work/build/202002040929/CMakeFiles/CMakeTmp

    Run Build Command(s):/home/usr4/c74014i/opt/ninja/bin/ninja cmTC_35cb3
&& [1/2] Building C object CMakeFiles/cmTC_35cb3.dir/testCCompiler.c.o
    [2/2] Linking C executable cmTC_35cb3
    FAILED: cmTC_35cb3
    : && /home/usr4/c74014i/opt/clang/current/bin/clang
 CMakeFiles/cmTC_35cb3.dir/testCCompiler.c.o  -o cmTC_35cb3   && :
    /usr/bin/ld: cannot find crtbegin.o: No such file or directory
    /usr/bin/ld: cannot find -lgcc
    /usr/bin/ld: cannot find -lgcc_s
    clang-11: error: linker command failed with exit code 1 (use -v to see
invocation)
    ninja: build stopped: subcommand failed.





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:49 (project)

My configuration is shown below:
cmake -G Ninja -DBUILD_SHARED_LIBS=ON -DLLVM_PARALLEL_LINK_JOBS=2
-DLLVM_ENABLE_LLD=ON -DLLVM_ENABLE_LIBCXX=OFF -DCMAKE_BUILD_TYPE=Release
-DGCC_INSTALL_PREFIX=/pathto/gcc-7.5.0/ -DLIBOMPTARGET_ENABLE_DEBUG=ON
-DCMAKE_INSTALL_PREFIX=$HOME/opt/clang/${today} -DCMAKE_C_COMPILER=clang
-DCMAKE_C_FLAGS="" -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_FLAGS=""
-DLLVM_ENABLE_PROJECTS="clang;openmp;lld;libcxx;libcxxabi"
-DCLANG_OPENMP_NVPTX_DEFAULT_ARCH=sm_60
-DLIBOMPTARGET_NVPTX_COMPUTE_CAPABILITIES=60 -DLLVM_TARGETS_TO_BUILD=all
$HOME/projects/llvm-project/llvm
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200204/d6fd825e/attachment.html>


More information about the llvm-dev mailing list