[LLVMdev] LLVM library versionitis

Chris Lattner clattner at apple.com
Fri May 11 15:36:14 PDT 2012


On May 11, 2012, at 1:23 PM, Benjamin Kramer wrote:
>> Can I convince anybody else of the wisdom of this for future LLVM releases?
>> 
>> Alternately, and/or in the mean time, does anybody have suggestions for me about how to deal with the very real problem I have about an app (I don't control) linking an LLVM version that is incompatible with the LLVM versions required by a plugin that uses my library?
> 
> Since you're using dynamic linking you could get around patching by hiding LLVM's symbols to be internal to the shared library. This can be done with a list of symbols passed to the linker or by using visibility attributes[1] and building with -fvisibility=hidden. If you're supporting win32 you probably have a macro for __declspec(dllexport) already that could be reused.

I can say that this approach does work, and is really important.  Depending on what OS you're building for, using visibility hidden can work, or you can use an export file to make sure that no llvm symbols are exported from your [library / app] boundary.

-Chris



More information about the llvm-dev mailing list