根据 LLVM's Getting Started (Windows) site :
... Clang can be used to emit bitcode, directly emit object files or even linked executables using Visual Studio’s link.exe.
为什么需要在 Windows 上使用 Link.exe
?而且,就此而言,在 Mac/Linux 上使用什么?再往下说:
Compile the program to object code using the LLC code generator:
C:\..> llc -filetype=obj hello.bc
Link to binary using Microsoft link:
C:\..> link hello.obj -defaultlib:libcmt
为什么 LLC 不能执行最后一步? LLI 似乎工作正常,所以我假设它在幕后以某种方式与 link.exe
互操作 - 为什么 LLC 不能?
最佳答案
因为没有人为 LLVM 编写过链接器。
有一个项目可以这样做(称为lld
)但还没有准备好。
参见 http://lld.llvm.org了解更多详情。
在 mac 上,人们使用 Apple 的链接器,ld
。
在 Linux 上,大多数人使用 gnu 链接器,通常(也)命名为 ld
关于windows - 为什么 Windows 上的 clang/llvm 需要 Visual Studio 的 Link.exe?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14313439/