FS#58539 - [llvm] Enable symbol versioning
Attached to Project:
Arch Linux
Opened by Christoph Haag (haagch) - Thursday, 10 May 2018, 20:02 GMT
Last edited by Evangelos Foutras (foutrelis) - Tuesday, 26 March 2019, 20:37 GMT
Opened by Christoph Haag (haagch) - Thursday, 10 May 2018, 20:02 GMT
Last edited by Evangelos Foutras (foutrelis) - Tuesday, 26 March 2019, 20:37 GMT
|
Details
Relevant Debian thread (you don't need to read it):
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=849099
Description: This affects users who have an additional version of llvm installed somewhere and who are using an application that happens to load both llvm versions into its process. My example is mesa linked to a separate llvm7 installation. That works fine up until you use an application that loads mesa and and then the system llvm. One example is kdevelop. It loads qt->mesa->llvm7 from my custom installation. Then it loads clangplugin->llvm6 from arch repos, which makes the clangplugin crash. I believe for LLVM symbol versioning can be enabled with this switch when building with CMake (it seems to be disabled by default): -DLLVM_DYLIB_SYMBOL_VERSIONING=ON This would make life easier for mesa developers, llvm developers etc. |
This task depends upon
Closed by Evangelos Foutras (foutrelis)
Tuesday, 26 March 2019, 20:37 GMT
Reason for closing: Won't fix
Additional comments about closing: LLVM symbols are versioned. I am afraid we can't reasonably support Mesa being linked to non-system LLVM.
Tuesday, 26 March 2019, 20:37 GMT
Reason for closing: Won't fix
Additional comments about closing: LLVM symbols are versioned. I am afraid we can't reasonably support Mesa being linked to non-system LLVM.
I asked for clarification on the LLVM_DYLIB_SYMBOL_VERSIONING option, since I'm not sure how it relates to the linker script. [2]
[1] https://github.com/llvm-mirror/llvm/commit/cd789d8cfe
[2] https://reviews.llvm.org/D30997#1095542
Looking at the output of lsof, it has loaded:
- /usr/lib/libclang.so.6
- /usr/lib/libLLVM-6.0.so
- /usr/lib/libLLVM-7svn.so
So it seems to work fine for me.
Perhaps there is an issue with your custom LLVM 7 installation and/or some other weird interaction with Mesa or KDevelop.
[1] https://wiki.archlinux.org/index.php/Unofficial_user_repositories#mesa-git
Just to make sure: The kdevelop clang plugin crashes silently, you only see messages "libclang: crash detected during parsing: " etc. when starting kdevelop from a terminal.
I've seen the script but did not look close enough to see that it was not the same feature as the one enabled with LLVM_DYLIB_SYMBOL_VERSIONING which is disabled by default. So llvm is already supposed to version its libraries by default?
Apologies for the confusion then.
But I still don't understand why it crashes for me (when statically linking llvm into mesa, it doesn't crash).
My llvm build is this: https://gist.github.com/ChristophHaag/9119c43aef94d8d43bb3087ad04991b1
I first had it without -DLLVM_DYLIB_SYMBOL_VERSIONING=ON but with it on it doesn't make a difference.
I have /usr/lib/llvm-mesa/lib/ in my linker search path and one possible problem I see is that it creates /usr/lib/llvm-mesa/lib/libLLVM.so which may clash with /usr/lib/libLLVM.so but I thought symbol versioning would take care of that.
Anyway, I will experiment a bit more, starting with -DLLVM_APPEND_VC_REV=ON. Maybe I can close this issue as invalid soon.
For reference: This is the crash that does not happen when I link llvm7 statically to mesa or use a mesa linked to llvm6: https://gist.github.com/ChristophHaag/0c42c799f26b2c7557c7ae8237d9b194
I'll take a closer look when I can and see if this can be addressed.
ls -1 /usr/lib/llvm-mesa/lib/
BugpointPasses.so
cmake
libLLVM-7.0.0svn.so
libLLVM-7svn.so
libLLVMAggressiveInstCombine.a
libLLVMAMDGPUAsmParser.a
libLLVMAMDGPUAsmPrinter.a
libLLVMAMDGPUCodeGen.a
libLLVMAMDGPUDesc.a
libLLVMAMDGPUDisassembler.a
libLLVMAMDGPUInfo.a
libLLVMAMDGPUUtils.a
libLLVMAnalysis.a
libLLVMAsmParser.a
libLLVMAsmPrinter.a
libLLVMBinaryFormat.a
libLLVMBitReader.a
libLLVMBitWriter.a
libLLVMCodeGen.a
libLLVMCore.a
libLLVMCoroutines.a
libLLVMCoverage.a
libLLVMDebugInfoCodeView.a
libLLVMDebugInfoDWARF.a
libLLVMDebugInfoMSF.a
libLLVMDebugInfoPDB.a
libLLVMDemangle.a
libLLVMDlltoolDriver.a
libLLVMExecutionEngine.a
libLLVMFuzzMutate.a
libLLVMGlobalISel.a
libLLVMInstCombine.a
libLLVMInstrumentation.a
libLLVMInterpreter.a
libLLVMipo.a
libLLVMIRReader.a
libLLVMLibDriver.a
libLLVMLineEditor.a
libLLVMLinker.a
libLLVMLTO.a
libLLVMMC.a
libLLVMMCDisassembler.a
libLLVMMCJIT.a
libLLVMMCParser.a
libLLVMMIRParser.a
libLLVMObjCARCOpts.a
libLLVMObject.a
libLLVMObjectYAML.a
libLLVMOption.a
libLLVMOrcJIT.a
libLLVMPasses.a
libLLVMProfileData.a
libLLVMRuntimeDyld.a
libLLVMScalarOpts.a
libLLVMSelectionDAG.a
libLLVM.so
libLLVMSupport.a
libLLVMSymbolize.a
libLLVMTableGen.a
libLLVMTarget.a
libLLVMTransformUtils.a
libLLVMVectorize.a
libLLVMWindowsManifest.a
libLLVMXRay.a
libLTO.so
libLTO.so.7
libLTO.so.7svn
LLVMgold.so
LLVMHello.so
I'm not really sure what's going on either. :-)