-
-
Notifications
You must be signed in to change notification settings - Fork 273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compilation fails with LTO #445
Comments
I don't know if my comment will help in any way, maybe I incorrectly applied some environment variables, but in my case, there were no errors when using clang-18. Unfortunately, I can't try it on the versions below. my env: LLVM=-18
CC=clang-18
CXX=clang++-18
LD=lld-18 commands: cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-flto" ..
make -j16 output:
Compilation is successful, logid is working correctly. |
@stvoidit And you tested with |
@ConiKost If this command is correct, then yes, everything was successful. The compilation was completed without errors cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-flto -Werror=odr" .. |
I am not able to build. It stills fails for me with
|
To be honest, I don't really understand these tools either. For me, these are just tools, some I trust more, some less. I don't really understand the essence of the problem, because by default the project is going without full lto? It seems to me that assembling with -flto is saving on matches. I think this is not a project that requires this level of optimization. I don't know if you need my advice, but using docker to compile static executable files is extremely convenient, or just testing. offtop: I started using LLVM after in some of my golang projects that use C library dependencies and compiled with GCC 12-14, in some scenarios they gave out a complete crash with creepy traces. After trying to replace GCC with LLVM, I got more stable builds. Since then, I have been compiling fresh releases of the Linux kernel, python, etc. and so on only with clang+llvm. But this is just my experience, maybe for something you need to have a stable compilation with all the tools |
If LTO is enabled, compilation will fail. You can use
-Werror=odr
to test this.The text was updated successfully, but these errors were encountered: