This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Java to C through an intermediate assembly
- From: Tony Kimball <alk at pobox dot com>
- To: hmobarak at ellipsisdigital dot com
- Cc: java at gcc dot gnu dot org
- Date: Tue, 20 Nov 2001 20:19:15 -0600
- Subject: Java to C through an intermediate assembly
- References: <OCEPKDOELLCFLGBCHLKOOEEPCBAA.hmobarak@ellipsisdigital.com>
- Reply-to: alk at pobox dot com
Quoth Hamdy Mobarak on Tuesday, 20 November:
: Dear,
: I am asking about if it is possible to convert java program to an
: intermediate
: assembly (say assembly of Intel microprocessor), and then decompile this
: intermediate
: assembly to get the C version of the input java program?
: Thanks
Darling,
It all depends on finding a good -- nay, superlative -- C decompiler
for one of the supported targets. I've not worked with recent
decompilers. I did use a SPARC decompiler from circa 1992 once, but
it wasn't up to this sort of task: It was tuned to recognize optimized
code produced by the then-current Sun C compiler (which was primitive
by modern standards), and would choke on some gcc-emitted code. But,
Jeff Sturms discouraging comment notwithstanding, such beasts do
exist. They are generally closely held and hard to find. Of course
the result for gcj-emitted code would be C code that depended
extensively on libgcj.
At a guess, I'd say the first place to look for a high-quality
decompiler would be Windows, and the second would be Solaris. To
round-trip on Windows you'd need to finish the mingw32 port of GCJ, to
get GCJ to emit something that runs correctly in its runtime first.