我有一个项目,我为我的主要目标使用 -flto = thin
,但是我不想将LTO应用于测试,因为它会减慢汇编(完整上下文:
正如建议的那样,在这里,如果您使用 lto
对象文件,则可能是仅包含中间语言,而没有二进制代码。因此,测试将始终与LTO
GCC 相关可用于LTO链接和正常链接。”
- Clang有类似的东西吗?看起来
clang ++ 13
fat-lto-objects
选项只是忽略了。
I have a project where I use -flto=thin
for my main targets, but I don't want to apply LTO to my tests since it slows compilation down (full context: lld runs LTO even if -fno-lto is passed).
As it is suggested here, it is likely that if you compile with lto
the object files will only contain the intermediate language and no binary code. Therefore the tests will always be linked with LTO
GCC has the fat-lto-objects
option: "Fat LTO objects are object files that contain both the intermediate language and the object code. This makes them usable for both LTO linking and normal linking."
- Does clang have anything like that? It looks like that as for
clang++13
the fat-lto-objects
option is just ignored.
发布评论
评论(1)
应该在Clang 17中发布, https://llvm.gm.org/docs/docs/fatlto.html
Confusingly, this LLVM ticket mentions it only comes out in LLVM 18. https://github.com/llvm/llvm/llvm-project/issues/55431#issuecomment-1694769726
This was supposed to be released in Clang 17, https://llvm.org/docs/FatLTO.html
https://www.phoronix.com/news/LLVM-Fat-LTO-Objects
Confusingly, this LLVM ticket mentions it only comes out in LLVM 18. https://github.com/llvm/llvm-project/issues/55431#issuecomment-1694769726