[LLVMdev] Lightweight code loader
Alexander Friedman
alex at inga.mit.edu
Sun May 15 22:58:58 PDT 2005
Hi list,
The short version of my question: Is it easy to make a lightweight
(read: small in size) linker loader for code produced by the llvm
jit. Does it even make sense to do so?
The longer version: Suppose I have some llvm bytecode module A, and I
want to load and use that code in some runtime. The two obvious ways
to do that are a) use the LLVM jit, or b) compile the module into a
dynamic library and load it then.
Option b, as I understand, doesn't work on Windows. Option a requires
having the LLVM jit linked to the runtime. This seems reasonable, but
as it turns out, the LLVM jit is several times larger than our runtime
(yes, the Release version): ~5 M vs ~.5 M.
Would it be possible (ie, relatively straitforward) to do the
following: Take the code in module A, compile it with the JIT (since
we cannot make libraries in Windows), and save the resulting binary
goo in some file. Later (in a different instance of the runtime), with
some much smaller sized loader, read in the file and link that code to
the runtime. The platforms we care about this working on is the x86,
ppc, and sparc v9.
While it would be nice to be able to build a runtime that only
contains the absolute minimal, this seems rather non-trivial, but
maybe I am wrong. If this is indeed involved, fraught with danger (ie,
would make it impossible to debug) etc, let me know as well.If there
is some other clever (or obvious) way to accomplish the same thing,
I'd love to hear any ideas.
--
-Alex
More information about the llvm-dev
mailing list