This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
ARM EABI: Configure and testsuite patches
- From: Andrew Haley <aph-gcc at littlepinkcloud dot COM>
- To: java-patches at gcc dot gnu dot org
- Date: Wed, 22 Aug 2007 10:23:13 +0100
- Subject: ARM EABI: Configure and testsuite patches
This adds libstdc++ as a dependency for libgcj on ARM EABI. This is
because part of the unwinder is in libstdc++ rather than libgcc: I
could have copied tha same logic into libgcj, but that would not have
been a good idea. libstdc++ will be present, so we might as well
depend on it.
Also, a bug in the ARM EABI unwinder means that we have to compile JNI
code with -fexceptions. That bug should be fixed, but this is a
workaround for the testsuite.
Andrew.
2007-08-22 Andrew Haley <aph@redhat.com>
* configure.ac (LIBSTDCXXSPEC): New.
* configure.host: Add arm*-linux* to pthread test.
* configure.ac (LIBGCJTESTSPEC): Add path to libstdc++ for ARM EABI.
* testsuite/libjava.jni/jni.exp (gcj_jni_compile_c_to_so): Use
-fexceptions for ARM EABI.
Index: configure.host
===================================================================
--- configure.host (revision 127517)
+++ configure.host (working copy)
@@ -197,6 +197,7 @@
i[34567]86*-linux* | \
powerpc*-linux* | \
alpha*-linux* | \
+ arm*-linux* | \
s390*-linux* | \
sparc*-linux* | \
ia64-* | \
Index: configure.ac
===================================================================
--- configure.ac (revision 127517)
+++ configure.ac (working copy)
@@ -763,9 +763,6 @@
esac
AC_SUBST(SYSTEMSPEC)
-LIBGCJTESTSPEC="-L`${PWDCMD-pwd}`/.libs -rpath `${PWDCMD-pwd}`/.libs"
-AC_SUBST(LIBGCJTESTSPEC)
-
AC_ARG_WITH(system-zlib,
AS_HELP_STRING([--with-system-zlib],
[use installed libz]))
@@ -779,6 +776,9 @@
# FIXME: this should be _libs on some hosts.
libsubdir=.libs
+LIBGCJTESTSPEC="-L`${PWDCMD-pwd}`/.libs -rpath `${PWDCMD-pwd}`/.libs"
+
+LIBSTDCXXSPEC=
# extra LD Flags which are required for targets
case "${host}" in
*-*-darwin[[0-7]].*)
@@ -788,12 +788,20 @@
extra_ldflags_libjava=-Wl,-single_module
;;
arm*linux*eabi)
- extra_ldflags=-L../libstdc++/src -lstdc++
+ # Some of the ARM unwinder code is actually in libstdc++. We
+ # could in principle replicate it in libgcj, but it's better to
+ # have a dependency on libstdc++.
+ extra_ldflags='-L$(here)/../libstdc++-v3/src/.libs -lstdc++'
+ LIBSTDCXXSPEC=-lstdc++
+ LIBGCJTESTSPEC="-L`${PWDCMD-pwd}`/.libs -L`${PWDCMD-pwd}`/../libstdc++-v3/src/.libs -rpath `${PWDCMD-pwd}`/.libs:`${PWDCMD-pwd}`/../libstdc++-v3/src/.libs -lstdc++"
;;
esac
AC_SUBST(extra_ldflags_libjava)
AC_SUBST(extra_ldflags)
+AC_SUBST(LIBSTDCXXSPEC)
+AC_SUBST(LIBGCJTESTSPEC)
+
# Allow the GC to be disabled. Can be useful when debugging.
AC_MSG_CHECKING([for garbage collector to use])
AC_ARG_ENABLE(java-gc,
Index: testsuite/lib/libjava.exp
===================================================================
--- testsuite/lib/libjava.exp (revision 127517)
+++ testsuite/lib/libjava.exp (working copy)
@@ -379,6 +379,7 @@
if {$mode == "link"} {
global wrapper_file wrap_compile_flags
lappend args "additional_flags=$wrap_compile_flags"
+ lappend args "additional_flags=-specs=libgcj-test.spec"
lappend args "libs=$wrapper_file"
lappend args "libs=$libjava"
lappend args debug
@@ -572,6 +573,8 @@
return 1
}
+ send_log "invoke: $executable $args $inpfile\n"
+
set result [libjava_load $executable $args "$inpfile"]
set status [lindex $result 0]
set output [lindex $result 1]
Index: testsuite/libjava.jni/jni.exp
===================================================================
--- testsuite/libjava.jni/jni.exp (revision 127517)
+++ testsuite/libjava.jni/jni.exp (working copy)
@@ -29,6 +29,10 @@
set name [file rootname $filename]
set soname lib${name}.${so_extension}
+ if { [istarget "*arm-*eabi*"] } {
+ lappend options "additional_flags=-fexceptions"
+ }
+
lappend options "additional_flags=${so_flag} -fPIC"
# Find the generated header.
lappend options "additional_flags=-I. -I.. -I$srcdir/$subdir -fdollars-in-identifiers"
Index: libgcj.spec.in
===================================================================
--- libgcj.spec.in (revision 127517)
+++ libgcj.spec.in (working copy)
@@ -7,6 +7,6 @@
*startfile: @THREADSTARTFILESPEC@ %(startfileorig)
%rename lib liborig
-*lib: @LD_START_STATIC_SPEC@ @LIBGCJ_SPEC@ @LD_FINISH_STATIC_SPEC@ -lm @LIBICONV@ @GCSPEC@ @THREADSPEC@ @ZLIBSPEC@ @SYSTEMSPEC@ %(libgcc) %(liborig)
+*lib: @LD_START_STATIC_SPEC@ @LIBGCJ_SPEC@ @LD_FINISH_STATIC_SPEC@ -lm @LIBICONV@ @GCSPEC@ @THREADSPEC@ @ZLIBSPEC@ @SYSTEMSPEC@ %(libgcc) @LIBSTDCXXSPEC@ %(liborig)
*jc1: @HASH_SYNC_SPEC@ @DIVIDESPEC@ @CHECKREFSPEC@ @JC1GCSPEC@ @EXCEPTIONSPEC@ @BACKTRACESPEC@ @IEEESPEC@ -fkeep-inline-functions