This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

3.4 PATCH: Fix libffi MIPS O32/N64 ABI handling


After first testing my (yet unreviewed, hint, hint) IRIX 6 O32 integration
patches without libjava (the default on IRIX 6), I ran a new bootstrap with
--enable-libgcj to see if that still works.  Unfortunately, it didn't: the
native O32 ld segfaulted when building libffi.so.  Upon further
investigation, this was due to the contents of n32.o, which should be empty
for O32, but wasn't.  It turned out that the MIPS ABI handling in
ffi_mips.h was seriously wrong: for non-N32 with GCC, O32 was assumed,
which is clearly wrong for N64.

Since _MIPS_SIM is already used unconditionally in src/mips/ffi.c, I made
the following change:

* FFI_MIPS_N32 is defined for both N32 and N64.  While N64 isn't really
  supported yet, N64 is so close to N32 that support should be quite
  similar.

* I cannot think of a reason to assume O32 with non-N32 GCC, so I simply
  removed the test.

With those changes, at least I got reasonable preprocessed versions of
n32.S and o32.S.

I'll address the O32 ld segfault in a separate patch (since it is
completely unrelated).

There's still much to do for libffi on MIPS:

* really support the N64 ABI

* fix a couple of bugs (both N32 and O32) detected by the testsuite

* implement the closure API for all three ABIs

Ok for mainline?

	Rainer

-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University


Mon Oct  6 20:34:56 2003  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>

	* include/ffi_mips.h: Define FFI_MIPS_N32 for N32/N64 ABIs,
	FFI_MIPS_O32 for O32 ABI.

Index: ffi_mips.h
===================================================================
RCS file: /cvs/gcc/gcc/libffi/include/ffi_mips.h,v
retrieving revision 1.2
diff -u -p -r1.2 ffi_mips.h
--- ffi_mips.h	2 Mar 2001 22:21:22 -0000	1.2
+++ ffi_mips.h	6 Oct 2003 18:31:18 -0000
@@ -30,17 +30,13 @@
 #if !defined(_MIPS_SIM)
 -- something is very wrong --
 #else
-#  if _MIPS_SIM==_ABIN32 && defined(_ABIN32)
+#  if (_MIPS_SIM==_ABIN32 && defined(_ABIN32)) || (_MIPS_SIM==_ABI64 && defined(_ABI64))
 #    define FFI_MIPS_N32
 #  else
-#    if defined(__GNUC__)
+#    if _MIPS_SIM==_ABIO32 && defined(_ABIO32)
 #      define FFI_MIPS_O32
 #    else
-#      if _MIPS_SIM==_ABIO32
-#        define FFI_MIPS_O32
-#      else
 -- this is an unsupported platform --
-#      endif
 #    endif
 #  endif
 #endif


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]