Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Mar 2000 17:42:27 -0700 (MST)
From:      Nate Williams <nate@yogotech.com>
To:        Greg Lewis <glewis@trc.adelaide.edu.au>
Cc:        freebsd-java@FreeBSD.ORG
Subject:   Re: Pre-alpha JDK 1.2.2 patches -- issues
Message-ID:  <200003220042.RAA01855@nomad.yogotech.com>
In-Reply-To: <200003212338.KAA04014@ares.maths.adelaide.edu.au>
References:  <200003212338.KAA04014@ares.maths.adelaide.edu.au>

next in thread | previous in thread | raw e-mail | index | archive | help

> 2.  FreeBSD 2.2.8 support.
>     For technical reasons (the ports version of gcc 2.95.x doesn't assign a
>     number to __FreeBSD__, it just defines it) much of the support for 2.2.8
>     was taken out (yes, I was impatient at the time) getting to this point.
>     I am looking to put it back in at the moment in a commented out form
>     (and lodge a PR about the gcc 2.95.x ports).  However, I have no access
>     to a 2.2.8 system, so things won't get any further than this commented
>     out status at the moment.

The problem with 2.2.8 is that the compiler can't handle the stock Java
sources.  Not sure if this is a problem that's worth spending alot of
time on (although my main development box is still running 2.2.8, so
we'll see.)

>     If you're interested in helping out here you'll obviously need a 2.2.8
>     system.  I don't know the state of Linux emulation on 2.2.8 but I'm
>     guessing that it won't run the Linux JDK, so you'll need another JDK
>     to bootstrap the compilation.  I believe that the minimal JDK 1.2 
>     available on Keith White's web pages 
>     <http://www.site.uottawa.ca/~kwhite/java2/>; is an a.out version and 
>     could be used to bootstrap things.

Or, you can use the JDK1.1 stuff to bootstrap it as well, although
that's a bit more difficult.

> 3.  Alpha support.
>     I have no access to an machine running the FreeBSD alpha port.  If someone
>     wants to test things out on one that would be great, as I'd love to get
>     alpha support working.  I suspect that things won't work unfortunately,
>     but I could be way wrong about that :).

The Blackdown work should help here.  If not JDK1.2, then the 1.3 work
might be a better place to start for the Alpha team.

> 4.  Assembler version of executeJava
>     As the comments say, "This is the very heart of the interpreter.  This
>     can be re-written in assembly language for speed on a specific platform,
>     ..." (src/share/javavm/runtime/executeJava.c).  And indeed, there is a
>     an assembly version for the x86.  Unfortunately, it causes seg faults
>     when its used so currently the C version is being used.

Keith got this work late in the game, and the patches to make it work
are now part of the JDK1.1 patchset.  If my memory serves me well, it
had to do with the use of a certain Gas opcode that whacked a register
that we didn't realize.  We needed to push/pop one of a register before
calling it, but I don't remember which one.

> 5.  Sun JIT compiler.
>     It appears that the Sun JIT compiler (libsunwjit.so) is supplied as a
>     precompiled Solaris x86 binary without source code.  This leaves us
>     rather hamstrung in getting this to work.

This is where I personally gave up.  I talked with the Blackdown team at
JavaOne, and they implied that a Sun engineer gave them a binary copy of
the JIT compiled for Linux.  This is also where *most* of the speedups
the Linux JDK has over the FreeBSD JDK exist, so unless we get a JIT,
then the 1.2 stuff is going to be *slower* than the 1.1 stuff.

It seems a bit counter-productive to spend alot of time building a
native version when we can't even run the code at a decent speed after
it's all said and done, and all attempts to motivate Sun or other
vendors have met with extreme resistance.

I personally got really burned out trying to work the vendors, hence my
personal lack of involvement lately.

> 6.  Font setup.
>     The font properties set up during the JDK build 
>     (build/freebsd/lib/font.properties) are the default Solaris set up, which 
>     is possibly not what we want for FreeBSD.

You should be able to use the same files from JDK1.1 as a starting
point.

>     that we want.  There also needs to be some discussion of what the correct 
>     set up for FreeBSD is -- should we mimic Blackdown on this one?

I actually spent some time messing with the fonts, and eventually ended
up w/something that looked a lot like the Blackdown file.

Since we're both using XFree86, it should look similar...

> 7.  DPS and postscript fonts.
>     As part of the build of libfontmanager.so (see 
>     build/freebsd/sun/font/GNUmakefile) one can optionally enable linking
>     with a Display Postscript library (this is the default for the Solaris
>     build).  I can only assume that this is to enable the use of Postscript
>     fonts in Java.

Actually, this is so you can do 'Print Screen' functionality in JDK.
You need the disply postscript part of the XServer for this to work.

> 8.  Missing shared libraries.  
>     As Thomas said, when releasing his initial set of patches for JDK 1.2, 
>     "I had to leave out a couple of less important subdirectories in the 
>     $(BUILDDIR)/sun subdirectory".  Unfortunately this is still pretty much 
>     the case, although some progress has been made (the font subdirectory 
>     is back in at least, albeit currently without postscript font support).  
>     These extra shared libraries all need to be looked into.
> 
>     a. audio
>        This is presumably for Java Audio :).  Many of the files appear to
>        compile, but, not surprisingly, get stuck when trying to compile
>        the Solaris specific sound support.  These Solaris specific files 
>        need to be replaced with versions which support the FreeBSD sound
>        architecture.

Again, you might look into the JDK1.1 stuff, which had working audio.

>     b. jdga
>        I'm not sure what actually uses this, but it appears to be an 
>        interface to the the Solaris libdga, a direct graphics access library
>        for Sparc frame buffers.  While its not hard to get libsunwjdga.so
>        itself to compile, looking at the code a bit and the Solaris JDK
>        leads me to believe there needs to be another shared library which
>        actually provides some of the functional bindings.  This could
>        possibly be modified to work with the XFree86 DGA extensions.  The
>        first step is to find out what uses it though and how important it
>        is!

I don't rememeber looking at this.

>     c. cmm
>        Again, I'm not sure what uses this library, but both the Solaris and
>        Blackdown JDKs include it.  Porting this appears to involve supplying
>        some definitions appropriate for FreeBSD 
>        (look in src/share/native/sun/awt/cmm/kcmsos.h -- I have an initial
>         attempt at this if you're interested) and also providing some
>        wrapper functions for threads.  The current choices
>        (src/share/native/sun/awt/cmm/sithread.h and thread.c) are Win32 
>        threads or Solaris native threads.  The option for FreeBSD is
>        probably to introduce pthreads support, so this work mainly needs
>        someone who knows a bit about pthreads or is ready to learn :).

I don't know what this is.

>     d. jdbc
>        This is the JDBC-ODBC bridge code.  Although this is disabled in the
>        current set of patches, I've actually got a compiled version of this
>        using the unixODBC package (http://www.unixodbc.org -- there is no
>        FreeBSD port yet, but it compiles fairly easily).  Like the Postscript
>        font support though, this needs to someone to test it out and verify 
>        that its working.  If you're interested, contact me for the additional
>        patches, including a small one to get unixODBC to find the FreeBSD
>        pthreads implementation in libc_r.

Cool...

> 9.  Merging from 1.1.8 patches.
>     Thomas' initial patches came out in June of 1999, prior to the most
>     recent JDK 1.1.8 releases by the port team.  I haven't had the time to
>     stop and make sure I've merged all the appropriate patches from the
>     1.1.8 patches.  The task here is to get the patches for 1.1.8 from the
>     FreeBSD java site (http://www.freebsd.org/java) and make sure all the
>     relevant bits have made it into the current set of patches for 1.2.

I'd like to think I can help here.  If not with coding, I can sure help
to answer questions.

> 12. Rounding bug.
>     Kees Jan Koster has kindly taken the time to run the JDK through
>     the Mauve test suite (http://sourceware.cygnus.com/mauve/).  Apart
>     from voting Kees Jan many thanks for this, I was pleased to find that
>     this uncovered only two differences with the Solaris reference
>     implementation.  One of these has since been fixed, but the other
>     remains.  As Kees Jan says:
> 
>     "There seems to be a well-known rounding error in the string conversions 
>      in type double. The Mauve test suite converts the double -3.5 to a 
>      string and back and expects -4.0 to come out. In the JDK1.2 reference 
>      implementation does also return -4.0, but the current FreeBSD native 
>      port displays the correct -3.5, which is an error. %-)"

I have a pretty good idea what might be going on here.  The FPU mask is
different in FreeBSD, and might be causing the 'problem'.

>     This is more a compatibility issue for 1.2 rather than a bug (Kees Jan's
>     research indicates that 1.3 also returns -3.5) but is important 
>     nonetheless, especially for people developing on multiple platforms.
>     If you're interested in looking into this, I can pass on some simple
>     test code from Kees Jan (which I think is from Mauve) that demonstrates
>     the problem.

So, maybe it's not an error. :)

> 15. GCC versions.
>     Kees Jan is currently having problems running Swing / AWT stuff with
>     an unresolved reference to "__pure_virtual".  He is, however, using a
>     different version of gcc.

I ran into this as well.  Again, this has alot to do with the way
G++/GCC linking occurs.  I fought this one on 2.2.8 and never did get a
good resolution.  You have to make sure that *ALL* the libraries/objects
that are used are built with the same compiler

Greg, thanks for doing this.  As the most visible member of the porting
team, all I can say is sorry for not doing more.  Maybe this will
energize some new folks to jump on board here...



Nate


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-java" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200003220042.RAA01855>