Bootstrapping a (totally) unsupported architecture

Landon Fuller landonf at
Fri Feb 1 11:25:10 PST 2008

I thought I'd forward this along this message from a conversation  
regarding porting Java to FreeBSD/Sparc -- Havard's scripts could be  
useful to anyone else working on a port.

Begin forwarded message:

> From: Havard Eidnes <he at>
> Date: February 1, 2008 06:20:54 PST
> To: landonf at
> Cc: ltning at, freebsd-java at
> Subject: Re: Sparc64
>> What's the status of svr4 emulation on sparc64? I forgot a critical
>> piece; One needs a bootstrap JVM, and bootstrapping off of Sun's VM
>> would make things easier.
> One can use a bootstrap JVM from another host (and architecture) and
> some scripts which use ssh to the bootstrap host and sharing files via
> NFS -- that's how I bootstrapped the NetBSD/amd64 version using the
> NetBSD/i386 version.  I've attached my notes and the scripts I used to
> do this.  (Admittedly, I've since tweaked the scripts to use
> environment variables, so they've not been tested in their present
> form...)
> Best regards,
> - Håvard
> My notes for using a JVM on NetBSD/i386 to bootstrap JVM on
> NetBSD/amd64:
> I used a set of script wrappers which ssh to another machine (in my
> case running NetBSD/i386, with its native java installed) which has
> the same directory tree available via NFS as on the target (amd64)
> machine, using the exact same paths.  Substitute scripts were made for
> java, javac, javah, and jar, and the ALT_BOOTDIR was pointed to the
> directory tree containing those scripts.  Some peculiarities were
> discovered:
>  o java needs to be able to read from stdin.  This means you
>    can't use "ssh -n", which again means that the build job has
>    to run in the foreground with access to the tty (yuk...).
>  o javah gets at least once passed a class name with a $ in it.
>    This causes issues because we get a double shell
>    interpretation which leads to variable expansion; once on the
>    local machine, once on the remote.  To work around that
>    problem I borrowed the "shquote" shell function from pkgsrc
>    and tweaked the argument list using it (it's included).
>  o the jar script sleeps 10 seconds because otherwise it would
>    trip over "stale NFS file handle" problems when some files
>    were copied in place (replaced) on the NFS server just prior
>    to using "jar".
> Attached below is the set of scripts which I placed in /usr/pkg/java/
> as boot-java/, packaged up as "boot-java.tar.gz".  Set JAVA_BOOTHOST
> (your boot host) and JAVA_BOOTDIR (top of java directory tree on
> JAVA_BOOTHOST) in the environment to suit your config.  I also include
> the "build-java" shell script I used (to be executed from the top of
> the Java source tree).#!/usr/bin/env bash
> set -x
> export MAKE_VERBOSE=t
> unset LANG
> unset JAVA_HOME
> export ALT_MOTIF_DIR=/usr/pkg
> # export ALT_NSPR_PATH=/usr/pkg
> export ALT_NSPR_HEADERS_PATH=/usr/pkg/include/firefox/nspr
> export ALT_MOZILLA_HEADERS_PATH=/usr/pkg/include/firefox
> export ALT_BOOTDIR=/usr/pkg/java/boot-java
> # export ALT_BOOTDIR=/usr/pkg/java/jdk-1.5.0
> # export ALT_BOOTDIR=/usr/pkg/java/sun-1.5
> cd control/make/
> gmake

-------------- next part --------------
An HTML attachment was scrubbed...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: boot-java.tar.gz
Type: application/octet-stream
Size: 930 bytes
Desc: not available
Url : 
-------------- next part --------------
An HTML attachment was scrubbed...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : 

More information about the porters-dev mailing list