Bug 31325 - gcj support for ARM EABI
Summary: gcj support for ARM EABI
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.2.0
: P3 normal
Target Milestone: ---
Assignee: Andrew Haley
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-23 12:52 UTC by Steven Newbury
Modified: 2007-09-04 19:14 UTC (History)
9 users (show)

See Also:
Host: arm-*-linux-gnueabi
Target: arm-*-linux-gnueabi
Build: arm-*-linux-gnueabi
Known to work:
Known to fail:
Last reconfirmed: 2007-08-09 17:44:23


Attachments
libffi completion support for ARM EABI (1.93 KB, patch)
2007-03-23 12:53 UTC, Steven Newbury
Details | Diff
add softfloat support to libffi for ARM EABI (420 bytes, patch)
2007-03-23 12:55 UTC, Steven Newbury
Details | Diff
EABI can't implement _Unwind_Backtrace (818 bytes, patch)
2007-03-23 13:03 UTC, Steven Newbury
Details | Diff
enable the libgcj interpreter for arm platforms (266 bytes, patch)
2007-03-23 13:08 UTC, Steven Newbury
Details | Diff
arm-iwmmxt-linux-gnueabi platform support (3.36 KB, patch)
2007-03-23 13:22 UTC, Steven Newbury
Details | Diff
libffi EABI sys_cacheflush support (334 bytes, patch)
2007-08-03 13:52 UTC, Steven Newbury
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Steven Newbury 2007-03-23 12:52:34 UTC
Currently there is no gcj support on the ARM EABI platform.  I have gathered together a number of patches that allow it to build and will be attaching them to this bug.

I would like to see this moving forward and getting support into mainline, there are inevitably going to be issues.
Comment 1 Steven Newbury 2007-03-23 12:53:45 UTC
Created attachment 13260 [details]
libffi completion support for ARM EABI
Comment 2 Steven Newbury 2007-03-23 12:55:12 UTC
Created attachment 13261 [details]
add softfloat support to libffi for ARM EABI
Comment 3 Steven Newbury 2007-03-23 13:03:31 UTC
Created attachment 13262 [details]
EABI can't implement _Unwind_Backtrace

This patch is from this bug:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29206
Comment 4 Steven Newbury 2007-03-23 13:08:17 UTC
Created attachment 13263 [details]
enable the libgcj interpreter for arm platforms
Comment 5 Steven Newbury 2007-03-23 13:11:01 UTC
--disable-sjlj-exceptions needs to be supplied to configure since it is not automatically detected
Comment 6 Steven Newbury 2007-03-23 13:13:57 UTC
I have encountered a strange build failure with classpath.  It is somehow getting the build order wrong resulting in this error:

/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/build/gcc/gcj -B/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/build/arm-iwmmxt-linux-gnueabi/libjava/ -B/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/build/gcc/ -Wno-deprecated --encoding=UTF-8 --bootclasspath '' --classpath ..:/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava:/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/build/arm-iwmmxt-linux-gnueabi/libjava:/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/classpath:/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/classpath/external/w3c_dom:/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/classpath/external/sax:/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/classpath/external/relaxngDatatype:.:: -C -d . -MD -MF lists/gnu-CORBA-DynAn.deps -MT lists/gnu-CORBA-DynAn.stamp -MP @lists/gnu-CORBA-DynAn.list
/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/classpath/java/lang/Throwable.java:44: error: Class or interface 'java.io.Serializable' not found in import.
import java.io.Serializable;
          ^
/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/classpath/java/lang/Throwable.java:107: error: Superinterface 'Serializable' of class 'java.lang.Throwable' not found.
public class Throwable implements Serializable
                                     ^
Manually building java.io.Serializable allows the build to continue.  Why is this happening?  It doesn't happen with i686 or x86_64 with the same snapshot.
Comment 7 Steven Newbury 2007-03-23 13:22:07 UTC
Created attachment 13264 [details]
arm-iwmmxt-linux-gnueabi platform support

I'm using arm-iwmmxt-linux-gnueabi instead of arm-none-linux-gnueabi which needs this patch.
Comment 8 Steven Newbury 2007-03-23 15:20:50 UTC
I've now hit:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24154

I only have 64M RAM + 256M swap, make is running out of memory and getting killed.

Maybe I can add some more swap over NFS...?
Comment 9 Tom Tromey 2007-03-23 19:32:20 UTC
I didn't read the patches yet.

Do you have a copyright assignment?  That is a prerequisite for
getting these changes in.  Once that is resolved we can proceed
with the normal patch review process.

If you don't have one, send me email and I will get you started.
It doesn't take long, usually.

If you do have one, the best thing to do is send each patch as
a separate email (with ChangeLog entry & other stuff documented
in the submission docs) to the java-patches list.
Comment 10 Steven Newbury 2007-03-24 17:30:05 UTC
(In reply to comment #3)
> Created an attachment (id=13262) [edit]
> EABI can't implement _Unwind_Backtrace
> 
> This patch is from this bug:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29206
> 

This patch doesn't help right now.  It only affects sjlj exceptions and they obviously aren't used due to --disable-sjlj-exceptions anyhow.  Using this patch  as is causes _Unwind_Reason_Code to be undefined when sjlj exceptions are disabled.

Comment 11 Steven Newbury 2007-03-24 19:58:24 UTC
I have everything built except for libjava/exception.cc which fails as seen below.

This I believe is due to the lack of an implementation of _Unwind_Backtrace in the ARM EABI.  What needs to be done to address this?  Can anybody give me any pointers?  

In http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29206 Daniel Jackobowitz says "As for ARM, I'm not sure what to do to fix the issue.  ARM old ABI is stuck
with SJLJ.  And the EABI can't implement _Unwind_Backtrace either.  I have been
speaking with someone at ARM about the ABI implications of this, on and off,
but I don't have a lot of hope for it working out without a GNU extension."


depbase=`echo jni.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`; \
	if /bin/sh ./libtool --mode=compile /home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/build/./gcc/xgcc -shared-libgcc -B/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/build/./gcc -nostdinc++ -L/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/build/arm-iwmmxt-linux-gnueabi/libstdc++-v3/src -L/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/build/arm-iwmmxt-linux-gnueabi/libstdc++-v3/src/.libs -B/usr/lib/gcj-4.2.0_beta20070307/arm-iwmmxt-linux-gnueabi/bin/ -B/usr/lib/gcj-4.2.0_beta20070307/arm-iwmmxt-linux-gnueabi/lib/ -isystem /usr/lib/gcj-4.2.0_beta20070307/arm-iwmmxt-linux-gnueabi/include -isystem /usr/lib/gcj-4.2.0_beta20070307/arm-iwmmxt-linux-gnueabi/sys-include -DHAVE_CONFIG_H -I. -I/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava -I./include -I./gcj  -I/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava -Iinclude -I/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/include -I/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/classpath/include -Iclasspath/include -I/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/classpath/native/fdlibm -I/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/../boehm-gc/include -I../boehm-gc/include  -I/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/libltdl -I/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/libltdl -I/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/.././libjava/../gcc  -I/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/../libffi/include -I../libffi/include  -fno-rtti -fnon-call-exceptions  -fdollars-in-identifiers -Wswitch-enum -D_FILE_OFFSET_BITS=64 -Wextra -Wall -D_GNU_SOURCE -DPREFIX="\"/usr/lib/gcj-4.2.0_beta20070307\"" -DTOOLEXECLIBDIR="\"/usr/lib/gcj-4.2.0_beta20070307/lib\"" -DJAVA_HOME="\"/usr/lib/gcj-4.2.0_beta20070307/jre\"" -DBOOT_CLASS_PATH="\"/usr/lib/gcj-4.2.0_beta20070307/jre/lib/rt.jar\"" -DJAVA_EXT_DIRS="\"/usr/lib/gcj-4.2.0_beta20070307/share/java/ext\"" -DGCJ_ENDORSED_DIRS="\"/usr/lib/gcj-4.2.0_beta20070307/share/java/gcj-endorsed\"" -DGCJ_VERSIONED_LIBDIR="\"/usr/lib/gcj-4.2.0_beta20070307/lib/gcj-4.2.0-beta20070307\"" -DPATH_SEPARATOR="\":\"" -DLIBGCJ_DEFAULT_DATABASE="\"/usr/lib/gcj-4.2.0_beta20070307/lib/gcj-4.2.0-beta20070307/classmap.db\"" -DLIBGCJ_DEFAULT_DATABASE_PATH_TAIL="\"gcj-4.2.0-beta20070307/classmap.db\"" -O2 -pipe  -D_GNU_SOURCE -MT jni.lo -MD -MP -MF "$depbase.Tpo" -c -o jni.lo /home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/jni.cc; \
	then mv -f "$depbase.Tpo" "$depbase.Plo"; else rm -f "$depbase.Tpo"; exit 1; fi
/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/build/./gcc/xgcc -shared-libgcc -B/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/build/./gcc -nostdinc++ -L/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/build/arm-iwmmxt-linux-gnueabi/libstdc++-v3/src -L/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/build/arm-iwmmxt-linux-gnueabi/libstdc++-v3/src/.libs -B/usr/lib/gcj-4.2.0_beta20070307/arm-iwmmxt-linux-gnueabi/bin/ -B/usr/lib/gcj-4.2.0_beta20070307/arm-iwmmxt-linux-gnueabi/lib/ -isystem /usr/lib/gcj-4.2.0_beta20070307/arm-iwmmxt-linux-gnueabi/include -isystem /usr/lib/gcj-4.2.0_beta20070307/arm-iwmmxt-linux-gnueabi/sys-include -DHAVE_CONFIG_H -I. -I/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava -I./include -I./gcj -I/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava -Iinclude -I/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/include -I/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/classpath/include -Iclasspath/include -I/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/classpath/native/fdlibm -I/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/../boehm-gc/include -I../boehm-gc/include -I/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/libltdl -I/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/libltdl -I/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/.././libjava/../gcc -I/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/../libffi/include -I../libffi/include -fno-rtti -fnon-call-exceptions -fdollars-in-identifiers -Wswitch-enum -D_FILE_OFFSET_BITS=64 -Wextra -Wall -D_GNU_SOURCE -DPREFIX=\"/usr/lib/gcj-4.2.0_beta20070307\" -DTOOLEXECLIBDIR=\"/usr/lib/gcj-4.2.0_beta20070307/lib\" -DJAVA_HOME=\"/usr/lib/gcj-4.2.0_beta20070307/jre\" -DBOOT_CLASS_PATH=\"/usr/lib/gcj-4.2.0_beta20070307/jre/lib/rt.jar\" -DJAVA_EXT_DIRS=\"/usr/lib/gcj-4.2.0_beta20070307/share/java/ext\" -DGCJ_ENDORSED_DIRS=\"/usr/lib/gcj-4.2.0_beta20070307/share/java/gcj-endorsed\" -DGCJ_VERSIONED_LIBDIR=\"/usr/lib/gcj-4.2.0_beta20070307/lib/gcj-4.2.0-beta20070307\" -DPATH_SEPARATOR=\":\" -DLIBGCJ_DEFAULT_DATABASE=\"/usr/lib/gcj-4.2.0_beta20070307/lib/gcj-4.2.0-beta20070307/classmap.db\" -DLIBGCJ_DEFAULT_DATABASE_PATH_TAIL=\"gcj-4.2.0-beta20070307/classmap.db\" -O2 -pipe -D_GNU_SOURCE -MT jni.lo -MD -MP -MF .deps/jni.Tpo -c /home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/jni.cc  -fPIC -DPIC -o .libs/jni.o
depbase=`echo exception.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`; \
	if /bin/sh ./libtool --mode=compile /home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/build/./gcc/xgcc -shared-libgcc -B/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/build/./gcc -nostdinc++ -L/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/build/arm-iwmmxt-linux-gnueabi/libstdc++-v3/src -L/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/build/arm-iwmmxt-linux-gnueabi/libstdc++-v3/src/.libs -B/usr/lib/gcj-4.2.0_beta20070307/arm-iwmmxt-linux-gnueabi/bin/ -B/usr/lib/gcj-4.2.0_beta20070307/arm-iwmmxt-linux-gnueabi/lib/ -isystem /usr/lib/gcj-4.2.0_beta20070307/arm-iwmmxt-linux-gnueabi/include -isystem /usr/lib/gcj-4.2.0_beta20070307/arm-iwmmxt-linux-gnueabi/sys-include -DHAVE_CONFIG_H -I. -I/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava -I./include -I./gcj  -I/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava -Iinclude -I/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/include -I/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/classpath/include -Iclasspath/include -I/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/classpath/native/fdlibm -I/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/../boehm-gc/include -I../boehm-gc/include  -I/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/libltdl -I/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/libltdl -I/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/.././libjava/../gcc  -I/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/../libffi/include -I../libffi/include  -fno-rtti -fnon-call-exceptions  -fdollars-in-identifiers -Wswitch-enum -D_FILE_OFFSET_BITS=64 -Wextra -Wall -D_GNU_SOURCE -DPREFIX="\"/usr/lib/gcj-4.2.0_beta20070307\"" -DTOOLEXECLIBDIR="\"/usr/lib/gcj-4.2.0_beta20070307/lib\"" -DJAVA_HOME="\"/usr/lib/gcj-4.2.0_beta20070307/jre\"" -DBOOT_CLASS_PATH="\"/usr/lib/gcj-4.2.0_beta20070307/jre/lib/rt.jar\"" -DJAVA_EXT_DIRS="\"/usr/lib/gcj-4.2.0_beta20070307/share/java/ext\"" -DGCJ_ENDORSED_DIRS="\"/usr/lib/gcj-4.2.0_beta20070307/share/java/gcj-endorsed\"" -DGCJ_VERSIONED_LIBDIR="\"/usr/lib/gcj-4.2.0_beta20070307/lib/gcj-4.2.0-beta20070307\"" -DPATH_SEPARATOR="\":\"" -DLIBGCJ_DEFAULT_DATABASE="\"/usr/lib/gcj-4.2.0_beta20070307/lib/gcj-4.2.0-beta20070307/classmap.db\"" -DLIBGCJ_DEFAULT_DATABASE_PATH_TAIL="\"gcj-4.2.0-beta20070307/classmap.db\"" -O2 -pipe  -D_GNU_SOURCE -MT exception.lo -MD -MP -MF "$depbase.Tpo" -c -o exception.lo /home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/exception.cc; \
	then mv -f "$depbase.Tpo" "$depbase.Plo"; else rm -f "$depbase.Tpo"; exit 1; fi
/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/build/./gcc/xgcc -shared-libgcc -B/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/build/./gcc -nostdinc++ -L/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/build/arm-iwmmxt-linux-gnueabi/libstdc++-v3/src -L/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/build/arm-iwmmxt-linux-gnueabi/libstdc++-v3/src/.libs -B/usr/lib/gcj-4.2.0_beta20070307/arm-iwmmxt-linux-gnueabi/bin/ -B/usr/lib/gcj-4.2.0_beta20070307/arm-iwmmxt-linux-gnueabi/lib/ -isystem /usr/lib/gcj-4.2.0_beta20070307/arm-iwmmxt-linux-gnueabi/include -isystem /usr/lib/gcj-4.2.0_beta20070307/arm-iwmmxt-linux-gnueabi/sys-include -DHAVE_CONFIG_H -I. -I/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava -I./include -I./gcj -I/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava -Iinclude -I/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/include -I/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/classpath/include -Iclasspath/include -I/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/classpath/native/fdlibm -I/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/../boehm-gc/include -I../boehm-gc/include -I/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/libltdl -I/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/libltdl -I/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/.././libjava/../gcc -I/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/../libffi/include -I../libffi/include -fno-rtti -fnon-call-exceptions -fdollars-in-identifiers -Wswitch-enum -D_FILE_OFFSET_BITS=64 -Wextra -Wall -D_GNU_SOURCE -DPREFIX=\"/usr/lib/gcj-4.2.0_beta20070307\" -DTOOLEXECLIBDIR=\"/usr/lib/gcj-4.2.0_beta20070307/lib\" -DJAVA_HOME=\"/usr/lib/gcj-4.2.0_beta20070307/jre\" -DBOOT_CLASS_PATH=\"/usr/lib/gcj-4.2.0_beta20070307/jre/lib/rt.jar\" -DJAVA_EXT_DIRS=\"/usr/lib/gcj-4.2.0_beta20070307/share/java/ext\" -DGCJ_ENDORSED_DIRS=\"/usr/lib/gcj-4.2.0_beta20070307/share/java/gcj-endorsed\" -DGCJ_VERSIONED_LIBDIR=\"/usr/lib/gcj-4.2.0_beta20070307/lib/gcj-4.2.0-beta20070307\" -DPATH_SEPARATOR=\":\" -DLIBGCJ_DEFAULT_DATABASE=\"/usr/lib/gcj-4.2.0_beta20070307/lib/gcj-4.2.0-beta20070307/classmap.db\" -DLIBGCJ_DEFAULT_DATABASE_PATH_TAIL=\"gcj-4.2.0-beta20070307/classmap.db\" -O2 -pipe -D_GNU_SOURCE -MT exception.lo -MD -MP -MF .deps/exception.Tpo -c /home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/exception.cc  -fPIC -DPIC -o .libs/exception.o
/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/exception.cc:63: error: ISO C++ forbids casting to an array type 'char [8]'
/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/exception.cc:64: error: ISO C++ forbids casting to an array type 'char [8]'
/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/exception.cc:65: error: ISO C++ forbids casting to an array type 'char [8]'
/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/exception.cc:66: error: ISO C++ forbids casting to an array type 'char [8]'
/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/exception.cc:67: error: ISO C++ forbids casting to an array type 'char [8]'
/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/exception.cc:68: error: ISO C++ forbids casting to an array type 'char [8]'
/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/exception.cc:69: error: ISO C++ forbids casting to an array type 'char [8]'
/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/exception.cc:70: error: ISO C++ forbids casting to an array type 'char [8]'
/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/exception.cc: In function 'void _Jv_Throw(java::lang::Throwable*)':
/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/exception.cc:92: error: invalid array assignment
/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/exception.cc: In function '_Unwind_Reason_Code __gcj_personality_v0(int, _Unwind_Action, char*, _Unwind_Control_Block*, _Unwind_Context*)':
/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/exception.cc:205: error: '_URC_FATAL_PHASE1_ERROR' was not declared in this scope
/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/gcc-4.2-20070307/libjava/exception.cc:200: warning: unused variable 'ip_before_insn'
{standard input}: Assembler messages:
{standard input}:2: Error: junk at end of line, first unrecognized character is `*'
{standard input}:3: Error: junk at end of line, first unrecognized character is `*'
{standard input}:4: Error: bad instruction `_zgan8__jarrayc1ev *INTERNAL*=_ZN8__JArrayC1Ev*INTERNAL*'
make[3]: *** [exception.lo] Error 1
make[3]: Leaving directory `/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/build/arm-iwmmxt-linux-gnueabi/libjava'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/build/arm-iwmmxt-linux-gnueabi/libjava'
make[1]: *** [all-target-libjava] Error 2
make[1]: Leaving directory `/home/tmp/portage/dev-java/gcj-4.2.0_beta20070307/work/build'
make: *** [bootstrap-lean] Error 2
Comment 12 Steven Newbury 2007-03-25 15:52:01 UTC
(In reply to comment #11)
> I have everything built except for libjava/exception.cc which fails as seen
> below.
> 
libjava/exception.cc needs special handling of the EABI unwind support as is done in the libsupc++ code.  I'm going to be working on this shortly if no-one else does first, I have some other work to do first.  I don't yet know if the EABI unwind ABI supports everything needed for java exceptions.
Comment 13 Andrew Haley 2007-07-20 15:11:29 UTC
Do you have copyright assignment?

If you do, please submit these patches to gcc-patches@gcc.gnu.org and java-patches@gcc.gnu.org.
Comment 14 Andrew Haley 2007-07-20 15:15:18 UTC
Actually, forget that last message. Most of these patches seem to be gcc 4.2 based and the libffi and gij patches are already done.
Comment 15 Steven Newbury 2007-07-20 17:16:54 UTC
(In reply to comment #14)
> Actually, forget that last message. Most of these patches seem to be gcc 4.2
> based and the libffi and gij patches are already done.
> 

I'm not sure what the current status of all this is at the moment, I've not got time to work on it right now.  As an aside, currently gcc 4.3 does not build for iWMMXt, it hits an ICE while compiling libgcc with the stage1 compiler, so I can't test that for my target anyway (if it isn't fixed in the next snapshot I'll post a new bug report for it).
Comment 16 Steven Newbury 2007-08-03 11:52:05 UTC
(In reply to comment #14)
> Actually, forget that last message. Most of these patches seem to be gcc 4.2
> based and the libffi and gij patches are already done.
> 

Andrew: I spotted your new patch here http://gcc.gnu.org/ml/gcc-patches/2007-07/msg01986.html, one thing I see missing is in libffi/src/arm/ffi.c,  FFI_INIT_TRAMPOLINE uses the OABI style syscall to call sys_cacheflush, this will fail without OABI support.  Not too hard to add but I don't have copyright assignment still, so...
Comment 17 Andrew Haley 2007-08-03 12:02:53 UTC
Re comment #16: I've tested this, and it seems to work.  What failures do you expect?
Comment 18 Steven Newbury 2007-08-03 12:56:17 UTC
(In reply to comment #17)
> Re comment #16: I've tested this, and it seems to work.  What failures do you
> expect?
> 

/* How to make a trampoline.  */

#define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX) \
({ unsigned char *__tramp = (unsigned char*)(TRAMP); \
   unsigned int  __fun = (unsigned int)(FUN); \
   unsigned int  __ctx = (unsigned int)(CTX); \
   *(unsigned int*) &__tramp[0] = 0xe92d000f; /* stmfd sp!, {r0-r3} */  \
   *(unsigned int*) &__tramp[4] = 0xe59f0000; /* ldr r0, [pc] */ \
   *(unsigned int*) &__tramp[8] = 0xe59ff000; /* ldr pc, [pc] */ \
   *(unsigned int*) &__tramp[12] = __ctx; \
   *(unsigned int*) &__tramp[16] = __fun; \
   register unsigned long _beg __asm ("a1") = (unsigned long) (&__tramp[0]);    \
   register unsigned long _end __asm ("a2") = (unsigned long) (&__tramp[19]);   \
   register unsigned long _flg __asm ("a3") = 0;                        \
   __asm __volatile ("swi\ 0x9f0002             @ sys_cacheflush"       \
                            : "=r" (_beg)                               \
                            : "0" (_beg), "r" (_end), "r" (_flg));      \
 })

The above swi uses the OABI syscall base.

From include/asm-arm/unistd.h:
#define __NR_OABI_SYSCALL_BASE  0x900000

#if defined(__thumb__) || defined(__ARM_EABI__)
#define __NR_SYSCALL_BASE       0
#else
#define __NR_SYSCALL_BASE       __NR_OABI_SYSCALL_BASE
#endif

With EABI all syscalls are called as swi 0 with the syscall number passed in a register rather than encoding it into the instruction (offset from 0x900000).

When the above code from ffi.c is executed on a kernel lacking the OABI syscall handling it will fail with an illegal instruction trap.
Comment 19 Steven Newbury 2007-08-03 13:52:26 UTC
Created attachment 14015 [details]
libffi EABI sys_cacheflush support

Use EABI syscall method for sys_cacheflush when __ARM_EABI__ is defined
Comment 20 Andrew Haley 2007-08-03 14:33:29 UTC
Please post patches to java-patches@gcc.gnu.org.  Please provide a ChangeLog.
Comment 21 Andrew Haley 2007-08-09 17:44:23 UTC
I've created  abranch for this work at svn+ssh://gcc.gnu.org/svn/gcc/branches/gcj/gcj-eabi-branch

It's mostly done, but there are still some bugs.  I'll post the patches to the gcc list when they're in a fit state.
Comment 22 Andrew Haley 2007-09-04 19:14:57 UTC
Done.