questions about shared library ...

During my project, it was very slow when I linked my program with the
static libraries vmcore, asmparser, and support.a.
Then I tried to compile these LLVM modules as shared libraries, by set
SHARED_LIBRARY = 1 for those makefiles. It did generate the *.so libraries.

However, when I linked with the shared libraries, it always complained that
…llvm/lib/Debug/ undefined reference to dlerror' ...llvm/lib/Debug/ undefined reference to dlopen’
…llvm/lib/Debug/ undefined reference to `dlsym’

Do you have any suggestion for this problem? Also, do you have any plan
to enhance your makefiles to provide developers the shared libraries?


The symbols you mentioned are part of libtool's which is an attempt to
provide cross platform support for shared libraries. You'll need to install and provide the -ldl option to the linker (e.g. TOOLLIBOPTSB
argument). See the new makefile documentation at for more details.

There is no plan to enhance the makefiles to build shared libraries as they are
not needed by most users and slow down the build. If you wish to create shared
libraries, I suggest you link a shared library with whatever contents you wish
based on the various .o files generated by the makefiles today. You can do this
, for example, by adding a new target to the llvm/Makefile that builds the
library you desire.


Yiping Fan wrote: