[kaffe] Using JAVAC_FLAGS for compilation

Mark Wielaard mark at klomp.org
Fri Jan 17 06:09:01 PST 2003


Hi,

On Sat, 2003-01-11 at 21:25, Dalibor Topic wrote:
> In theory, you could also compile kaffe's class
> library with gcj now, by passing it JAVAC_FLAGS="-C"
> to compile to bytecodes. Unfortunately, all gcj
> version I tried before, up to 3.2, are not able to
> compile the class library. 
> 
> Maybe Mark Wielaard could supply some information on
> how the latest gcj from CVS fares on kaffe's sources.

No it doesn't. It fails as follows:
./java/lang/ClassNotFoundException.java:52: error: Class `java.lang.ClassNotFoundException' already defined in java/lang/ClassNotFoundException.java:52.
   public class ClassNotFoundException extends Exception
                ^
./java/lang/ClassNotFoundException.java:72: internal compiler error: tree check: expected class 'd', have 'x' (error_mark) in enter_block, at java/parse.y:12403

The problem is that gcj gets confused about the "./" at the front. One
of these files is loaded from the CLASSPATH the other is given on the
command line. You can partly work around this by explicitly giving an
classpath that only points to the javalib/lib dir. But then you get:

java/lang/Object.java: In class `java.lang.Object':
java/lang/Object.java: In constructor `()':
java/lang/Object.java:20: internal compiler error: Segmentation fault

gcj is known to not like foreign java.lang.Object classes.
And this is now bug java/9351.

But if you just take the java/lang/Object.java supplied with libgcj then
it does compile most of the classes. You have to make a few changes
though. java/lang/Thread should call Object wait() not wait0().
java/awt/Color.java has some non-ASCII characters (patch attached).

Then you get some more issues with java.util.prefs but then I gave up.
Unless some people really need to compile Klasses.jar with gcj -C I put
off debugging this until after gcc 3.3 is released since I think the
issues are a bit to complex to try to fix before 3.3

Cheers,

Mark
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Color.diff
Type: text/x-patch
Size: 935 bytes
Desc: not available
Url : http://kaffe.org/pipermail/kaffe/attachments/20030117/1c94a37a/attachment-0003.bin 


More information about the kaffe mailing list