[kaffe] Cross compilation on MacOS X - need a little help

Dr. H. Nikolaus Schaller hns at computer.org
Thu May 20 12:30:06 PDT 2004


Dear all,

I am trying to cross-compilie kaffe-1.1.4 for the arm-linux  
architecture (Sharp Zaurus) and it works astonishingly well and  
straightforward (great work!) - besides some final issues.

Here the host system:
Host:
* Apple Powerbook G4 with MacOS X 10.3.3
* gcc-2.95.3 cross compiler for arm-linux

Here the issues that I could not solve (yet):
1. there is a warning about libreplace.a

/bin/sh ../libtool --mode=link gcc  -g -O2 -Wall -Wstrict-prototypes  
-fsigned-char   -o libreplace.la   dummyin6.lo getaddrinfo.lo  
getifaddrs.lo inet_pton.lo inet_ntop.lo memset.lo
ar cru .libs/libreplace.a .libs/dummyin6.o .libs/getaddrinfo.o  
.libs/getifaddrs.o .libs/inet_pton.o .libs/inet_ntop.o .libs/memset.o
ranlib .libs/libreplace.a
ranlib: warning for library: .libs/libreplace.a the table of contents  
is empty (no object file members in the library define global symbols)
creating libreplace.la
(cd .libs && rm -f libreplace.la && ln -s ../libreplace.la  
libreplace.la)

2. while creating kaffe-native, I get the following error sequence:

*** snip ***
Making all in man
Making all in libraries/javalib
cp  
/Volumes/Data/hns/Documents/JAVA/kaffe-1.1.4/libraries/javalib/rt- 
precompiled.jar rt.jar
Making all in test
Making all in regression
Making all in compile_time
java.lang.ClassFormatError: truncated class
    at java.lang.ClassLoader.defineClass0 (ClassLoader.java)
    at java.lang.ClassLoader.defineClass (ClassLoader.java:179)
    at java.security.SecureClassLoader.defineClass  
(SecureClassLoader.java:32)
    at kaffe.lang.AppClassLoader$JarSource.findClass  
(AppClassLoader.java:143)
    at kaffe.lang.AppClassLoader.findClass (AppClassLoader.java:291)
    at java.lang.ClassLoader.loadClass (ClassLoader.java:142)
java.lang.ClassFormatError: truncated class
    at java.lang.ClassLoader.defineClass0 (ClassLoader.java)
    at java.lang.ClassLoader.defineClass (ClassLoader.java:179)
    at java.security.SecureClassLoader.defineClass  
(SecureClassLoader.java:32)
    at kaffe.lang.AppClassLoader$JarSource.findClass  
(AppClassLoader.java:143)
    at kaffe.lang.AppClassLoader.findClass (AppClassLoader.java:291)
    at java.lang.ClassLoader.loadClass (ClassLoader.java:142)
*** snip ***

This continues several times for other make directories.

Otherwise, the native and the cross-compilation runs without further  
errors.

When I try to execute any .jar file, I get the same error messages.

3. I was not able to properly configure the make install of the  
cross-compiled kaffe so that it does not get installed on the host's  
/usr/local

Using --prefix=.... makes it being installed in the working directory  
but also the scripts java, kaffe, etc. have hard-coded the host path -  
which is intended to be different on the target machine.

I.e. I want to create the cross compiled kaffe at  
$HOME/JAVA/kaffe-arm-linux/usr/local/bin/kaffe on the host but in a way  
that it can be copied to /usr/local/bin/kaffe on the target machine.

Any help is greatly appreciated.

Nikolaus Schaller

+------------------+
! hns at computer.org !
!       make       !
!     software     !
+------------------+





More information about the kaffe mailing list