• 升级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。


  • 相关阅读:
    20191318实验四 《Python程序设计》实验报告
    20191318实验三 Socket编程技术
    20191318实验二 Python程序设计入门
    实验一 Python程序设计入门
    《信息安全专业导论》第十二周学习总结
    《信息安全专业导论》第十一周学习总结
    markdown画思维导图
    markdown页面内跳转
    20191206 2019-2020-2 《Python程序设计》实验四报告
    20191206 实验三《Python程序设计》实验报告
  • 原文地址:https://www.cnblogs.com/furzoom/p/7710149.html
Copyright © 2020-2023  润新知