【问题标题】:C compiler cannot create executables during build of Coreutils with LLVMC 编译器无法在使用 LLVM 构建 Coreutils 期间创建可执行文件
【发布时间】:2020-03-20 19:50:13
【问题描述】:

我正在寻求一些帮助,以找出在使用 llvm 的 Coreutils 配置命令期间弹出的错误的解决方案。

我使用命令:

CC=wllvm ../configure --disable-nls CFLAGS="-g -O1 -Xclang -disable-llvm-passes -D__NO_STRING_INLINES -D_FORTIFY_SOURCE=0 -U__OPTIMIZE__"

并收到错误:

checking whether the compiler works...no
configure: error: in '/home/abhinath/coreutils/obj-llvm
configure: error: c compiler cannot create executables

我已经预先运行了命令export LLVM_COMPILER=clang

我已经使用命令在我的 Ubuntu 操作系统上安装并设置了 clang-6.0clang++-6.0

sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-6.0 1000
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-6.0 1000
sudo update-alternatives --config clang
sudo update-alternatives --config clang++

产生错误的config.log文件可以在这里查看,也显示 wllvm: command not found:

https://drive.google.com/open?id=1ExbLhT2tWRyGSAb67mAgu6D9y3AknZ2v

【问题讨论】:

  • CC=wllvm - 什么是wllvm? llvm 的 C 编译器被称为clang
  • @Mat wllvm 是一个 C 编译器,是 whole-program-llvm (WLLVM) 的一部分。我正在按照 klee 的 github 上的教程中的说明进行操作。具体步骤 3 从这里klee.github.io/tutorials/testing-coreutils
  • 好的。查看您的日志文件,看看它对wllvm 有什么看法
  • @Mat 我查看了日志,上面写着 wllvm: command not found ,你也可以看到。不知道如何解决这个问题
  • 您是否在系统中搜索过wllvm 程序?它安装在哪里?

标签: ubuntu clang llvm klee


【解决方案1】:

通常,/usr/local 中的任何内容都不包含在系统目录中。

而像usr/local/lib/python2.7/site-packages/some-directory 这样的非标准位置更是如此。

您需要找到wllvm 程序的确切 位置(如完整路径和绝对路径),然后使用该完整路径或将其目录添加到PATH 环境变量中。

【讨论】:

  • sudo -H python -m pip install wllvm 似乎是诀窍,现在可以了。
猜你喜欢
  • 2021-06-16
  • 1970-01-01
  • 2011-02-14
  • 2021-02-04
  • 1970-01-01
  • 2013-06-17
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多