NetBSD-Java archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: lang/sun-jdk15 on amd64



[[ re-posted with the correct MIME body type for the attachment
   -- sorry! ]]

> >> No idea, sorry. I always use the native build, because if I
> >> run into problems, they can be fixed by the Java porting
> >> team. The linux package is not open to such fixes.
> >
> > How do you manage to build native jdk? It depends on linux
> > emulated jdk package (which core dumps for me).
>
> Hum. You ran into the bootstrap problem. Blech, I remember that one  
> from way back when I hacked at the DEC Alpha port a little.  
> Technically, building the JDK depends on any working JVM, not the  
> linux one per se.
>
> There are two paths for you to take; find a working JVM for your box  
> and edit the port dependency so that it uses that JVM, or do the  
> bootstrap on another machine.

Actually, only a few java commands are needed to be run by
another java instance during the build.  The attached documents
how I went about getting a native jdk15 running for amd64.

It can be done, but it's a little quirky to set up.

Regards,

- Håvard
--- Begin Message ---
> 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).

Attachment: boot-java.tar.gz
Description: Binary data

#!/usr/bin/env bash

set -x

export MAKE_VERBOSE=t

unset LANG
unset JAVA_HOME
unset CLASSPATH
unset LD_LIBRARY_PATH
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 SKIP_COMPARE_IMAGES=YES
export DONT_ENABLE_IPV6=YES
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

--- End Message ---


Home | Main Index | Thread Index | Old Index