-
Notifications
You must be signed in to change notification settings - Fork 57
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
Fix DSO missing from command line error when llvm/clang build as shared libs #13
Conversation
Something is missing, tests on my system are passing successfully but not by upstream GA. |
Hey @xgupta ! Thank you for submitting this. The failing tests are confusing - your change looks rather unrelated! I've update the GA files and added a manual trigger. So -Andrzej |
It seems the second line of these tests is not correct when I run these tools separately I am getting missing compile_commands.json error. There are two ways to solve it.
I tried both ways but it is working and tests are still failing. I hope you know more about them? ref: https://eli.thegreenplace.net/2014/05/21/compilation-databases-for-clang-based-tools |
Hi @xgupta , thank you for investigating this! I've applied your changes and used LLVM-11 (and Clang 11) from Ubuntu repositories to build clang-tutor. When I run this test:
I get the following error:
Could you confirm that that's what you are seeing as well? IIUC (I need to confirm this!), it's caused by the fact that with your updates tools in I think that that ^^^ can be fixed by making the changes that you propose conditional:
Regarding the compilation database problem - yes, there should be Thanks again for looking into this! |
No, I didn't see any errors. It works perfectly. I download the LLVM source from https://releases.llvm.org/download.html and compile it on Arch Linux.
I think we should build clang-tutor considering that LLVM's BUILD_SHARED_LIBS is ON.
Thanks, I will also try if can find a solution.
Oh, then we should keep them as it is. |
Ah, so that's very different to what this action does: https://github.com/banach-space/clang-tutor/actions/runs/500436758. The binaries that you compiled on your Arch Linux and the pre-compiled binaries that that Action downloads will be configured differently. |
Yes. The current packages(11.0.1-1) available from Arch Linux, give errors while building clang-tutor so I build them from the source. BTW my CMake command was |
@banach-space, I looked at the https://github.com/llvm/llvm-project/blob/main/clang-tools-extra/clang-move/CMakeLists.txt |
Thank you for updating this! Unfortunately, with the current change in Normally you'd just add I need to take a step back and and think whether there's any way around this :) Would you mind checking whether shared library builds work for you? Perhaps I'm doing something wrong. |
Sorry, I messed with different configurations and branches, With the proposed changes, It is not working on my system also.
If this is the way then we should wait for PR(Phabricator) to merge into LLVM. And then Ubuntu to update its Clang package. Thanks for looking into it. |
Thanks, @banach-space for the opening issue. I think we should now close this PR. rational of PR is already on the issue. We will fix the issue once Ubuntu's clang package update next time. |
When we build LLVM/Clang as a shared library, we need to specify all shared libraries needed by clang-tutor' tools. Without that error like
undefined reference to symbol '_ZN5clang12ast_matchers8callExprE' /usr/bin/ld: /home/xgupta/dev/llvm-project-11.0.0/build/lib/libclangASTMatchers.so.11: error adding symbols: DSO missing from command line
occured.