zoukankan      html  css  js  c++  java
  • 升级GCC 6.2编译LLVM的问题

    [ 55%] Built target RTInterception.x86_64
    [ 55%] Building ASM object projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoTermination.x86_64.dir/sanitizer_linux_x86_64.S.o
    cc: error trying to exec 'cc1': execvp: No such file or directory
    make[2]: *** [projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoTermination.x86_64.dir/sanitizer_linux_x86_64.S.o] Error 1
    make[1]: *** [projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoTermination.x86_64.dir/all] Error 2
    make: *** [all] Error 2

    1 下载llvm

    下载上面三个包得到
    cfe-3.9.1.src.tar.xz
    compiler-rt-3.9.1.src.tar.xz
    llvm-3.9.1.src.tar.xz
    解压
    xz -d llvm-3.9.1.src.tar.xz
    xz -d compiler-rt-3.9.1.src.tar.xz
    xz -d cfe-3.9.1.src.tar.xz
    tar xf llvm-3.9.1.src.tar
    tar xf compiler-rt-3.9.1.src.tar
    tar xf cfe-3.9.1.src.tar

    将compiler-rt-3.9.1.src复制到llvm-3.9.1.src/tools下,并重命名为clang。将cfe-3.9.1.src复制到llvm-3.9.1.src/projects下,将重命名为compiler-rt。

    cd llvm-3.9.1.src
    mkdir build
    cd build
    cmake ../ -DCMAKE_CXX_COMPILER=/usr/local/bin/c++ -DCMAKE_C_COMPILER=/usr/local/bin/gcc
    make

    因为自己编译安装的gcc 6.2,原来的/usr/bin/gcc还在,所以指定自己编译器。(GCC 6.2 安装请点这里)。

    出现如下错误:

    [ 55%] Built target RTInterception.x86_64
    [ 55%] Building ASM object projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoTermination.x86_64.dir/sanitizer_linux_x86_64.S.o
    cc: error trying to exec 'cc1': execvp: No such file or directory
    make[2]: *** [projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoTermination.x86_64.dir/sanitizer_linux_x86_64.S.o] Error 1
    make[1]: *** [projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoTermination.x86_64.dir/all] Error 2
    make: *** [all] Error 2
    添加cc1的链接

    ln -s /usr/local/libexec/gcc/x86_64-pc-linux-gnu/6.2.0/cc1 /usr/local/bin/cc1

    再次执行make,成功编译。为测试多个版本,不进行make install。


  • 相关阅读:
    2. Add Two Numbers
    1. Two Sum
    leetcode 213. 打家劫舍 II JAVA
    leetcode 48. 旋转图像 java
    leetcode 45. 跳跃游戏 II JAVA
    leetcode 42. 接雨水 JAVA
    40. 组合总和 II leetcode JAVA
    24. 两两交换链表中的节点 leetcode
    1002. 查找常用字符 leecode
    leetcode 23. 合并K个排序链表 JAVA
  • 原文地址:https://www.cnblogs.com/furzoom/p/7710149.html
Copyright © 2011-2022 走看看