[ 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。