Signals: interpreter vs. JIT

Just a quick question on LLVM, signals, and the lli interpreter. A sample
program is included at the end. Platform is x86, Linux, 32-bit, GCC 4.2.4.

Does lli -force-interpreter support signals, or is it only the JIT that
does? The following sample program crashes with lli 2.5 and lli
top-of-tree.

Thanks and regards,
Matt

Hello Matt,

The interpreter doesn't support external functions at all. This includes the printf function from the glibc library. That's why the signal causes a segfault.

If you're interested in bringing the interpreter up-to-date with the JIT compiler, I would welcome it since JIT compilation isn't supported on all platforms.

--Sam

Samuel Crow wrote:

Hello Matt,

The interpreter doesn't support external functions at all. This includes the printf function from the glibc library. That's why the signal causes a segfault.

Yes it does. It always supports atexit, exit, abort, printf, sprintf, sscanf, scanf and fprintf. With libffi installed / detected by configure, it will be able to call almost any function (there's a TODO in there).

Nick

Sam, Nick, thank you both for your reply--that was what I thought but wanted
to check. The JIT compiler for x86 is pretty robust. Are you aware of any
comprehensive list of the most "significant" functional differences between
the interpreter and the JIT for x86, i.e. a TODO list? grep -I todo * ?

I've just got a rather large project here (user-mode Linux) which works with
the x86 JIT, but it'd be really great if we could get it working with the
interpreter as well, so I may take you up on your offer--it's TBD at this
point though.

Thanks and regards,
Matt

Matt Renzelmann wrote:

Sam, Nick, thank you both for your reply--that was what I thought but wanted
to check. The JIT compiler for x86 is pretty robust. Are you aware of any
comprehensive list of the most "significant" functional differences between
the interpreter and the JIT for x86, i.e. a TODO list? grep -I todo * ?

Sure, all the TODO comments in lib/ExecutionEngine/Interpreter/* . Also, it was never updated for first-class structures (ie. llvm registers that hold entire structures). To my knowledge, that's an exhaustive list of everything missing in the interpreter.

I've just got a rather large project here (user-mode Linux) which works with
the x86 JIT, but it'd be really great if we could get it working with the
interpreter as well, so I may take you up on your offer--it's TBD at this
point though.

Why? Portability?

Nick

Not that I know if. If someone wanted to pursue this a good place to
start would be getting llvm-test to work with lli with
-force-interpreter.

- Daniel