This is the mail archive of the
mailing list for the GCC project.
Re: Can gcj cross compile C / C++ programs into java byte code?
- To: Johan Walles <johan dot walles at appeal dot se>
- Subject: Re: Can gcj cross compile C / C++ programs into java byte code?
- From: Jeff Sturm <jsturm at one-point dot com>
- Date: Fri, 31 Aug 2001 12:09:13 -0400 (EDT)
- cc: gcc at gcc dot gnu dot org
On Fri, 31 Aug 2001, Johan Walles wrote:
> I've read the FAQ at "http://gcc.gnu.org/java/faq.html", but the
> question isn't answered there. Can gcj cross compile C / C++ programs
> into java byte code? Why (not)?
No. Gcj can do any of:
java source -> java bytecode
java source -> native object
java bytecode -> native object
It doesn't understand C/C++ syntax at all. I suppose one could consider
implementing -femit-class-files on the c++ frontend, though I suspect
mapping the trees to legal java bytecode could be exceedingly difficult.
Java bytecode is really poorly suited to be a general-purpose IR.