KJC and GNU Classpath
Hi, At DMS we tried to compile GNU Classpath with KJC (http://www.dms.at/kjc) and we encoutered some problems. First of all, we were not able to properly generate the makefiles from the CVS repository. Here is what we did on an intel station with RH6.1: vgp% cvs co classpath vgp% cd classpath vgp% aclocal vgp% autoheader configure.in:41: warning: AC_TRY_RUN called without default to allow cross compiling vgp% automake vgp% autoconf configure.in:41: warning: AC_TRY_RUN called without default to allow cross compiling vgp% ./configure --with-jikes --with-javah=/usr/local/packages/jdk118/bin/javah --with-classlib=/usr/local/packages/jdk118/lib/classes.zip --with-japhar=/tmp/japhar-0.08 vgp% make Making all in lib make[1]: Entering directory `/tmp/classpath/lib' /bin/sh -c "/usr/bin/jikes -nowarn -classpath ..:../vm/reference:.:/usr/local/packages/jdk118/lib/classes.zip +CSO +M +F -d . @classes" make[1]: *** [compile-classes] Segmentation fault make[1]: Leaving directory `/tmp/classpath/lib' make: *** [all-recursive] Error 1 vgp% jikes -version ... Version 1.06 (17 Sep 99) by Philippe Charles and David Shields, IBM Research. we tried by hand but we encoutered the following problems: command: cd classpath/lib; java -mx12800 at.dms.kjc.Main --verbose --nowrite @classes Introspector: = ../java/beans/Introspector.java:23: Package gnu.java.beans not found in import. import gnu.java.beans.*; ComponentBeanInfo: == ../gnu/java/beans/info/ComponentBeanInfo.java:23: Package gnu.java.beans not found in import. import gnu.java.beans.*; AWTEvent: = ../java/awt/AWTEvent.java is missing from lib/classes ObjectInputStream: == problem with an expression (java/io/ObjectInputStream.java:1188: Variable "value" cannot be initialized by a value of type "int" [JLS 4.5.4]) Which compiler do you use ??? please rewrite: char value = default_initialize ? 0 : this.realInputStream.readChar (); as: char value = default_initialize ? (char)0 : this.realInputStream.readChar (); see also: java/io/ObjectInputStream.java:1223: Variable "value" cannot be initialized by a value of type "int" [JLS 4.5.4] WeakHashMap: java/util/WeakHashMap.java:336: Cannot access field "queue" it is in an other package and not a class member [JLS 15.10] And we also have the following problem that is a bug in KJC: java/util/AbstractList.java:410: Invalid outer class for this operation [JLS 15.7.2] we will try to fix it today. Could you fix these problems and send us an email ([EMAIL PROTECTED]) when it's available on your CVS ? Vincent for DMS http://www.dms.at
Re: KJC and GNU Classpath
Vincent GAY-PARA [EMAIL PROTECTED] writes: Hi, At DMS we tried to compile GNU Classpath with KJC (http://www.dms.at/kjc) and we encoutered some problems. First of all, we were not able to properly generate the makefiles from the CVS repository. Here is what we did on an intel station with RH6.1: vgp% cvs co classpath vgp% cd classpath vgp% aclocal vgp% autoheader configure.in:41: warning: AC_TRY_RUN called without default to allow cross compiling vgp% automake vgp% autoconf configure.in:41: warning: AC_TRY_RUN called without default to allow cross compiling vgp% ./configure --with-jikes --with-javah=/usr/local/packages/jdk118/bin/javah --with-classlib=/usr/local/packages/jdk118/lib/classes.zip --with-japhar=/tmp/japhar-0.08 Okay, first of all you don't want to use the --with-jikes if you are intent upon trying to compile with kjc, however I don't think our compilation method supports java/kjc equivalents from CVS at the moment. Essentially what has to be done is to use lib/makefile.dep (generated via jikes and perl) and some combination of classes.dep and java.dep to create the appropriate Makefile syntax. I've been waiting to do this for a while since jikes 1.11 should have the needed code but has not been released. I believe that Jikes 1.06 which you have will not work because it segfaults as you notice. Jikes 1.09 and 1.10 should not segfault in the way we use it. See http://www10.software.ibm.com/developerworks/opensource/jikes/index.html. vgp% make Making all in lib make[1]: Entering directory `/tmp/classpath/lib' /bin/sh -c "/usr/bin/jikes -nowarn -classpath ..:../vm/reference:.:/usr/local/packages/jdk118/lib/classes.zip +CSO +M +F -d . @classes" make[1]: *** [compile-classes] Segmentation fault make[1]: Leaving directory `/tmp/classpath/lib' make: *** [all-recursive] Error 1 vgp% jikes -version ... Version 1.06 (17 Sep 99) by Philippe Charles and David Shields, IBM Research. we tried by hand but we encoutered the following problems: command: cd classpath/lib; java -mx12800 at.dms.kjc.Main --verbose --nowrite @classes According to the documentation I think you'd want to do something like the above but changed to cd classpath/lib; java -mx12800 at.dms.kjc.Main --verbose --nowrite `cat classes`, since I did not see the "@classes" syntax documented on your web page, but if it works that's great. Introspector: = ../java/beans/Introspector.java:23: Package gnu.java.beans not found in import. import gnu.java.beans.*; ComponentBeanInfo: == ../gnu/java/beans/info/ComponentBeanInfo.java:23: Package gnu.java.beans not found in import. import gnu.java.beans.*; This package exists in classpath/gnu/java/beans/ so something is probably wrong with how you're trying to compile. AWTEvent: = ../java/awt/AWTEvent.java is missing from lib/classes It appears that AWTEvent is not part of the compile, see classpath/lib/standard.omit. ObjectInputStream: == problem with an expression (java/io/ObjectInputStream.java:1188: Variable "value" cannot be initialized by a value of type "int" [JLS 4.5.4]) Which compiler do you use ??? please rewrite: char value = default_initialize ? 0 : this.realInputStream.readChar (); as: char value = default_initialize ? (char)0 : this.realInputStream.readChar (); see also: java/io/ObjectInputStream.java:1223: Variable "value" cannot be initialized by a value of type "int" [JLS 4.5.4] Okay, I made these changes in CVS. WeakHashMap: java/util/WeakHashMap.java:336: Cannot access field "queue" it is in an other package and not a class member [JLS 15.10] This is a problem with how WeakBucket is setup I believe. It doesn't make much sense to me why we would call the super constructor with a package private data member that isn't even initialized in java/lang/ref/Reference.java except in this same constructor. There is also the problem mentioned above of queue being in another package. I think Jochen Hoenicke should look at this. And we also have the following problem that is a bug in KJC: java/util/AbstractList.java:410: Invalid outer class for this operation [JLS 15.7.2] we will try to fix it today. Could you fix these problems and send us an email ([EMAIL PROTECTED]) when it's available on your CVS ? lyta:~$ cvs -d :pserver:[EMAIL PROTECTED]:/cvs/public co kjc-suite cvs server: cannot find module `kjc-suite' - ignored Could you fix this problem and let the classpath list know when you have ([EMAIL PROTECTED])? I'd also like to know when you fix the AbstractList problem above. Brian -- Brian Jones [EMAIL PROTECTED]
Re: KJC and GNU Classpath
Hi, On Tue, Dec 28, 1999 at 05:35:44PM +0100, Vincent GAY-PARA wrote: First of all, we were not able to properly generate the makefiles from the CVS repository. [...] we tried by hand but we encoutered the following problems: command: cd classpath/lib; java -mx12800 at.dms.kjc.Main --verbose --nowrite @classes I am a bit intimidated by the Makefiles so what I do is something like: jikes -classpath .:vm/reference `find java gnu/java vm/reference -name "*.java"` or with kaffe and kjc: kaffe -classpath ~/jars/kjc-1.4B-plus.jar:/usr/local/share/kaffe/Klasses.jar at.dms.kjc.Main -classpath .:vm/reference `find java gnu/java vm/reference -name "*.java"` (Look no non-free software used :) But then you need: - The following file from libgcj (attached): - java/text/DecimalFormat.java - Stubs for the following classes (all attached): - java.applet.Applet - java.awt.font.TextHitInfo - java.awt.ActiveEvent - java.awt.Event (adapted from libgcj) - java.util.jar.Attributes/JarEntry/JarFile/Manifest (I have an almost completed implemented of java.util.jar, but then you also need to get java.util.zip from libgcj) - Bug fixes for the following files (diffs attached) - gnu/java/awt/peer/gtk/Test.java - gnu/java/awt/peer/gtk/TestAWT.java - java/lang/Double.java - java/lang/Float.java - java/net/JarURLConnection.java - java/text/ChoiceFormat.java - java/text/DecimalFormatSymbols.java - java/text/NumberFormat.java Have fun, Mark DecimalFormat.java.gz stubs.tar.gz diffs.gz
Re: BUG: Missing NumberFormat.format() (using DecimalFormat from libgcj)
Mark Wielaard ([EMAIL PROTECTED]) wrote: java.text.NumberFromat is missing a public final format(Object obj, StringBuffer sb, FieldPosition pos) method. (Since it is not very clearly documented I just made a choice to format Doubles/Floats as doubles and all other Numbers as longs. See the javadoc.) NumberFormat.diff attached. Did these patches get applied? This is part of where I think we might want to look at using the gjc implementation, because mine only got to the point where it would compile. -- Aaron M. Renn ([EMAIL PROTECTED]) http://www.urbanophile.com/arenn/
JNI vs. CNI (was Re: Announcement: libgcj and GNU Classpath merge
Jochen Hoenicke ([EMAIL PROTECTED]) wrote: I have invented an ad hoc abstract language and have transformed the natInflate.cc from libgcj (java.util.zip.Inflate). I have used the prefix JCL_ for the pseudo methods. I haven't implemented everything, yet, only what I needed for Inflater. See: Did anyone else take a look at this? Personally, I don't like this approach. But the alternatives aren't great. Here's what we've got: 1. Metalanguage/macro approach. See Jochen's code at: http://www.Informatik.Uni-Oldenburg.DE/~delwi/classpath/JCL/Inflater.jcl 2. #ifdef's 3. Separate implementations of JNI and CNI. 4. Write a JNI - CNI adapter layer 5. Make gjc support JNI and stick with that approach. Personally, I prefer option 5 for the core library stuff. If performance proved to be an issue for some reason, we could look at other options, such as #ifdef-ing down to CNI at isolated spots as needed. It looks like there are a few people out there who want to use Classpath, and porting to various JVM's is going to require some sort of massive #ifdef/alternate implementation approach for some parts of the library. It could get ugly. -- Aaron M. Renn ([EMAIL PROTECTED]) http://www.urbanophile.com/arenn/
Re: BUG: Missing NumberFormat.format() (using DecimalFormat from libgcj)
Hi, On Tue, Dec 28, 1999 at 05:00:37PM -0600, Aaron M. Renn wrote: Mark Wielaard ([EMAIL PROTECTED]) wrote: java.text.NumberFromat is missing a public final [...] Did these patches get applied? This is part of where I think we might want to look at using the gjc implementation, because mine only got to the point where it would compile. No they didn't get applied. But I would like them to be applied because then I can more easily compile all java files from Classpath just using Free Software (see my previous mail to kopi). It might be a good idea to look at integrating with the libgcj classes (although they don't provide any Javadoc) because my patches were also only made to get it to compile. Thanks, Mark
Re: Coding style etc
Bryce McKinlay ([EMAIL PROTECTED]) wrote: gcj cannot yet compile classpath from source code, because it cannot handle inner or anonymous classes. Work on these and other "JDK-1.1" features is in progress. In the mean time, gcj should be able to compile most of classpath with the aid of an intermediate bytecode compiler (ie Jikes). This is interesting. When does gjc plan to support inner classes? These are absolutely needed to implement parts of the API. 1. We need to change classpath code that use anonymous classes (eg some of the Collections Iterators) in order to integrate it with gcj. 2. We need to wait until gcj supports the required 1.1 features at the source level. 3. We need to modify the libgcj build process to use an intermediate bytecode compiler. Probibly 3 is the most attractive option, at least as an interim solution. I agree. It might be nice to be able to specify a compiler to use when building the Java parts of gjc anyway. BTW - Will I need to sign another copyright assignment form in order to contribute to classpath? I have already done an FSF one for gcc stuff, and a Cygnus one for libgcj. Paul Fisher ([EMAIL PROTECTED]) is the one to contact about this. -- Aaron M. Renn ([EMAIL PROTECTED]) http://www.urbanophile.com/arenn/
Re: Announcement: libgcj and GNU Classpath merge
Tom Tromey ([EMAIL PROTECTED]) wrote: libgcj is very portable (though perhaps not widely ported). It can run on systems without a filesystem, for instance. I can't speak for Classpath, but I can say that libgcj's goal is and will continue to be portability to a wide variety of systems (including Windows, should someone do the port). Portability is one of our goals, hence we write as much in Java as possible. -- Aaron M. Renn ([EMAIL PROTECTED]) http://www.urbanophile.com/arenn/
Re: Announcement: libgcj and GNU Classpath merge
Bernd Kreimeier ([EMAIL PROTECTED]) wrote: One of the implications of Java for free software is that it could eventually make large inroads into Win32/other non-UNIX. Vice versa, Java applications might minimize the migration pains for GUI intensive apps, from non-UNIX to Linux. Is GNU/Linux the limit of what Classpath is aiming at? Certainly not. GNU/Linux is simply the limit of what most of the developers have installed at home. I was to support at least all Unix flavors, plus Win, plus anything else anyone wants to help port it to. (Which since it is mostly Java shouldn't be too big a deal, except for perhaps some Win AWT peers). But of course you must run before you can walk, which is why we are first focusing on Japhar+GNU/Linux. -- Aaron M. Renn ([EMAIL PROTECTED]) http://www.urbanophile.com/arenn/
Re: Coding style etc
Aaron wrote: This is interesting. When does gjc plan to support inner classes? These are absolutely needed to implement parts of the API. The work is going on right now. It won't be too much longer. AG -- Anthony Green Cygnus Solutions Sunnyvale, California
Re: I need your help!
Mark Wielaard ([EMAIL PROTECTED]) wrote: I just looked at the 1.1.8 classlist URL:http://java.sun.com/products/jdk/1.1/docs/relnotes/classlist.html And the only classes missing from the current Classpath CVS seem to be: java.applet.* I finally got around to checking this package in! -- Aaron M. Renn ([EMAIL PROTECTED]) http://www.urbanophile.com/arenn/
Re: I need your help!
Bryce McKinlay ([EMAIL PROTECTED]) wrote: java.awt.image.ColorModel java.awt.image.DirectColorModel java.text.DecimalFormat Hmm, libgcj has a good DecimalFormat implementation... That's why I didn't write it! I finall got to the end of java.text and basically said it was ridiculous for me to be re-writing what Cygnus already did and released under a suitable license. Too bad I had decided this so late. -- Aaron M. Renn ([EMAIL PROTECTED]) http://www.urbanophile.com/arenn/
[Patch] kaffe-config.in
I would have attempted to create a real patch here but I couldn't access the readonly cvs at cvs.kaffe.org because the name wasn't resolving for me. I've attached a text file which is just a simple script to be created by autoconf at configure time and included in the scripts to be installed in bindir. It is useful for determining how Kaffe was compiled and where libraries and headers are located. Place the file in kaffe/scripts/ and call it kaffe-config.in. Add the file to Makefile.am in the same directory and to configure.in to have kaffe-config generated. I've tested this with kaffe-1.0.5. Thanks, Brian -- Brian Jones [EMAIL PROTECTED] #!/bin/sh # # Similar to japhar-config. Makes integration easier. # PACKAGE="@PACKAGE@" scriptname="@PACKAGE@-config" prefix="@prefix@" exec_prefix="@exec_prefix@" includedir="@includedir@" mandir="@mandir@" infodir="@infodir@" libdir="@libdir@" localstatedir="@localstatedir@" sysconfdir="@sysconfdir@" datadir="@datadir@" libexecdir="@libexecdir@" sbindir="@sbindir@" bindir="@bindir@" #${prefix} #exec_prefix_set=no srcdir="@srcdir@" top_srcdir="@top_srcdir@" pkgincludedir="${includedir}/@PACKAGE@" pkgdatadir="${datadir}/@PACKAGE@" pkglibdir="${libdir}/@PACKAGE@" kaffe_cflags="-I${includedir} -I${pkgincludedir}" LIBS="@M_LIBS@" LINK_LIBS="-L${libdir} -L${pkglibdir}" AWT_LIBS="@AWT_LIBS@" KAFFE_LIBS="@KAFFE_LIBS@" MATH_LIBS="@MATH_LIBS@" NET_LIBS="@NET_LIBS@" SECURITY_LIBS="@SECURITY_LIBS@" VM_LIBS="@VM_LIBS@" ZIP_LIBS="@ZIP_LIBS@" # need LINK_LIBS to be the combination of several variables for i in $KAFFE_LIBS $MATH_LIBS $NET_LIBS $SECURITY_LIBS $VM_LIBS $ZIP_LIBS ; do add_to_lib=1 for j in ${LINK_LIBS}; do if test $i = $j || test $i = "-L${libdir}" || test $i = "-L${pkglibdir}" ; then add_to_lib=0 fi done if test $add_to_lib -eq 1; then LINK_LIBS="${LINK_LIBS} $i" fi done usage="\ Usage: \n\ $scriptname --version - show installed script and Kaffe version\n\ $scriptname --help- show usage info (this message) \n\ $scriptname --help SUBCOMMAND - show help for SUBCOMMAND\n\ $scriptname link - print libraries to link with\n\ $scriptname compile - print C compiler flags to compile with \n\ $scriptname info [VAR]- print Kaffe build directories \n\ \n\ Compatibility options to mimic other *-config programs\n\ $scriptname --prefix\n\ $scriptname --exec-prefix\n\ $scriptname --libs\n\ $scriptname --cflags\n" if test $# -eq 0; then echo -e "${usage}" 12 exit 1 fi if test $# -gt 0; then case $1 in --version) echo @VERSION@ ;; --help) if test $# -eq 1; then echo -e "${usage}" 12 elif test $# -eq 2; then case $2 in link|--libs) echo "Usage: $0 link" echo " Print linker flags for building the \`$PACKAGE' executable." echo " Print the linker command-line flags necessary to link against" echo " the Kaffe JNI library, and any other libraries it requires." ;; compile|--cflags) echo "Usage: $0 compile" echo " Print C compiler flags for compiling code that uses Kaffe JNI." echo " This includes any \`-I' flags needed to find Kaffe's header files." ;; info) echo "Usage: $0 info [VAR]" echo " Display the value of the Makefile variable VAR used when Kaffe" echo " was built. If VAR is omitted, display all Makefile variables." echo " Use this command to find out where Kaffe was installed," echo " where it installed its class library, etc." ;; esac else echo -e "${usage}" 12 fi exit 1 ;; link|--libs) echo "${LINK_LIBS} ${LIBS}" ;; compile|--cflags) unique_cflags="-I${includedir}" for i in $kaffe_cflags; do cflags_add="yes" for j in $unique_cflags; do if test $i == $j; then cflags_add="no" fi done if test "$cflags_add" == "yes"; then unique_cflags="${unique_cflags} $i" fi done echo ${unique_cflags} ;; info) if test $# -eq 1; then echo "LIBS = ${LIBS}" #echo "pkgincludedir = ${pkgincludedir}" #echo "pkglibdir = ${pkglibdir}" echo "includedir = ${includedir}" echo "mandir = ${mandir}" echo "infodir = ${infodir}" echo "libdir = ${libdir}" echo "localstatedir = ${localstatedir}" echo "sysconfdir = ${sysconfdir}" echo "datadir = ${datadir}" echo "libexecdir = ${libexecdir}" echo "sbindir = ${sbindir}" echo "bindir = ${bindir}" echo "prefix = ${prefix}" echo "exec_prefix = ${exec_prefix}" #echo "srcdir = ${srcdir}" #echo "top_srcdir = ${top_srcdir}"