[LLVMdev] LLVM footprint

Benjamin Smedberg benjamin at smedbergs.us
Mon Dec 3 12:02:15 PST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

What is the expected footprint of a tool using the LLVM JIT?

I have created a simple project that uses the LLVM C++ API to JIT calls to
XPCOM method signature... it works well, but the component DLL is very large
(Linux x86-74, 5.8MB optimized and stripped). Is this normal? Am I linking
to "too much" or not using the correct link flags?

Note that I'm not using the LLVM build system, I'm using the Mozilla build
system and manually pulling in the libraries I needed to resolve symbols...

The makefile is here:
http://hg.mozilla.org/users/bsmedberg_mozilla.com/llvm-test/?file/e021a9901b98/Makefile.in


EXTRA_DSO_LDOPTS = \
  $(XPCOM_GLUE_LDOPTS) \
  $(NSPR_LIBS) \
  -L$(LLVM_PREFIX)/lib \
  $(LLVM_PREFIX)/lib/LLVMJIT.o \
  $(LLVM_PREFIX)/lib/LLVMExecutionEngine.o \
  $(LLVM_PREFIX)/lib/LLVMInterpreter.o \
  $(LLVM_PREFIX)/lib/LLVMX86.o \
  -lLLVMTarget \
  -lLLVMCodeGen \
  -lLLVMScalarOpts \
  -lLLVMAnalysis \
  -lLLVMTransformUtils \
  -lLLVMSelectionDAG \
  -lLLVMAnalysis \
  -lLLVMCore \
  -lLLVMSupport \
  -lLLVMSystem \
  $(NULL)

and the C++ code is here:
http://hg.mozilla.org/users/bsmedberg_mozilla.com/llvm-test/?file/e021a9901b98/LLVMTest.cpp

Note that because this is a sharedlib I had to configure LLVM with
- --enable-pic --enable-optimize, but I used no other configure options...
should I have? Are there features that can be disabled to reduce footprint?

- --BDS

- --

Benjamin Smedberg
Platform Guru
Mozilla Corporation
benjamin at smedbergs.us
http://benjamin.smedbergs.us/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHVGDHSSwGp5sTYNkRAuLDAJ46kA/lCEyGInTpAtVmsxqdxnjKTACfeU/A
jUUXDH3bmUY5jpDrufLf+UQ=
=YnWY
-----END PGP SIGNATURE-----



More information about the llvm-dev mailing list