Why GCJ won't load my plugin when compiling bytecode?
Li junsong
ljs.darkfish@gmail.com
Fri Sep 9 23:03:00 GMT 2011
On Sat, Sep 10, 2011 at 12:24 AM, Bryce McKinlay <bmckinlay@gmail.com> wrote:
> On Fri, Sep 9, 2011 at 10:57 PM, Li junsong <ljs.darkfish@gmail.com> wrote:
>>> I chose gcj to write plugin to do optimization. So I need its .class
>> files output, but not its binary code.
>> Modern versions of gcj only compile .class files to object code. gcj
> doesn't directly compile Java source code, nor generate bytecode.
> (early versions of gcj did do these things, but it was changed years
> ago)
>> When you give it .java source files, gcj actually first calls out to
> regular java compiler, then compiles the resulting .class files. You
> can see the commands its running by adding -v to your command line.
>>> If I do not get it wrong, it means that If I want to do such
>> optimization and measure
>> the outcome, I have to look for other compilers, ( since GCC plugins
>> won't work ) right?
>> That's right. A gcc plugin will never have a chance to run when using
> "gcj -C" because the gcc compiler itself is not run.
>> Bryce
>
Thank you so much!
Now I know it. But I'm just wondering if others would make the same mistakes.
Unless people put his questions in this mail list, he would get no chance
to find out these informations. I mean, I have referred to the GNU java homepage
( which told me they had been merged with project GNU ClassPath),
gcc internals(in which the chapter "Java Tree" is blank ! ), the "ecj stuff"(
There're lots of error in gcj when the first time I compiled my new
gcc 4.6), But I find
few resources talking about gcj "internals".
So, If there is any thing I can do, apart from putting the question I
met on my blog to
tell others "don't make the same mistake again", please just let me know.
Thanks,
J. Li
More information about the Java
mailing list