simple questions -and wiki

Hello All,

Some people thought about a n LLVM wiki. Is there some alreadly? I wish it
would be linked from LLVM.org site.

Here are a few questions which I would like to be answered (preferably on a Wiki, to possibly participate):

assuming that LLVM (latest from CVS) was configure-d with
  ./configure '--ENABLE-TARGETS=HOST-ONLY' '--WITH-GNU-LD'

My main (currently platonic - ie no real work yet) interest is in dynamic
code generation within my application. but i might want possibly to persist
the generated code (and somehow relead it at next application run).

how to emit an llvm moduls as (all of)
  an elf shared object
  a generated c file
  a JIT-ted in-memory module

are all the above compatible?

does an elf reader exists which does a dlopen (or very near equivalent)?

if the generated c file is compiled (with e.g. -fpic -shared on amd64/linux)
does the so compiled .so file is equivalent to the elf shared object (are
the symbols the same)? and to the JIT-ed memory module?

are machine code quality of JIT-ed memory module or of elf shared object
comparable?

i'm also suggessting adapting the simple JIT examples (or providing new
ones) to possibly emit c file or elf shared object?

how to delete the code in a JIT-ed in-memory module?

i cannot figure out how to canonically get the host target (ie the
TargetMachine argument to ElfWriter) when configured with
'--enable-targets=host-only' - shouldn't we have only one TargetMachine in
that case? Mayvbe a static TargetMachine* TargetMachine::getHostTarget()
function could help?

Regards, and thanks for reading.

Some people thought about a n LLVM wiki. Is there some alreadly? I wish it
would be linked from LLVM.org site.

It is wiki.llvm.org, but it is only partially set up. For now, please send email to John Criswell if you want write access.

Here are a few questions which I would like to be answered (preferably on a Wiki, to possibly participate):

assuming that LLVM (latest from CVS) was configure-d with
./configure '--ENABLE-TARGETS=HOST-ONLY' '--WITH-GNU-LD'

My main (currently platonic - ie no real work yet) interest is in dynamic
code generation within my application. but i might want possibly to persist
the generated code (and somehow relead it at next application run).

how to emit an llvm moduls as (all of)
an elf shared object
a generated c file
a JIT-ted in-memory module

are all the above compatible?

These can all be generated with llc or lli.

does an elf reader exists which does a dlopen (or very near equivalent)?

Why not just use dlopen?

if the generated c file is compiled (with e.g. -fpic -shared on amd64/linux)
does the so compiled .so file is equivalent to the elf shared object (are
the symbols the same)?

Yes.

and to the JIT-ed memory module?

I don't know what this means.

are machine code quality of JIT-ed memory module or of elf shared object
comparable?

Yes, they use the same code generator.

i'm also suggessting adapting the simple JIT examples (or providing new
ones) to possibly emit c file or elf shared object?

Why would you want to emit C?

how to delete the code in a JIT-ed in-memory module?

ExecutionEngine::freeMachineCodeForFunction

i cannot figure out how to canonically get the host target (ie the
TargetMachine argument to ElfWriter) when configured with
'--enable-targets=host-only' - shouldn't we have only one TargetMachine in
that case? Mayvbe a static TargetMachine* TargetMachine::getHostTarget()
function could help?

The elf writer isn't stable/complete yet. I suggest emitting .s files and invoking the system assembler.

-Chris