-
Notifications
You must be signed in to change notification settings - Fork 125
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
[clang_delta] Link against LLVMSupport to fix missing APInt methods #125
Conversation
Link clang_delta against LLVMSupport in order to fix the following link failure: /usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: CMakeFiles/clang_delta.dir/ReplaceArrayIndexVar.cpp.o: undefined reference to symbol '_ZN4llvm5APInt12initSlowCaseERKS0_' /usr/lib64/libLLVMSupport.so.40: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status
Hi! Thank you for this pull request. Your pull request doesn't say what version of LLVM you are linking against, what OS you are using, etc. Can you tell me these things? Note that the master branch of C-Reduce is intended to link with the current release version of LLVM, currently 3.9.0. We generally have a separate branch for linking against development versions of LLVM. (We don't currently have that separate branch, but we will recreate it after the upcoming release of C-Reduce.) Thanks! |
Well, the LLVM version is in the linker error. It's git from 2-3 days ago.
Distribution is Gentoo, with all LLVM parts built as shared libraries. I think I've had some issues building against 3.9.0 but didn't downgrade to confirm. I've assumed that linking against LLVMSupport will always be safe. |
Note that most systems won't notice this since they're either using single-shared-library model or static libraries. With the first, the Support code will be in the shared library anyway. With the second, it will be pulled in as a dependency of other libraries. |
Ok, here's a little update. I've tested more and it seems that nobody reported this before because Gentoo was using autotools so far, and autotools link to the support library correctly (or rather AFAICS they just link to all LLVM libraries). I can reproduce the issue when using CMake on Gentoo LLVM 3.9.0. |
Thanks for the investigation! I will try to reproduce this before making the upcoming C-Reduce release. I'm assuming that you compiled LLVM 3.9.0 for yourself. Can you give me the exact options that you used to compile LLVM 3.9.0? This will help me to reproduce the problem and test your fix. |
No, I've used the standard Gentoo ebuild.
Sure. Here they are:
I've added some random line wrapping to attempt to make them readable on GitHub. Note that some of them may require Gentoo patches but they shouldn't be relevant here. However, I think the only really relevant flag here is |
Thanks! (I am hoping to reproduce the problem on something other than Gentoo, because I don't have a Gentoo box handy. We will see how it goes!) |
Gentle ping. Any success? |
I'm sorry, but I haven't had time to look at this yet. |
I reproduced the problem tonight on Ubuntu 14.04 with
I confirmed that your patch fixes the problem. Thanks you again! I also checked the |
Link clang_delta against LLVMSupport in order to fix the following link
failure: