-
Notifications
You must be signed in to change notification settings - Fork 1.6k
"libtdclient.a: error adding symbols: file format not recognized" and "ld returned 1 exit status" #1244
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
Comments
Do you have enough memory on the server for successful build? |
yep, @levlam, there's more than enough, it's my own machine here, all good. But I have more evidences! Curiously, I switched the instructions to here's what worked, to be specific: export CXXFLAGS=""
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=../tdlib -DTD_ENABLE_LTO=ON ..
cmake --build . --target install |
g++ is known to need 2-2.5 times more memory than clang to build TDLib. And the most common way to create a broken static library is to observe a compiler crash due to memory exhaustion. |
But anyway, the g++ build is fine, even using more memory. I think there's an issue with this clang++ instructions, then. Or it's just bad luck that it doesn't work for me, haha |
This is expected with LTO, because when Link-Time optimization is used .a files contain parsed source code in a compiler-specifiс format to be used by linker instead of a compiled static library functions.
This isn't expected without LTO, but it is impossible to find the reason without debugging the issue. One way to do that is to run
to find exactly invoked command and then retry it manually to investigate. I managed to build TDLib on Ubuntu 20 using clang and build instructions from https://tdlib.github.io/td/build.html on a freshly installed Ubuntu 20 without any issues. |
after #1241 (so there might be a few more evidences there, like the printed commands I used), I tried to run a few simple codes.
main.cpp:
(I tried to copy and paste the cpp example but the result is the same, any attempt to call the actual functions are bad, only the includes are working.)
and cmakelists.txt:
then I get this error:
if I try to rebuild everything without Link Time Optimization:
I tried to compile using both
master
branch andv.1.6.0
tagged head, and erasedbuild/
andtdlib/
before retrying.does someone have any idea?
The text was updated successfully, but these errors were encountered: