Ubuntu20.04编译OLLVM踩坑

Ubuntu20.04编译OLLVM踩坑,第1张

Ubuntu20.04编译OLLVM踩坑 参考链接

总体安装步骤大同小异,详细步骤请参考下述链接:

OLLVM环境搭建-编译x86指令集可执行程序-Ubuntu 20.04跟着铁头干混淆2 ubuntu20.04编译ollvm cmake报错

obfuscator/cmake/config.guess: 71: Syntax error: word unexpected (expecting "in")
 CMake Error at cmake/modules/GetHostTriple.cmake:27 (message):
  Failed to execute /home/computador/gsrc/independent/llvm/cmake/config.guess 
 Call Stack (most recent call first): cmake/config-ix.cmake:380 (get_host_triple) CMakeLists.txt:611 (include)
-- Configuring incomplete, errors occurred! See also 
"/home/computador/gsrc/independent/llvm_build/build/CMakeFiles/CMakeOutput.log". See also 
"/home/computador/gsrc/independent/llvm_build/build/CMakeFiles/CMakeError.log".

经过查阅相关类似问题的解决方案,如cmake增加-DLLVM_INCLUDE_TESTS=OFF选项等,均不奏效。最终在StackOverFlow上面一位网友提供的解决方案成功的解决了此问题,主要的原因是在config.guess文件中存在一些DOS行结尾(DOS line endings),需要将其转换为Unix行结尾。

sudo apt-get install dos2unix
dos2unix path/to/config.guess

从头再来即可成功编译OLLVM

欢迎分享,转载请注明来源:内存溢出

原文地址: https://www.outofmemory.cn/zaji/5713456.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-18
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存