llvm - 如何修复 "warning: overriding the module target triple with x86_64-pc-linux-gnu [-Woverride-module]"

标签 llvm

如何修复编译 LLVM 代码时 clang 产生的以下警告?

$ clang test.ll
warning: overriding the module target triple with x86_64-pc-linux-gnu [-Woverride-module]
1 warning generated.

最佳答案

当 LLVM IR 代码未显式指定编译目标时,就会发生这种情况。要修复此问题,请指定 target triple.ll 文件的顶部,例如:

target triple = "x86_64-pc-linux-gnu"

请务必将 x86_64-pc-linux-gnu 替换为警告消息中显示的目标。 (您还可以通过运行 llvm-config --host-target 来获取目标。)

关于llvm - 如何修复 "warning: overriding the module target triple with x86_64-pc-linux-gnu [-Woverride-module]",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72449185/

相关文章:

c++ - 识别 LLVM 中 block 的封闭循环

c++ - 如何在 Windows 上将 lld 与 CMake 一起使用?

windows - 在 Windows 上编译 Clang

c++ - LLVM 它是什么以及我如何使用它来跨平台编译

gcc - 通过 makefile 传递 gcc 标志

macos - 如何在 Mac OS X 10.9 中编写 llvm pass

c++ - 不链接编译

llvm - 哪些语言可以编译为 WebAssembly (Wasm)?

c - posix_memalign、malloc 和 calloc 在 lli 解释器中存在问题

c++ - 所有 LLVM 层的用途是什么?