From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8749 invoked by alias); 9 Sep 2011 22:24:52 -0000 Received: (qmail 8741 invoked by uid 22791); 9 Sep 2011 22:24:51 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,TW_GC X-Spam-Check-By: sourceware.org Received: from mail-qy0-f182.google.com (HELO mail-qy0-f182.google.com) (209.85.216.182) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 09 Sep 2011 22:24:33 +0000 Received: by qyk4 with SMTP id 4so302948qyk.20 for ; Fri, 09 Sep 2011 15:24:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.224.202.198 with SMTP id ff6mr1937223qab.285.1315607073013; Fri, 09 Sep 2011 15:24:33 -0700 (PDT) Received: by 10.229.74.81 with HTTP; Fri, 9 Sep 2011 15:24:32 -0700 (PDT) In-Reply-To: References: Date: Fri, 09 Sep 2011 22:24:00 -0000 Message-ID: Subject: Re: Why GCJ won't load my plugin when compiling bytecode? From: Bryce McKinlay To: Li junsong Cc: Andrew Pinski , java@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes Mailing-List: contact java-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-owner@gcc.gnu.org X-SW-Source: 2011-09/txt/msg00003.txt.bz2 On Fri, Sep 9, 2011 at 10:57 PM, Li junsong 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