LLVM as shared libraries

Hi,

is there an option to build LLVM's libs (and maybe clangs, but that's
for later :slight_smile: as shared libraries? It's not --enable-shared :slight_smile: If it
doesn't exist: is there any interest to have it? It would reduce my
build time considerably...

Cheers, Axel.

Axel Naumann <Axel.Naumann@cern.ch> writes:

is there an option to build LLVM's libs (and maybe clangs, but that's
for later :slight_smile: as shared libraries? It's not --enable-shared :slight_smile: If it
doesn't exist: is there any interest to have it? It would reduce my
build time considerably...

With cmake it is BUILD_SHARED_LIBS

http://www.llvm.org/docs/CMake.html

The doc says it is not recommended because it increases process startup
time, which is very noticeable if you run your compiler lots of times
(i.e. a test suite).

Hi Γ“scar,

Axel Naumann <Axel.Naumann@cern.ch> writes:

is there an option to build LLVM's libs (and maybe clangs, but that's
for later :slight_smile: as shared libraries?

With cmake it is BUILD_SHARED_LIBS

Building LLVM with CMake β€” LLVM 18.0.0git documentation

Great! So I must use CMake instead of configure / make to get shared libs?

The doc says it is not recommended because it increases process startup
time, which is very noticeable if you run your compiler lots of times
(i.e. a test suite).

I'm not, I'm *building* my compiler tons of times :wink:

Thanks for your quick reply!

Cheers, Axel.

Axel Naumann <Axel.Naumann@cern.ch> writes:

With cmake it is BUILD_SHARED_LIBS

Building LLVM with CMake β€” LLVM 18.0.0git documentation

Great! So I must use CMake instead of configure / make to get shared libs?

I don't know about configure/make. Cmake should work.

The doc says it is not recommended because it increases process startup
time, which is very noticeable if you run your compiler lots of times
(i.e. a test suite).

I'm not, I'm *building* my compiler tons of times :wink:

It takes 8 seconds to statically link a debug-mode JITter with all
optimization passes and bitwriter on a Linux 64bits 2.4 GHz Intel
Q6600. Generates a 114 MB file. If yours requires much more time, check
that you are using a recent version of binutils.

A release mode build links much faster.

Thanks for your quick reply!

You're welcome.