JIT binary translation using libgccjit?

David Malcolm dmalcolm@redhat.com
Thu Jan 1 00:00:00 GMT 2015


On Sat, 2015-10-17 at 20:10 +0900, Kaz Nishimura wrote:
> I am looking for a JIT code generator for a runtime binary translator.
> Is libgccjit suitable for such an application?  

Possibly.

Note that libgccjit currently doesn't support cross-compilation: it can
only generate host code (host == target).

> I would like a
> light-weight code generator that can emit target code even for
> non-structured source (= binary) code in reasonable time.

That depends on what you mean by "light-weight" and "reasonable time".
libgccjit generates assembler internally, then calls out to external
binaries to turn that assembler into a .o then a .so shared library, and
dlopens it; typically that takes about 50ms on my box per compile.

Dave



More information about the Jit mailing list