2

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

当我编译编译器-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$
4

2 回答 2

2

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

专业提示:使用 CMake+Ninja 构建整个东西要快得多。请参阅此处的说明

于 2013-06-10T18:46:53.293 回答
1

我使用为 i386 和 x64 编译了 compiler-rt

制作 clang_linux

使用检查可用平台

make info-platforms
于 2014-02-26T10:35:10.173 回答