clang support for fat-lto-objects
Asked Answered
I

1

3

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.
Infundibulum answered 16/5, 2022 at 13:50 Comment(0)
L
1

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

Lafleur answered 30/12, 2023 at 15:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.