From linwendeng at gmail.com  Mon Mar 15 04:42:01 2010
From: linwendeng at gmail.com (Linwen Deng)
Date: Mon, 15 Mar 2010 19:42:01 +0800
Subject: The method exit(int) is undefined for the type of System, when build 
	gcj on mips64el
Message-ID: <e786105a1003150442p9f54de5ia4c7e84b4154f76d@mail.gmail.com>

hi,

I'm trying to port OpenJDK to mips64el,but have some troubles,and didn't
know where is the source problem.
Here are my steps:

1, build gcj. The version of gcc is 4.4.1, and configure like the follows:

*../configure --prefix=/usr --build=mips64el-linux \
        --disable-nls --enable-shared --enable-__cxa_atexit \
        --disable-multilib  --with-abi=64 \
        --with-ecj-jar=/usr/share/java/ecj.jar \
        --enable-c99 --enable-long-long --enable-threads=posix \
        --enable-languages=java*

the ecj.jar is copied from my PC(x86_64), and version of 4.5.

2, compile Classpath-0.98 with gcj

*export MABI=64
../configure --prefix=/usr --build=mips64el-linux \
        --disable-plugin*

but failed when configure, the error from config.log is:

*error: The method exit(int) is undefined for the type of System
    System.exit(0);*

then I write a simple test program:

*// test.java
public class test{
 public static void main(String args[]){
  System.out.print("Hello world");
  System.exit(0);
 }
}*

and the error is the same as above.

3, then I tried "make check" in the directory of libjava. Here are the last
lines of libjava.log:
*PASS: TestParent compilation from source
set_ld_library_path_env_vars:
ld_library_path=.:/root/Download/gcc-4.4.1/build/mips64el-linux/./libjava/.libs:/root/Download/gcc-4.4.1/build/gcc
invoke:
/root/Download/gcc-4.4.1/build/mips64el-linux/libjava/testsuite/TestParent.exe

Setting LD_LIBRARY_PATH to
.:/root/Download/gcc-4.4.1/build/mips64el-linux/./libjava/.libs:/root/Download/gcc-4.4.1/build/gcc:.:/root/Download/gcc-4.4.1/build/mips64el-linux/./libjava/.libs:/root/Download/gcc-4.4.1/build/gcc:/root/Download/gcc-4.4.1/build/mips64el-linux/libstdc++-v3/.libs:/root/Download/gcc-4.4.1/build/mips64el-linux/libmudflap/.libs:/root/Download/gcc-4.4.1/build/mips64el-linux/libssp/.libs:/root/Download/gcc-4.4.1/build/mips64el-linux/libgomp/.libs:/root/Download/gcc-4.4.1/build/./gcc:/root/Download/gcc-4.4.1/build/./prev-gcc:/lib:/lib64:/usr/lib:/usr/lib64
spawn [open ...]
PASS:
/root/Download/gcc-4.4.1/build/mips64el-linux/libjava/testsuite/TestParent.exe
execution -
/root/Download/gcc-4.4.1/build/mips64el-linux/libjava/testsuite/TestParent.exe
PASS:
/root/Download/gcc-4.4.1/build/mips64el-linux/libjava/testsuite/TestParent.exe
output -
/root/Download/gcc-4.4.1/build/mips64el-linux/libjava/testsuite/TestParent.exe
testcase
/root/Download/gcc-4.4.1/libjava/testsuite/libjava.loader/loader.exp
completed in 19 seconds
Running /root/Download/gcc-4.4.1/libjava/testsuite/libjava.mauve/mauve.exp
...
testcase /root/Download/gcc-4.4.1/libjava/testsuite/libjava.mauve/mauve.exp
completed in 0 seconds
Running
/root/Download/gcc-4.4.1/libjava/testsuite/libjava.special/special.exp ...
byte compile: /root/Download/gcc-4.4.1/build/gcc/gcj
-B/root/Download/gcc-4.4.1/build/mips64el-linux/libjava/
-B/root/Download/gcc-4.4.1/build/gcc/ --encoding=UTF-8 -C
-I/root/Download/gcc-4.4.1/build/mips64el-linux/libjava/testsuite/../libgcj-4.4.1.jar
-g /root/Download/gcc-4.4.1/libjava/testsuite/libjava.special/pr21115I.java
-d /root/Download/gcc-4.4.1/build/mips64el-linux/libjava/testsuite 2>@
stdout
couldn't compile
/root/Download/gcc-4.4.1/libjava/testsuite/libjava.special/pr21115I.java:
/root/Download/gcc-4.4.1/libjava/testsuite/libjava.special/pr21115I.java:1:
error: Implicit super constructor pr21115() is undefined for default
constructor. Must define an explicit constructor
    public class pr21115I extends pr21115
                 ^^^^^^^^
/root/Download/gcc-4.4.1/libjava/testsuite/libjava.special/pr21115.java:20:
error: The method println(String) is undefined for the type PrintStream
    System.out.println ("FAILED - expecting false return value.");
               ^^^^^^^
/root/Download/gcc-4.4.1/libjava/testsuite/libjava.special/pr21115.java:6:
error: The method newInstance() is undefined for the type Class
    Object o = c.newInstance();
                 ^^^^^^^^^^^
/root/Download/gcc-4.4.1/libjava/testsuite/libjava.special/pr21115.java:5:
error: The method forName(String) is undefined for the type Class
    Class c = Class.forName("pr21115I");
                    ^^^^^^^
/root/Download/gcc-4.4.1/libjava/testsuite/libjava.special/pr21115.java:5:
warning: Class is a raw type. References to generic type Class<T> should be
parameterized
    Class c = Class.forName("pr21115I");
    ^^^^^
5 problems (4 errors, 1 warning)
child process exited abnormally
testcase
/root/Download/gcc-4.4.1/libjava/testsuite/libjava.special/special.exp
completed in 7 seconds
Running /root/Download/gcc-4.4.1/libjava/testsuite/libjava.verify/verify.exp
...
testcase
/root/Download/gcc-4.4.1/libjava/testsuite/libjava.verify/verify.exp
completed in 0 seconds

        === libjava Summary ===

# of expected passes        2574
runtest completed at Mon Mar 15 12:11:04 2010*

I wonder if my steps is correct, so I need your help. Can you give me some
tips, or tell me how debian's openjdk was built on mipsel?

Waiting for reply. Thanks!


Best Regards,

Linwen DENG
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/mips-port/attachments/20100315/5d9a96ec/attachment.html