Trouble compiling with ThinLTO #3750
Unanswered
SaberToothKnaw
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to compile Filament and its samples on and for Ubuntu 20.04 with LTO enabled. I can compile the artifacts using Clang 7 with no issues, but when enabling LTO I get strange linker errors. Furthermore, when I edit the cmake-generated build.ninja file to use -flto=full instead of -flto=thin, compilation succeeds. Could I get a heads-up on if I'm doing something wrong or if this is a filament build system issue? Thanks.
Here are my steps:
full ninja output log of the above:
filament_thinlto_compile.txt
but in short, cntrl-f "error:", and around line 836 I get multiple linker errors like so:
Using LTO appears to have an effect, as build artifacts are a few hundred KBs smaller and linking takes forever, relative to non-LTO release builds with the same flags otherwise. I got the same results using Clang 10 instead of Clang 7 as well. Thanks in advance for comments.
Beta Was this translation helpful? Give feedback.
All reactions