From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28083 invoked by alias); 8 Apr 2012 13:18:28 -0000 Received: (qmail 28053 invoked by uid 22791); 8 Apr 2012 13:18:26 -0000 X-SWARE-Spam-Status: No, hits=-4.9 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_NO,RCVD_IN_HOSTKARMA_YE,TW_GC X-Spam-Check-By: sourceware.org Received: from mail-wg0-f51.google.com (HELO mail-wg0-f51.google.com) (74.125.82.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 08 Apr 2012 13:18:12 +0000 Received: by wgbed3 with SMTP id ed3so2768924wgb.8 for ; Sun, 08 Apr 2012 06:18:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.180.94.33 with SMTP id cz1mr9158003wib.13.1333891091173; Sun, 08 Apr 2012 06:18:11 -0700 (PDT) Received: by 10.216.230.218 with HTTP; Sun, 8 Apr 2012 06:18:11 -0700 (PDT) In-Reply-To: References: <4396cf72-3914-4b1f-a00e-92c94512d2f8@zmail17.collab.prod.int.phx2.redhat.com> Date: Sun, 08 Apr 2012 13:18:00 -0000 Message-ID: Subject: Re: Which library implementation to use/work on? From: Mike Hearn To: Bryce McKinlay Cc: GCC Java Content-Type: text/plain; charset=UTF-8 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: 2012-04/txt/msg00004.txt.bz2 Thanks, I got it to work eventually. That switch disables building of ecj so I had to first compile without it, then install, then adjust my path, then reconfigure/make/make install - bit confusing. I then encountered a couple of other issues. Firstly it seems there's something odd about the Google protocol buffers library that gcj does not like: com/google/protobuf/SingleFieldBuilder.java: In method 'com.google.protobuf.SingleFieldBuilder.mergeFrom(com.google.protobuf.GeneratedMessage)': com/google/protobuf/SingleFieldBuilder.java:192:0: error: class 'com.google.protobuf.GeneratedMessage' has no method named 'getDefaultInstanceForType' matching signature '()Lcom/google/protobuf/Message;' The code is some morass of generics so it's hard for me to figure out what the issue is here. The relevant code is: public class SingleFieldBuilder implements GeneratedMessage.BuilderParent { .... private MType message; public SingleFieldBuilder mergeFrom( MType value) { if (builder == null && message == message.getDefaultInstanceForType()) { message = value; } else { getBuilder().mergeFrom(value); } onChanged(); return this; } } Sure enough the GeneratedMessage class doesn't have getDefaultInstanceForType - it's implemented by subclasses. GeneratedMessage says this at the top: /** * All generated protocol message classes extend this class. This class * implements most of the Message and Builder interfaces using Java reflection. * Users can ignore this class and pretend that generated messages implement * the Message interface directly. * * @author kenton@google.com Kenton Varda */ I suspect the reference to "implementing most of the interfaces using reflection" is key. I don't know what that means exactly, the class is very large and complicated: http://code.google.com/p/protobuf/source/browse/trunk/java/src/main/java/com/google/protobuf/GeneratedMessage.java I switched to the "lite" runtime which is simpler and the issue went away. The next problem is more stubs in classpath: specifically the elliptic curve related classes in java.security.spec. I'm already using BouncyCastle to implement the EC crypto - these classes are literally just data structures. They're probably quite trivial to do. I'll try copying the equivalent code from openjdk and see if that works.