[LLVMdev] Shared library support of llvm

Reid Kleckner rnk at google.com
Wed May 8 09:21:39 PDT 2013


I've never tried building LLVM dlls on Windows, so this is all from
faulty mailing list memory.

You should be able to make a ginormous LLVM.dll that includes
everything you need just once.  This should avoid your duplicate data
in depending DLLs problem.  Someone else may know how to do this, or
you can search the list.

Splitting LLVM's internal libraries up into little dlls would speed up
incremental builds, but it's not easy.  There's no way to blanket
export every symbol from a dll.  Even if you did, I've heard there are
issues with exporting more than 2^16 symbols.

Adding targeted dllexport annotations won't work because non-Windows
developers (the majority) shouldn't be burdened with keeping them up
to date.

On Wed, May 8, 2013 at 11:30 AM, Peng Cheng <gm4cheng at gmail.com> wrote:
> According to http://llvm.org/docs/CMake.html, "Shared libraries are not
> supported on Windows and not recommended in the other OSes".
>
> The problem is that static libraries have some limitations, especially when
> linked into multiple shared libraries, the global data of llvm could have
> multiple copies leading to undefined behaviors.  This has caused much pains
> during my usage of llvm.
>
> My questions are:
>
> 1. What are the reasons to not support shared libraries on Windows and not
> recommended in other OSes?
>
> 2. Are there any plans to support shared libraries?
>
> Thanks very much for any information!
>
> Best,
> -Peng
>
> _______________________________________________
> 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