This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Converting the gcc backend to a library?
Martin v. Loewis wrote:
> And then, the compiler backend generates assembly code. Ok, so you
> link in the assembler and the linker as well. That produces an object
> file, which you'll have to load via dlopen. I don't think anybody with
> an understanding of the issues would consider such a technology for
> JIT...
You wouldn't use the linker in a JIT, and I'm sure you wouldn't link and
then dlopen files. You'd just assemble direct to memory. That could be
using the assembler extracted from binutils, or any of the many others.
<wishful thinking> Maybe even preprocess the insn pattern templates to
generate code directly in most cases ;-) </wishful thinking>
> I think even if gcc *was* a shared library, we would be still *years*
> away from a dynamic compilation environment.
I don't think it'd take much work to assemble direct into RAM and then
call the assembled code.
-- Jamie