如何修复编译 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/