From owner-freebsd-java@FreeBSD.ORG Sat Jun 8 03:04:50 2013 Return-Path: Delivered-To: java@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F3CE0711; Sat, 8 Jun 2013 03:04:49 +0000 (UTC) (envelope-from xzpeter@gmail.com) Received: from mail-pa0-x22c.google.com (mail-pa0-x22c.google.com [IPv6:2607:f8b0:400e:c03::22c]) by mx1.freebsd.org (Postfix) with ESMTP id CEA532000; Sat, 8 Jun 2013 03:04:49 +0000 (UTC) Received: by mail-pa0-f44.google.com with SMTP id wp1so2999854pac.31 for ; Fri, 07 Jun 2013 20:04:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=xVuD+YI+OwgnNx3TmyqDjD9BbWtVjVDUJCqev6ifMyg=; b=NsDuLt9evoSAFz9HwDhxgON8Amf0dLqwnviVGVXlDdFHteejPjCO5d+f76AaeuJT43 RLxvMVQ2HyIoHNNYxzN9f/6BT8L9Oh9Mo0GpTLk4vNE0laOkAvbbTU7Oktv6UU/U/d4t eciM6jqKdIFmBTY+YUGOUPzEkER50TQWJ3NOiqftf31jQclfqLxEYwmlKJW7ZsoeSME/ hq30GVK27D0EQeZAGvA+t/Jgm3EblapTxHhls9OSFq4j7/uX222FLsQa/CoS0DPIZxs4 qjlI63pnBae6CaYpbX4/EvQiExIxO34qdVT8piukMp7qg1ibIoHzs4But8aHip32k8Z5 5bdg== MIME-Version: 1.0 X-Received: by 10.68.160.226 with SMTP id xn2mr1286365pbb.174.1370660688486; Fri, 07 Jun 2013 20:04:48 -0700 (PDT) Received: by 10.70.87.230 with HTTP; Fri, 7 Jun 2013 20:04:48 -0700 (PDT) In-Reply-To: <51ADA907.1020801@gmail.com> References: <51ADA907.1020801@gmail.com> Date: Sat, 8 Jun 2013 11:04:48 +0800 Message-ID: Subject: Re: How to build openjdk7 for customized FreeBSD system From: Peter Xu To: java@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: ports@freebsd.org X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Jun 2013 03:04:50 -0000 I did this in a stupid way. I am sending this out in case someone met the same problem (or to say, you want to build openjdk on an platform that have no older version of JDK supported). The main idea is, firstly find a generic FreeBSD 8.2 system, build the openjdk7 package (well, there is no problem on generic system, as long as you are using the port collections corresponding to that specific version I suppose). Then, we can leverage all the Java-built output (includes *.class, *.jar, and some *.java/*.[ch] if they are auto-generated by the build system using JVM) in the generic systems, replacing all the $(JAVAC_CMD) and $(JAVAH_CMD) lines in Makefiles with something like (or we can try direct copy of the object files, but sometimes we still need to do this since the dependencies of 'make' are not the JAR files sometimes): scp $GENERIC_BSD:$JAR_FILE_PATH $PRIVATE_BSD:$JAR_FILE_PATH Or to say, we do fetch the good 'jar' from the generic systems instead of invoking a sick JVM and build it until we met error and stop the make process. I suppose all these things need some knowledge on the Makefile structure of openjdk. This is nasty work, but it did work for us. Another solution I thought about is cross-compile the whole JDK on a generic system, and copy all the private C libraries on the private system to the generic one before-hand (this may only be working when the generic system has cross-toolchain I suppose, or in my case that the two systems are using the same CPU arch). Just an idea, no need to try currently. Hope it helps. Thanks. Peter On Tue, Jun 4, 2013 at 4:44 PM, Xu Zhe wrote: > Hi, all, > > I have posted several mails in the list, asking for different kinds of > build errors when I met during the process of building openjdk7 on a > customized FreeBSD 8.2 system. > > Today I found the root cause of all the problems. That is, the system > needs one initial bootstrap Java SDK to build the openjdk7, but the > tragedy is that, *all* the bootstrap JDKs are binaries. These binaries > could run on our system, but will met strange issue since the system is > heavily hacked in the kernel and libc part, and it's never generic at all. > > So here is the problem... I will never have a working Java environment > as the bootstrap JDK on the hacked system. I need another generic system > to help, who has a good working JDK. > > So please ignore all the strange errors I posted. Now I want to ask a > more generic question, which I suppose is the only way to finish my > porting work: > > How should I build all the C codes in openjdk7 on my hacked system, > while build the rest Java codes on another system? > > Thanks in advance! > > Peter >