[LLVMdev] How do you Build LLVM Statically Linked?

David J.A. Koogler djakoogler at charter.net
Wed Apr 30 19:13:08 PDT 2008


Anders Johnsen wrote:

> I think there is a
> 
> ./configure --enable-static
> 
> switch - have you tried that?

Yes, but that only seems to force building static libraries, not
statically linked tools.

Kenneth Boyd wrote:

 > The --disable-shared option to configure should work (like it does for
 > most configure-scripted projects).

No, I tried that and still got dynamically linked tools. It did not work
for GCC either. I got the GCC tools statically linked by defining
LD_FLAGS on the make invocation:

     make LD_FLAGS = \"-static\"

Searching through the LLVM makefiles, I saw a make variable called 
LD.Flags but alas trying to set that externally like I did for GCC
did not have the desired affect. All of the tools were still linked
dynamically.

So at least I have statically linked GCC front ends which makes it
easier to run the compiler on some of my target processors which do
no have dynamic libraries, but I would like to be able to run the
whole LLVM suite.

Dave Koogler



More information about the llvm-dev mailing list