在ubuntu12.04中编译LLVM的compiler-rt时出错

时间:2013-06-10 15:02:08

标签: compilation llvm

如何在ubuntu12.04中编译llvm的compiler-rt(compiler-rt.llvm.org)?

当我编译compiler-rt时,我得到错误:

rong@rong-VirtualBox:~/source/compile-rt/build$ cmake ../compiler-rt/
CMake Error at CMakeLists.txt:10 (include):
  include could not find load file:

    LLVMParseArguments


CMake Error at CMakeLists.txt:21 (string):
  string sub-command REGEX, mode MATCH needs at least 5 arguments total to
  command.


CMake Error at cmake/Modules/AddCompilerRT.cmake:1 (include):
  include could not find load file:

    AddLLVM
Call Stack (most recent call first):
  CMakeLists.txt:36 (include)


CMake Error at cmake/Modules/AddCompilerRT.cmake:2 (include):
  include could not find load file:

    LLVMParseArguments
Call Stack (most recent call first):
  CMakeLists.txt:36 (include)


CMake Error at cmake/Modules/CompilerRTUtils.cmake:21 (string):
  string sub-command REPLACE requires at least four arguments.
Call Stack (most recent call first):
  CMakeLists.txt:109 (find_flag_in_string)


CMake Error at CMakeLists.txt:138 (check_cxx_compiler_flag):
  Unknown CMake command "check_cxx_compiler_flag".


-- Configuring incomplete, errors occurred!
rong@rong-VirtualBox:~/source/compile-rt/build$

2 个答案:

答案 0 :(得分:2)

compiler_rt旨在在LLVM源代码树中编译。 This page详细说明了如何使用llvm,clang和compiler-rt创建此树,编译和测试所有内容。应该像Ubunbu上的魅力一样。

专业提示:使用CMake + Ninja构建整个内容要快得多。请参阅instructions here

答案 1 :(得分:1)

我使用

为i386和x64编译了编译器-rt
  

制作clang_linux

使用

检查可用平台
make info-platforms