[LLVMdev] LLVM as a shared library

Chris Bieneman beanz at apple.com
Tue Aug 5 13:49:03 PDT 2014


> On Aug 5, 2014, at 1:33 PM, Tom Stellard <tom at stellard.net> wrote:
> 
> On Tue, Aug 05, 2014 at 12:38:49PM -0700, Chris Bieneman wrote:
>> Hello LLVM community,
>> 
>> Over the last few years the LLVM team here at Apple and development teams elsewhere have been busily working on finding new and interesting uses for LLVM. Some of these uses are traditional compilers, but a growing number of them aren’t. Some of LLVM’s new clients, like WebKit, are embedding LLVM into existing applications. These embedded uses of LLVM have their own unique challenges.
>> 
>> Over the next few months, a few of us at Apple are going to be working on tackling a few new problems that we would like solved in open source so other projects can benefit from them. Some of these efforts will be non-trivial, so we’d like to start a few discussions over the next few weeks.
>> 
>> Our primary goals are to (1) make it easier to embed LLVM into external projects as a shared library, and (2) generally improve the performance of LLVM as a shared library.
>> 
> 
> This sounds great.
> 
>> The list of the problems we’re currently planning to tackle is:
>> 
>> (1) Reduce or eliminate static initializers, global constructors, and global destructors
>> (2) Clean up cross compiling in the CMake build system
> 
> One problem we have with the Mesa project is that the automake and CMake build
> system produce different shared libraries.  Automake builds libLLVM-major.minor.so
> while CMake builds a different shared library for each component: e.g. libLLVMSupport.so
> 
> To cope with this, Mesa's build system has to try to guess which build system
> was used in order to find the libraries.
> 
> Do you have plans to standardize the shared libraries produced by LLVM's build systems?

We had not planned to standardize the build systems, but it is interesting to consider. IMHO, maintaining two build systems is a royal pain.

> 
> Even better, will improving cross compiling in the CMake build system make
> it possible to completely drop automake?

I would really like to think so, but there will be quite a bit of work involved in getting everyone using the Automake build system to migrate off. One snag with getting off automake that I’m aware of is compiler-rt. I haven’t been able to make sense of the compiler-rt CMake configs well enough to come up with a good solution for cross-compiling.

-Chris

> 
> -Tom
> 
>> (3) Update LLVM debugging mechanisms for being part of a dynamic library
>> (4) Move overridden sys calls (like abort) into the tools, rather than the libraries
>> (5) Update TableGen to support stripping unused content (i.e. Intrinsics for backends you’re not building)
>> 
>> We will be sending more specific proposals and patches for each of the changes listed above starting this week. If you’re interested in these problems and their solutions, please speak up and help us develop a solution that will work for your needs and ours.
>> 
>> Thanks,
>> -Chris
>> _______________________________________________
>> LLVM Developers mailing list
>> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev





More information about the llvm-dev mailing list