Add moxie support. Release 3.0.12. v3.0.12
authorAnthony Green <green@moxielogic.com>
Mon, 11 Feb 2013 19:25:13 +0000 (14:25 -0500)
committerAnthony Green <green@moxielogic.com>
Mon, 11 Feb 2013 19:25:13 +0000 (14:25 -0500)
15 files changed:
ChangeLog
Makefile.am
Makefile.in
README
configure
configure.ac
doc/stamp-vti
doc/version.texi
src/moxie/eabi.S
src/moxie/ffi.c
src/moxie/ffitarget.h
testsuite/libffi.call/huge_struct.c
testsuite/libffi.call/return_dbl.c
testsuite/libffi.special/unwindtest.cc
testsuite/libffi.special/unwindtest_ffi_call.cc

index 74d529e..92c1a15 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,27 @@
+2013-02-11  Anthony Green <green@moxielogic.com>
+
+       * configure.ac: Update release number to 3.0.12.
+       * configure: Rebuilt.
+       * README: Update release info.
+
+2013-02-10  Anthony Green <green@moxielogic.com>
+
+       * README: Add Moxie.
+       * src/moxie/ffi.c: Created.
+       * src/moxie/eabi.S: Created.
+       * src/moxie/ffitarget.h: Created.
+       * Makefile.am (nodist_libffi_la_SOURCES): Add Moxie.
+       * Makefile.in: Rebuilt.
+       * configure.ac: Add Moxie.
+       * configure: Rebuilt.
+       * testsuite/libffi.call/huge_struct.c: Disable format string
+       warnings for moxie*-*-elf tests.
+
+2013-02-10  Anthony Green <green@moxielogic.com>
+
+       * Makefile.am (LTLDFLAGS): Fix reference.
+       * Makefile.in: Rebuilt.
+
 2013-02-10  Anthony Green <green@moxielogic.com>
 
        * README: Update supported platforms.  Update test results link.
 2013-02-10  Anthony Green <green@moxielogic.com>
 
        * README: Update supported platforms.  Update test results link.
index 5787f9e..8f1362a 100644 (file)
@@ -148,6 +148,9 @@ endif
 if M68K
 nodist_libffi_la_SOURCES += src/m68k/ffi.c src/m68k/sysv.S
 endif
 if M68K
 nodist_libffi_la_SOURCES += src/m68k/ffi.c src/m68k/sysv.S
 endif
+if MOXIE
+nodist_libffi_la_SOURCES += src/moxie/ffi.c src/moxie/eabi.S
+endif
 if MICROBLAZE
 nodist_libffi_la_SOURCES += src/microblaze/ffi.c src/microblaze/sysv.S
 endif
 if MICROBLAZE
 nodist_libffi_la_SOURCES += src/microblaze/ffi.c src/microblaze/sysv.S
 endif
@@ -209,7 +212,7 @@ endif
 libffi_convenience_la_SOURCES = $(libffi_la_SOURCES)
 nodist_libffi_convenience_la_SOURCES = $(nodist_libffi_la_SOURCES)
 
 libffi_convenience_la_SOURCES = $(libffi_la_SOURCES)
 nodist_libffi_convenience_la_SOURCES = $(nodist_libffi_la_SOURCES)
 
-LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
+LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/libtool-ldflags $(LDFLAGS))
 
 libffi_la_LDFLAGS = -no-undefined -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LTLDFLAGS) $(AM_LTLDFLAGS)
 
 
 libffi_la_LDFLAGS = -no-undefined -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LTLDFLAGS) $(AM_LTLDFLAGS)
 
index 7317ec1..fc5e80e 100644 (file)
@@ -65,25 +65,26 @@ target_triplet = @target@
 @IA64_TRUE@am__append_11 = src/ia64/ffi.c src/ia64/unix.S
 @M32R_TRUE@am__append_12 = src/m32r/sysv.S src/m32r/ffi.c
 @M68K_TRUE@am__append_13 = src/m68k/ffi.c src/m68k/sysv.S
 @IA64_TRUE@am__append_11 = src/ia64/ffi.c src/ia64/unix.S
 @M32R_TRUE@am__append_12 = src/m32r/sysv.S src/m32r/ffi.c
 @M68K_TRUE@am__append_13 = src/m68k/ffi.c src/m68k/sysv.S
-@MICROBLAZE_TRUE@am__append_14 = src/microblaze/ffi.c src/microblaze/sysv.S
-@POWERPC_TRUE@am__append_15 = src/powerpc/ffi.c src/powerpc/sysv.S src/powerpc/ppc_closure.S src/powerpc/linux64.S src/powerpc/linux64_closure.S
-@POWERPC_AIX_TRUE@am__append_16 = src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closure.S
-@POWERPC_DARWIN_TRUE@am__append_17 = src/powerpc/ffi_darwin.c src/powerpc/darwin.S src/powerpc/darwin_closure.S
-@POWERPC_FREEBSD_TRUE@am__append_18 = src/powerpc/ffi.c src/powerpc/sysv.S src/powerpc/ppc_closure.S
-@AARCH64_TRUE@am__append_19 = src/aarch64/sysv.S src/aarch64/ffi.c
-@ARM_TRUE@am__append_20 = src/arm/sysv.S src/arm/ffi.c
-@ARM_TRUE@@FFI_EXEC_TRAMPOLINE_TABLE_TRUE@am__append_21 = src/arm/trampoline.S
-@AVR32_TRUE@am__append_22 = src/avr32/sysv.S src/avr32/ffi.c
-@LIBFFI_CRIS_TRUE@am__append_23 = src/cris/sysv.S src/cris/ffi.c
-@FRV_TRUE@am__append_24 = src/frv/eabi.S src/frv/ffi.c
-@S390_TRUE@am__append_25 = src/s390/sysv.S src/s390/ffi.c
-@X86_64_TRUE@am__append_26 = src/x86/ffi64.c src/x86/unix64.S src/x86/ffi.c src/x86/sysv.S
-@SH_TRUE@am__append_27 = src/sh/sysv.S src/sh/ffi.c
-@SH64_TRUE@am__append_28 = src/sh64/sysv.S src/sh64/ffi.c
-@PA_LINUX_TRUE@am__append_29 = src/pa/linux.S src/pa/ffi.c
-@PA_HPUX_TRUE@am__append_30 = src/pa/hpux32.S src/pa/ffi.c
-@TILE_TRUE@am__append_31 = src/tile/tile.S src/tile/ffi.c
-@XTENSA_TRUE@am__append_32 = src/xtensa/sysv.S src/xtensa/ffi.c
+@MOXIE_TRUE@am__append_14 = src/moxie/ffi.c src/moxie/eabi.S
+@MICROBLAZE_TRUE@am__append_15 = src/microblaze/ffi.c src/microblaze/sysv.S
+@POWERPC_TRUE@am__append_16 = src/powerpc/ffi.c src/powerpc/sysv.S src/powerpc/ppc_closure.S src/powerpc/linux64.S src/powerpc/linux64_closure.S
+@POWERPC_AIX_TRUE@am__append_17 = src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closure.S
+@POWERPC_DARWIN_TRUE@am__append_18 = src/powerpc/ffi_darwin.c src/powerpc/darwin.S src/powerpc/darwin_closure.S
+@POWERPC_FREEBSD_TRUE@am__append_19 = src/powerpc/ffi.c src/powerpc/sysv.S src/powerpc/ppc_closure.S
+@AARCH64_TRUE@am__append_20 = src/aarch64/sysv.S src/aarch64/ffi.c
+@ARM_TRUE@am__append_21 = src/arm/sysv.S src/arm/ffi.c
+@ARM_TRUE@@FFI_EXEC_TRAMPOLINE_TABLE_TRUE@am__append_22 = src/arm/trampoline.S
+@AVR32_TRUE@am__append_23 = src/avr32/sysv.S src/avr32/ffi.c
+@LIBFFI_CRIS_TRUE@am__append_24 = src/cris/sysv.S src/cris/ffi.c
+@FRV_TRUE@am__append_25 = src/frv/eabi.S src/frv/ffi.c
+@S390_TRUE@am__append_26 = src/s390/sysv.S src/s390/ffi.c
+@X86_64_TRUE@am__append_27 = src/x86/ffi64.c src/x86/unix64.S src/x86/ffi.c src/x86/sysv.S
+@SH_TRUE@am__append_28 = src/sh/sysv.S src/sh/ffi.c
+@SH64_TRUE@am__append_29 = src/sh64/sysv.S src/sh64/ffi.c
+@PA_LINUX_TRUE@am__append_30 = src/pa/linux.S src/pa/ffi.c
+@PA_HPUX_TRUE@am__append_31 = src/pa/hpux32.S src/pa/ffi.c
+@TILE_TRUE@am__append_32 = src/tile/tile.S src/tile/ffi.c
+@XTENSA_TRUE@am__append_33 = src/xtensa/sysv.S src/xtensa/ffi.c
 subdir = .
 DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
        $(srcdir)/Makefile.in $(srcdir)/doc/stamp-vti \
 subdir = .
 DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
        $(srcdir)/Makefile.in $(srcdir)/doc/stamp-vti \
@@ -164,36 +165,37 @@ am_libffi_la_OBJECTS = src/prep_cif.lo src/types.lo src/raw_api.lo \
 @IA64_TRUE@am__objects_11 = src/ia64/ffi.lo src/ia64/unix.lo
 @M32R_TRUE@am__objects_12 = src/m32r/sysv.lo src/m32r/ffi.lo
 @M68K_TRUE@am__objects_13 = src/m68k/ffi.lo src/m68k/sysv.lo
 @IA64_TRUE@am__objects_11 = src/ia64/ffi.lo src/ia64/unix.lo
 @M32R_TRUE@am__objects_12 = src/m32r/sysv.lo src/m32r/ffi.lo
 @M68K_TRUE@am__objects_13 = src/m68k/ffi.lo src/m68k/sysv.lo
-@MICROBLAZE_TRUE@am__objects_14 = src/microblaze/ffi.lo \
+@MOXIE_TRUE@am__objects_14 = src/moxie/ffi.lo src/moxie/eabi.lo
+@MICROBLAZE_TRUE@am__objects_15 = src/microblaze/ffi.lo \
 @MICROBLAZE_TRUE@      src/microblaze/sysv.lo
 @MICROBLAZE_TRUE@      src/microblaze/sysv.lo
-@POWERPC_TRUE@am__objects_15 = src/powerpc/ffi.lo src/powerpc/sysv.lo \
+@POWERPC_TRUE@am__objects_16 = src/powerpc/ffi.lo src/powerpc/sysv.lo \
 @POWERPC_TRUE@ src/powerpc/ppc_closure.lo \
 @POWERPC_TRUE@ src/powerpc/linux64.lo \
 @POWERPC_TRUE@ src/powerpc/linux64_closure.lo
 @POWERPC_TRUE@ src/powerpc/ppc_closure.lo \
 @POWERPC_TRUE@ src/powerpc/linux64.lo \
 @POWERPC_TRUE@ src/powerpc/linux64_closure.lo
-@POWERPC_AIX_TRUE@am__objects_16 = src/powerpc/ffi_darwin.lo \
+@POWERPC_AIX_TRUE@am__objects_17 = src/powerpc/ffi_darwin.lo \
 @POWERPC_AIX_TRUE@     src/powerpc/aix.lo \
 @POWERPC_AIX_TRUE@     src/powerpc/aix_closure.lo
 @POWERPC_AIX_TRUE@     src/powerpc/aix.lo \
 @POWERPC_AIX_TRUE@     src/powerpc/aix_closure.lo
-@POWERPC_DARWIN_TRUE@am__objects_17 = src/powerpc/ffi_darwin.lo \
+@POWERPC_DARWIN_TRUE@am__objects_18 = src/powerpc/ffi_darwin.lo \
 @POWERPC_DARWIN_TRUE@  src/powerpc/darwin.lo \
 @POWERPC_DARWIN_TRUE@  src/powerpc/darwin_closure.lo
 @POWERPC_DARWIN_TRUE@  src/powerpc/darwin.lo \
 @POWERPC_DARWIN_TRUE@  src/powerpc/darwin_closure.lo
-@POWERPC_FREEBSD_TRUE@am__objects_18 = src/powerpc/ffi.lo \
+@POWERPC_FREEBSD_TRUE@am__objects_19 = src/powerpc/ffi.lo \
 @POWERPC_FREEBSD_TRUE@ src/powerpc/sysv.lo \
 @POWERPC_FREEBSD_TRUE@ src/powerpc/ppc_closure.lo
 @POWERPC_FREEBSD_TRUE@ src/powerpc/sysv.lo \
 @POWERPC_FREEBSD_TRUE@ src/powerpc/ppc_closure.lo
-@AARCH64_TRUE@am__objects_19 = src/aarch64/sysv.lo src/aarch64/ffi.lo
-@ARM_TRUE@am__objects_20 = src/arm/sysv.lo src/arm/ffi.lo
-@ARM_TRUE@@FFI_EXEC_TRAMPOLINE_TABLE_TRUE@am__objects_21 = src/arm/trampoline.lo
-@AVR32_TRUE@am__objects_22 = src/avr32/sysv.lo src/avr32/ffi.lo
-@LIBFFI_CRIS_TRUE@am__objects_23 = src/cris/sysv.lo src/cris/ffi.lo
-@FRV_TRUE@am__objects_24 = src/frv/eabi.lo src/frv/ffi.lo
-@S390_TRUE@am__objects_25 = src/s390/sysv.lo src/s390/ffi.lo
-@X86_64_TRUE@am__objects_26 = src/x86/ffi64.lo src/x86/unix64.lo \
+@AARCH64_TRUE@am__objects_20 = src/aarch64/sysv.lo src/aarch64/ffi.lo
+@ARM_TRUE@am__objects_21 = src/arm/sysv.lo src/arm/ffi.lo
+@ARM_TRUE@@FFI_EXEC_TRAMPOLINE_TABLE_TRUE@am__objects_22 = src/arm/trampoline.lo
+@AVR32_TRUE@am__objects_23 = src/avr32/sysv.lo src/avr32/ffi.lo
+@LIBFFI_CRIS_TRUE@am__objects_24 = src/cris/sysv.lo src/cris/ffi.lo
+@FRV_TRUE@am__objects_25 = src/frv/eabi.lo src/frv/ffi.lo
+@S390_TRUE@am__objects_26 = src/s390/sysv.lo src/s390/ffi.lo
+@X86_64_TRUE@am__objects_27 = src/x86/ffi64.lo src/x86/unix64.lo \
 @X86_64_TRUE@  src/x86/ffi.lo src/x86/sysv.lo
 @X86_64_TRUE@  src/x86/ffi.lo src/x86/sysv.lo
-@SH_TRUE@am__objects_27 = src/sh/sysv.lo src/sh/ffi.lo
-@SH64_TRUE@am__objects_28 = src/sh64/sysv.lo src/sh64/ffi.lo
-@PA_LINUX_TRUE@am__objects_29 = src/pa/linux.lo src/pa/ffi.lo
-@PA_HPUX_TRUE@am__objects_30 = src/pa/hpux32.lo src/pa/ffi.lo
-@TILE_TRUE@am__objects_31 = src/tile/tile.lo src/tile/ffi.lo
-@XTENSA_TRUE@am__objects_32 = src/xtensa/sysv.lo src/xtensa/ffi.lo
+@SH_TRUE@am__objects_28 = src/sh/sysv.lo src/sh/ffi.lo
+@SH64_TRUE@am__objects_29 = src/sh64/sysv.lo src/sh64/ffi.lo
+@PA_LINUX_TRUE@am__objects_30 = src/pa/linux.lo src/pa/ffi.lo
+@PA_HPUX_TRUE@am__objects_31 = src/pa/hpux32.lo src/pa/ffi.lo
+@TILE_TRUE@am__objects_32 = src/tile/tile.lo src/tile/ffi.lo
+@XTENSA_TRUE@am__objects_33 = src/xtensa/sysv.lo src/xtensa/ffi.lo
 nodist_libffi_la_OBJECTS = $(am__objects_1) $(am__objects_2) \
        $(am__objects_3) $(am__objects_4) $(am__objects_5) \
        $(am__objects_6) $(am__objects_7) $(am__objects_8) \
 nodist_libffi_la_OBJECTS = $(am__objects_1) $(am__objects_2) \
        $(am__objects_3) $(am__objects_4) $(am__objects_5) \
        $(am__objects_6) $(am__objects_7) $(am__objects_8) \
@@ -204,17 +206,18 @@ nodist_libffi_la_OBJECTS = $(am__objects_1) $(am__objects_2) \
        $(am__objects_21) $(am__objects_22) $(am__objects_23) \
        $(am__objects_24) $(am__objects_25) $(am__objects_26) \
        $(am__objects_27) $(am__objects_28) $(am__objects_29) \
        $(am__objects_21) $(am__objects_22) $(am__objects_23) \
        $(am__objects_24) $(am__objects_25) $(am__objects_26) \
        $(am__objects_27) $(am__objects_28) $(am__objects_29) \
-       $(am__objects_30) $(am__objects_31) $(am__objects_32)
+       $(am__objects_30) $(am__objects_31) $(am__objects_32) \
+       $(am__objects_33)
 libffi_la_OBJECTS = $(am_libffi_la_OBJECTS) \
        $(nodist_libffi_la_OBJECTS)
 libffi_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
        $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
        $(libffi_la_LDFLAGS) $(LDFLAGS) -o $@
 libffi_convenience_la_LIBADD =
 libffi_la_OBJECTS = $(am_libffi_la_OBJECTS) \
        $(nodist_libffi_la_OBJECTS)
 libffi_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
        $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
        $(libffi_la_LDFLAGS) $(LDFLAGS) -o $@
 libffi_convenience_la_LIBADD =
-am__objects_33 = src/prep_cif.lo src/types.lo src/raw_api.lo \
+am__objects_34 = src/prep_cif.lo src/types.lo src/raw_api.lo \
        src/java_raw_api.lo src/closures.lo
        src/java_raw_api.lo src/closures.lo
-am_libffi_convenience_la_OBJECTS = $(am__objects_33)
-am__objects_34 = $(am__objects_1) $(am__objects_2) $(am__objects_3) \
+am_libffi_convenience_la_OBJECTS = $(am__objects_34)
+am__objects_35 = $(am__objects_1) $(am__objects_2) $(am__objects_3) \
        $(am__objects_4) $(am__objects_5) $(am__objects_6) \
        $(am__objects_7) $(am__objects_8) $(am__objects_9) \
        $(am__objects_10) $(am__objects_11) $(am__objects_12) \
        $(am__objects_4) $(am__objects_5) $(am__objects_6) \
        $(am__objects_7) $(am__objects_8) $(am__objects_9) \
        $(am__objects_10) $(am__objects_11) $(am__objects_12) \
@@ -224,8 +227,8 @@ am__objects_34 = $(am__objects_1) $(am__objects_2) $(am__objects_3) \
        $(am__objects_22) $(am__objects_23) $(am__objects_24) \
        $(am__objects_25) $(am__objects_26) $(am__objects_27) \
        $(am__objects_28) $(am__objects_29) $(am__objects_30) \
        $(am__objects_22) $(am__objects_23) $(am__objects_24) \
        $(am__objects_25) $(am__objects_26) $(am__objects_27) \
        $(am__objects_28) $(am__objects_29) $(am__objects_30) \
-       $(am__objects_31) $(am__objects_32)
-nodist_libffi_convenience_la_OBJECTS = $(am__objects_34)
+       $(am__objects_31) $(am__objects_32) $(am__objects_33)
+nodist_libffi_convenience_la_OBJECTS = $(am__objects_35)
 libffi_convenience_la_OBJECTS = $(am_libffi_convenience_la_OBJECTS) \
        $(nodist_libffi_convenience_la_OBJECTS)
 DEFAULT_INCLUDES = -I.@am__isrc@
 libffi_convenience_la_OBJECTS = $(am_libffi_convenience_la_OBJECTS) \
        $(nodist_libffi_convenience_la_OBJECTS)
 DEFAULT_INCLUDES = -I.@am__isrc@
@@ -563,10 +566,11 @@ nodist_libffi_la_SOURCES = $(am__append_1) $(am__append_2) \
        $(am__append_21) $(am__append_22) $(am__append_23) \
        $(am__append_24) $(am__append_25) $(am__append_26) \
        $(am__append_27) $(am__append_28) $(am__append_29) \
        $(am__append_21) $(am__append_22) $(am__append_23) \
        $(am__append_24) $(am__append_25) $(am__append_26) \
        $(am__append_27) $(am__append_28) $(am__append_29) \
-       $(am__append_30) $(am__append_31) $(am__append_32)
+       $(am__append_30) $(am__append_31) $(am__append_32) \
+       $(am__append_33)
 libffi_convenience_la_SOURCES = $(libffi_la_SOURCES)
 nodist_libffi_convenience_la_SOURCES = $(nodist_libffi_la_SOURCES)
 libffi_convenience_la_SOURCES = $(libffi_la_SOURCES)
 nodist_libffi_convenience_la_SOURCES = $(nodist_libffi_la_SOURCES)
-LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
+LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/libtool-ldflags $(LDFLAGS))
 libffi_la_LDFLAGS = -no-undefined -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LTLDFLAGS) $(AM_LTLDFLAGS)
 AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
 AM_CCASFLAGS = $(AM_CPPFLAGS)
 libffi_la_LDFLAGS = -no-undefined -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LTLDFLAGS) $(AM_LTLDFLAGS)
 AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
 AM_CCASFLAGS = $(AM_CPPFLAGS)
@@ -779,6 +783,16 @@ src/m68k/ffi.lo: src/m68k/$(am__dirstamp) \
        src/m68k/$(DEPDIR)/$(am__dirstamp)
 src/m68k/sysv.lo: src/m68k/$(am__dirstamp) \
        src/m68k/$(DEPDIR)/$(am__dirstamp)
        src/m68k/$(DEPDIR)/$(am__dirstamp)
 src/m68k/sysv.lo: src/m68k/$(am__dirstamp) \
        src/m68k/$(DEPDIR)/$(am__dirstamp)
+src/moxie/$(am__dirstamp):
+       @$(MKDIR_P) src/moxie
+       @: > src/moxie/$(am__dirstamp)
+src/moxie/$(DEPDIR)/$(am__dirstamp):
+       @$(MKDIR_P) src/moxie/$(DEPDIR)
+       @: > src/moxie/$(DEPDIR)/$(am__dirstamp)
+src/moxie/ffi.lo: src/moxie/$(am__dirstamp) \
+       src/moxie/$(DEPDIR)/$(am__dirstamp)
+src/moxie/eabi.lo: src/moxie/$(am__dirstamp) \
+       src/moxie/$(DEPDIR)/$(am__dirstamp)
 src/microblaze/$(am__dirstamp):
        @$(MKDIR_P) src/microblaze
        @: > src/microblaze/$(am__dirstamp)
 src/microblaze/$(am__dirstamp):
        @$(MKDIR_P) src/microblaze
        @: > src/microblaze/$(am__dirstamp)
@@ -962,6 +976,8 @@ mostlyclean-compile:
        -rm -f src/microblaze/*.lo
        -rm -f src/mips/*.$(OBJEXT)
        -rm -f src/mips/*.lo
        -rm -f src/microblaze/*.lo
        -rm -f src/mips/*.$(OBJEXT)
        -rm -f src/mips/*.lo
+       -rm -f src/moxie/*.$(OBJEXT)
+       -rm -f src/moxie/*.lo
        -rm -f src/pa/*.$(OBJEXT)
        -rm -f src/pa/*.lo
        -rm -f src/powerpc/*.$(OBJEXT)
        -rm -f src/pa/*.$(OBJEXT)
        -rm -f src/pa/*.lo
        -rm -f src/powerpc/*.$(OBJEXT)
@@ -1016,6 +1032,8 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@src/mips/$(DEPDIR)/ffi.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/mips/$(DEPDIR)/n32.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/mips/$(DEPDIR)/o32.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/mips/$(DEPDIR)/ffi.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/mips/$(DEPDIR)/n32.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/mips/$(DEPDIR)/o32.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/moxie/$(DEPDIR)/eabi.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/moxie/$(DEPDIR)/ffi.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/pa/$(DEPDIR)/ffi.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/pa/$(DEPDIR)/hpux32.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/pa/$(DEPDIR)/linux.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/pa/$(DEPDIR)/ffi.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/pa/$(DEPDIR)/hpux32.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/pa/$(DEPDIR)/linux.Plo@am__quote@
@@ -1118,6 +1136,7 @@ clean-libtool:
        -rm -rf src/m68k/.libs src/m68k/_libs
        -rm -rf src/microblaze/.libs src/microblaze/_libs
        -rm -rf src/mips/.libs src/mips/_libs
        -rm -rf src/m68k/.libs src/m68k/_libs
        -rm -rf src/microblaze/.libs src/microblaze/_libs
        -rm -rf src/mips/.libs src/mips/_libs
+       -rm -rf src/moxie/.libs src/moxie/_libs
        -rm -rf src/pa/.libs src/pa/_libs
        -rm -rf src/powerpc/.libs src/powerpc/_libs
        -rm -rf src/s390/.libs src/s390/_libs
        -rm -rf src/pa/.libs src/pa/_libs
        -rm -rf src/powerpc/.libs src/powerpc/_libs
        -rm -rf src/s390/.libs src/s390/_libs
@@ -1696,6 +1715,8 @@ distclean-generic:
        -rm -f src/microblaze/$(am__dirstamp)
        -rm -f src/mips/$(DEPDIR)/$(am__dirstamp)
        -rm -f src/mips/$(am__dirstamp)
        -rm -f src/microblaze/$(am__dirstamp)
        -rm -f src/mips/$(DEPDIR)/$(am__dirstamp)
        -rm -f src/mips/$(am__dirstamp)
+       -rm -f src/moxie/$(DEPDIR)/$(am__dirstamp)
+       -rm -f src/moxie/$(am__dirstamp)
        -rm -f src/pa/$(DEPDIR)/$(am__dirstamp)
        -rm -f src/pa/$(am__dirstamp)
        -rm -f src/powerpc/$(DEPDIR)/$(am__dirstamp)
        -rm -f src/pa/$(DEPDIR)/$(am__dirstamp)
        -rm -f src/pa/$(am__dirstamp)
        -rm -f src/powerpc/$(DEPDIR)/$(am__dirstamp)
@@ -1726,7 +1747,7 @@ clean-am: clean-aminfo clean-generic clean-libtool \
 
 distclean: distclean-recursive
        -rm -f $(am__CONFIG_DISTCLEAN_FILES)
 
 distclean: distclean-recursive
        -rm -f $(am__CONFIG_DISTCLEAN_FILES)
-       -rm -rf src/$(DEPDIR) src/aarch64/$(DEPDIR) src/alpha/$(DEPDIR) src/arm/$(DEPDIR) src/avr32/$(DEPDIR) src/bfin/$(DEPDIR) src/cris/$(DEPDIR) src/frv/$(DEPDIR) src/ia64/$(DEPDIR) src/m32r/$(DEPDIR) src/m68k/$(DEPDIR) src/microblaze/$(DEPDIR) src/mips/$(DEPDIR) src/pa/$(DEPDIR) src/powerpc/$(DEPDIR) src/s390/$(DEPDIR) src/sh/$(DEPDIR) src/sh64/$(DEPDIR) src/sparc/$(DEPDIR) src/tile/$(DEPDIR) src/x86/$(DEPDIR) src/xtensa/$(DEPDIR)
+       -rm -rf src/$(DEPDIR) src/aarch64/$(DEPDIR) src/alpha/$(DEPDIR) src/arm/$(DEPDIR) src/avr32/$(DEPDIR) src/bfin/$(DEPDIR) src/cris/$(DEPDIR) src/frv/$(DEPDIR) src/ia64/$(DEPDIR) src/m32r/$(DEPDIR) src/m68k/$(DEPDIR) src/microblaze/$(DEPDIR) src/mips/$(DEPDIR) src/moxie/$(DEPDIR) src/pa/$(DEPDIR) src/powerpc/$(DEPDIR) src/s390/$(DEPDIR) src/sh/$(DEPDIR) src/sh64/$(DEPDIR) src/sparc/$(DEPDIR) src/tile/$(DEPDIR) src/x86/$(DEPDIR) src/xtensa/$(DEPDIR)
        -rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
        distclean-hdr distclean-libtool distclean-tags
        -rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
        distclean-hdr distclean-libtool distclean-tags
@@ -1865,7 +1886,7 @@ installcheck-am:
 maintainer-clean: maintainer-clean-recursive
        -rm -f $(am__CONFIG_DISTCLEAN_FILES)
        -rm -rf $(top_srcdir)/autom4te.cache
 maintainer-clean: maintainer-clean-recursive
        -rm -f $(am__CONFIG_DISTCLEAN_FILES)
        -rm -rf $(top_srcdir)/autom4te.cache
-       -rm -rf src/$(DEPDIR) src/aarch64/$(DEPDIR) src/alpha/$(DEPDIR) src/arm/$(DEPDIR) src/avr32/$(DEPDIR) src/bfin/$(DEPDIR) src/cris/$(DEPDIR) src/frv/$(DEPDIR) src/ia64/$(DEPDIR) src/m32r/$(DEPDIR) src/m68k/$(DEPDIR) src/microblaze/$(DEPDIR) src/mips/$(DEPDIR) src/pa/$(DEPDIR) src/powerpc/$(DEPDIR) src/s390/$(DEPDIR) src/sh/$(DEPDIR) src/sh64/$(DEPDIR) src/sparc/$(DEPDIR) src/tile/$(DEPDIR) src/x86/$(DEPDIR) src/xtensa/$(DEPDIR)
+       -rm -rf src/$(DEPDIR) src/aarch64/$(DEPDIR) src/alpha/$(DEPDIR) src/arm/$(DEPDIR) src/avr32/$(DEPDIR) src/bfin/$(DEPDIR) src/cris/$(DEPDIR) src/frv/$(DEPDIR) src/ia64/$(DEPDIR) src/m32r/$(DEPDIR) src/m68k/$(DEPDIR) src/microblaze/$(DEPDIR) src/mips/$(DEPDIR) src/moxie/$(DEPDIR) src/pa/$(DEPDIR) src/powerpc/$(DEPDIR) src/s390/$(DEPDIR) src/sh/$(DEPDIR) src/sh64/$(DEPDIR) src/sparc/$(DEPDIR) src/tile/$(DEPDIR) src/x86/$(DEPDIR) src/xtensa/$(DEPDIR)
        -rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-aminfo \
        maintainer-clean-generic maintainer-clean-vti
        -rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-aminfo \
        maintainer-clean-generic maintainer-clean-vti
diff --git a/README b/README
index f5abd43..82b2104 100644 (file)
--- a/README
+++ b/README
@@ -1,8 +1,8 @@
 Status
 ======
 
 Status
 ======
 
-libffi-3.0.12 was released on XXXXXXX.  Check the libffi web page for
-updates: <URL:http://sourceware.org/libffi/>.
+libffi-3.0.12 was released on February 11, 2013.  Check the libffi web
+page for updates: <URL:http://sourceware.org/libffi/>.
 
 
 What is libffi?
 
 
 What is libffi?
@@ -68,6 +68,7 @@ tested:
 | MIPS            | Linux            | GCC                     |
 | MIPS            | RTEMS            | GCC                     |
 | MIPS64          | Linux            | GCC                     |
 | MIPS            | Linux            | GCC                     |
 | MIPS            | RTEMS            | GCC                     |
 | MIPS64          | Linux            | GCC                     |
+| Moxie                  | Bare metal       | GCC
 | PowerPC 32-bit  | AIX              | IBM XL C                |
 | PowerPC 64-bit  | AIX              | IBM XL C                |
 | PowerPC         | AMIGA            | GCC                     |
 | PowerPC 32-bit  | AIX              | IBM XL C                |
 | PowerPC 64-bit  | AIX              | IBM XL C                |
 | PowerPC         | AMIGA            | GCC                     |
@@ -161,11 +162,12 @@ History
 
 See the ChangeLog files for details.
 
 
 See the ChangeLog files for details.
 
-3.0.12 XXX-XX-XX
+3.0.12 Feb-11-13
+        Add Moxie support.
        Add AArch64 support.
        Add Blackfin support.
        Add TILE-Gx/TILEPro support.
        Add AArch64 support.
        Add Blackfin support.
        Add TILE-Gx/TILEPro support.
-       Add Microblaze support.
+       Add MicroBlaze support.
        Add Xtensa support.
        Add support for PaX enabled kernels with MPROTECT.
        Add support for native vendor compilers on
        Add Xtensa support.
        Add support for PaX enabled kernels with MPROTECT.
        Add support for native vendor compilers on
@@ -353,6 +355,7 @@ m68k                Andreas Schwab
 microblaze     Nathan Rossi
 mips           Anthony Green, Casey Marshall
 mips64         David Daney
 microblaze     Nathan Rossi
 mips           Anthony Green, Casey Marshall
 mips64         David Daney
+moxie          Anthony Green
 pa             Randolph Chung, Dave Anglin, Andreas Tobler
 powerpc                Geoffrey Keating, Andreas Tobler, 
                         David Edelsohn, John Hornkvist
 pa             Randolph Chung, Dave Anglin, Andreas Tobler
 powerpc                Geoffrey Keating, Andreas Tobler, 
                         David Edelsohn, John Hornkvist
index 771398a..a3a2a82 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for libffi 3.0.12-rc3.
+# Generated by GNU Autoconf 2.69 for libffi 3.0.12.
 #
 # Report bugs to <http://github.com/atgreen/libffi/issues>.
 #
 #
 # Report bugs to <http://github.com/atgreen/libffi/issues>.
 #
@@ -590,8 +590,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='libffi'
 PACKAGE_TARNAME='libffi'
 # Identity of this package.
 PACKAGE_NAME='libffi'
 PACKAGE_TARNAME='libffi'
-PACKAGE_VERSION='3.0.12-rc3'
-PACKAGE_STRING='libffi 3.0.12-rc3'
+PACKAGE_VERSION='3.0.12'
+PACKAGE_STRING='libffi 3.0.12'
 PACKAGE_BUGREPORT='http://github.com/atgreen/libffi/issues'
 PACKAGE_URL=''
 
 PACKAGE_BUGREPORT='http://github.com/atgreen/libffi/issues'
 PACKAGE_URL=''
 
@@ -1405,7 +1405,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures libffi 3.0.12-rc3 to adapt to many kinds of systems.
+\`configure' configures libffi 3.0.12 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1476,7 +1476,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of libffi 3.0.12-rc3:";;
+     short | recursive ) echo "Configuration of libffi 3.0.12:";;
    esac
   cat <<\_ACEOF
 
    esac
   cat <<\_ACEOF
 
@@ -1596,7 +1596,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-libffi configure 3.0.12-rc3
+libffi configure 3.0.12
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2202,7 +2202,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by libffi $as_me 3.0.12-rc3, which was
+It was created by libffi $as_me 3.0.12, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -3245,7 +3245,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='libffi'
 
 # Define the identity of the package.
  PACKAGE='libffi'
- VERSION='3.0.12-rc3'
+ VERSION='3.0.12'
 
 
 cat >>confdefs.h <<_ACEOF
 
 
 cat >>confdefs.h <<_ACEOF
@@ -13415,6 +13415,10 @@ case "$host" in
        TARGET=MICROBLAZE; TARGETDIR=microblaze
        ;;
 
        TARGET=MICROBLAZE; TARGETDIR=microblaze
        ;;
 
+  moxie-*-*)
+       TARGET=MOXIE; TARGETDIR=moxie
+       ;;
+
   mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*)
        TARGET=MIPS; TARGETDIR=mips
        ;;
   mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*)
        TARGET=MIPS; TARGETDIR=mips
        ;;
@@ -15527,7 +15531,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by libffi $as_me 3.0.12-rc3, which was
+This file was extended by libffi $as_me 3.0.12, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -15597,7 +15601,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-libffi config.status 3.0.12-rc3
+libffi config.status 3.0.12
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
index c3cd132..428d938 100644 (file)
@@ -2,7 +2,7 @@ dnl Process this with autoconf to create configure
 
 AC_PREREQ(2.68)
 
 
 AC_PREREQ(2.68)
 
-AC_INIT([libffi], [3.0.12-rc3], [http://github.com/atgreen/libffi/issues])
+AC_INIT([libffi], [3.0.12], [http://github.com/atgreen/libffi/issues])
 AC_CONFIG_HEADERS([fficonfig.h])
 
 AC_CANONICAL_SYSTEM
 AC_CONFIG_HEADERS([fficonfig.h])
 
 AC_CANONICAL_SYSTEM
@@ -195,6 +195,10 @@ case "$host" in
        TARGET=MICROBLAZE; TARGETDIR=microblaze
        ;;
 
        TARGET=MICROBLAZE; TARGETDIR=microblaze
        ;;
 
+  moxie-*-*)
+       TARGET=MOXIE; TARGETDIR=moxie
+       ;;
+
   mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*)
        TARGET=MIPS; TARGETDIR=mips
        ;;
   mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*)
        TARGET=MIPS; TARGETDIR=mips
        ;;
index 883a8ff..766fbac 100644 (file)
@@ -1,4 +1,4 @@
 @set UPDATED 6 February 2013
 @set UPDATED-MONTH February 2013
 @set UPDATED 6 February 2013
 @set UPDATED-MONTH February 2013
-@set EDITION 3.0.12-rc3
-@set VERSION 3.0.12-rc3
+@set EDITION 3.0.12
+@set VERSION 3.0.12
index 883a8ff..766fbac 100644 (file)
@@ -1,4 +1,4 @@
 @set UPDATED 6 February 2013
 @set UPDATED-MONTH February 2013
 @set UPDATED 6 February 2013
 @set UPDATED-MONTH February 2013
-@set EDITION 3.0.12-rc3
-@set VERSION 3.0.12-rc3
+@set EDITION 3.0.12
+@set VERSION 3.0.12
index 7e2143b..ac7aceb 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------
 /* -----------------------------------------------------------------------
-   eabi.S - Copyright (c) 2012  Anthony Green
+   eabi.S - Copyright (c) 2012, 2013  Anthony Green
    
    Moxie Assembly glue.
 
    
    Moxie Assembly glue.
 
        # $r4 :   ecif.rvalue
        # $r5 :   fn
        
        # $r4 :   ecif.rvalue
        # $r5 :   fn
        
-ffi_call_EABI: 
+ffi_call_EABI:
+       push    $sp, $r6
+       push    $sp, $r7
+       push    $sp, $r8
        dec     $sp, 24
 
        /* Store incoming args on stack.  */
        dec     $sp, 24
 
        /* Store incoming args on stack.  */
-       sto.l   0($sp), $r0
-       sto.l   4($sp), $r1
-       sto.l   8($sp), $r2
-       sto.l   12($sp), $r3
-       sto.l   16($sp), $r4
-       sto.l   20($sp), $r5
+       sto.l   0($sp), $r0 /* ffi_prep_args */
+       sto.l   4($sp), $r1 /* ecif */
+       sto.l   8($sp), $r2 /* bytes */
+       sto.l   12($sp), $r3 /* flags */
+       sto.l   16($sp), $r4 /* &rvalue */
+       sto.l   20($sp), $r5 /* fn */
        
        /* Call ffi_prep_args.  */
        
        /* Call ffi_prep_args.  */
-       jsr     $r0
+       mov     $r6, $r4 /* Save result buffer */
+       mov     $r7, $r5 /* Save the target fn */
+       mov     $r8, $r3 /* Save the flags */
+       sub.l   $sp, $r2 /* Allocate stack space */
+       mov     $r0, $sp /* We can stomp over $r0 */
+       /* $r1 is already set up */
+       jsra    ffi_prep_args
 
 
+       /* Load register arguments.  */
+       ldo.l   $r0, 0($sp)
+       ldo.l   $r1, 4($sp)
+       ldo.l   $r2, 8($sp)
+       ldo.l   $r3, 12($sp)
+       ldo.l   $r4, 16($sp)
+       ldo.l   $r5, 20($sp)
+       
        /* Call the target function.  */
        /* Call the target function.  */
-       jsr     $r5
+       jsr     $r7
+
+       ldi.l   $r7, 0xffffffff
+       cmp     $r8, $r7
+       beq     retstruct
+
+       ldi.l   $r7, 4
+       cmp     $r8, $r7
+       bgt     ret2reg
+
+       st.l    ($r6), $r0
+       jmpa    retdone
+
+ret2reg:       
+       st.l    ($r6), $r0
+       sto.l   4($r6), $r1
 
 
+retstruct:
+retdone:       
        /* Return.  */
        /* Return.  */
+       ldo.l   $r6, -4($fp)
+       ldo.l   $r7, -8($fp)
+       ldo.l   $r8, -12($fp)
        ret
        .size ffi_call_EABI, .-ffi_call_EABI
        
        ret
        .size ffi_call_EABI, .-ffi_call_EABI
        
index 11abb00..540a042 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------
 /* -----------------------------------------------------------------------
-   ffi.c - Copyright (C) 2012  Anthony Green
+   ffi.c - Copyright (C) 2012, 2013  Anthony Green
    
    Moxie Foreign Function Interface 
 
    
    Moxie Foreign Function Interface 
 
@@ -43,6 +43,12 @@ void *ffi_prep_args(char *stack, extended_cif *ecif)
   p_argv = ecif->avalue;
   argp = stack;
 
   p_argv = ecif->avalue;
   argp = stack;
 
+  if (ecif->cif->rtype->type == FFI_TYPE_STRUCT)
+    {
+      *(void **) argp = ecif->rvalue;
+      argp += 4;
+    }
+
   for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types;
        (i != 0);
        i--, p_arg++)
   for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types;
        (i != 0);
        i--, p_arg++)
@@ -136,8 +142,7 @@ void ffi_call(ffi_cif *cif,
     }
   else
     ecif.rvalue = rvalue;
     }
   else
     ecif.rvalue = rvalue;
-    
-  
+
   switch (cif->abi) 
     {
     case FFI_EABI:
   switch (cif->abi) 
     {
     case FFI_EABI:
@@ -154,19 +159,25 @@ void ffi_closure_eabi (unsigned arg1, unsigned arg2, unsigned arg3,
                       unsigned arg4, unsigned arg5, unsigned arg6)
 {
   /* This function is called by a trampoline.  The trampoline stows a
                       unsigned arg4, unsigned arg5, unsigned arg6)
 {
   /* This function is called by a trampoline.  The trampoline stows a
-     pointer to the ffi_closure object in gr7.  We must save this
+     pointer to the ffi_closure object in $r7.  We must save this
      pointer in a place that will persist while we do our work.  */
      pointer in a place that will persist while we do our work.  */
-  register ffi_closure *creg __asm__ ("$r7");
+  register ffi_closure *creg __asm__ ("$r12");
   ffi_closure *closure = creg;
 
   /* Arguments that don't fit in registers are found on the stack
      at a fixed offset above the current frame pointer.  */
   register char *frame_pointer __asm__ ("$fp");
   ffi_closure *closure = creg;
 
   /* Arguments that don't fit in registers are found on the stack
      at a fixed offset above the current frame pointer.  */
   register char *frame_pointer __asm__ ("$fp");
-  char *stack_args = frame_pointer + 16;
+
+  /* Pointer to a struct return value.  */
+  void *struct_rvalue = (void *) arg1;
+
+  /* 6 words reserved for register args + 3 words from jsr */
+  char *stack_args = frame_pointer + 9*4; 
 
   /* Lay the register arguments down in a continuous chunk of memory.  */
   unsigned register_args[6] =
     { arg1, arg2, arg3, arg4, arg5, arg6 };
 
   /* Lay the register arguments down in a continuous chunk of memory.  */
   unsigned register_args[6] =
     { arg1, arg2, arg3, arg4, arg5, arg6 };
+  char *register_args_ptr = (char *) register_args;
 
   ffi_cif *cif = closure->cif;
   ffi_type **arg_types = cif->arg_types;
 
   ffi_cif *cif = closure->cif;
   ffi_type **arg_types = cif->arg_types;
@@ -174,6 +185,12 @@ void ffi_closure_eabi (unsigned arg1, unsigned arg2, unsigned arg3,
   char *ptr = (char *) register_args;
   int i;
 
   char *ptr = (char *) register_args;
   int i;
 
+  /* preserve struct type return pointer passing */
+  if ((cif->rtype != NULL) && (cif->rtype->type == FFI_TYPE_STRUCT)) {
+    ptr += 4;
+    register_args_ptr = (char *)&register_args[1];
+  }
+
   /* Find the address of each argument.  */
   for (i = 0; i < cif->nargs; i++)
     {
   /* Find the address of each argument.  */
   for (i = 0; i < cif->nargs; i++)
     {
@@ -190,6 +207,7 @@ void ffi_closure_eabi (unsigned arg1, unsigned arg2, unsigned arg3,
        case FFI_TYPE_SINT32:
        case FFI_TYPE_UINT32:
        case FFI_TYPE_FLOAT:
        case FFI_TYPE_SINT32:
        case FFI_TYPE_UINT32:
        case FFI_TYPE_FLOAT:
+       case FFI_TYPE_POINTER:
          avalue[i] = ptr;
          break;
        case FFI_TYPE_STRUCT:
          avalue[i] = ptr;
          break;
        case FFI_TYPE_STRUCT:
@@ -205,30 +223,21 @@ void ffi_closure_eabi (unsigned arg1, unsigned arg2, unsigned arg3,
 
       /* If we've handled more arguments than fit in registers,
         start looking at the those passed on the stack.  */
 
       /* If we've handled more arguments than fit in registers,
         start looking at the those passed on the stack.  */
-      if (ptr == ((char *)register_args + (6*4)))
+      if (ptr == &register_args[6])
        ptr = stack_args;
     }
 
   /* Invoke the closure.  */
        ptr = stack_args;
     }
 
   /* Invoke the closure.  */
-  if (cif->rtype->type == FFI_TYPE_STRUCT)
+  if (cif->rtype && (cif->rtype->type == FFI_TYPE_STRUCT))
     {
     {
-      /* The caller allocates space for the return structure, and
-       passes a pointer to this space in gr3.  Use this value directly
-       as the return value.  */
-      register void *return_struct_ptr __asm__("$r0");
-      (closure->fun) (cif, return_struct_ptr, avalue, closure->user_data);
+      (closure->fun) (cif, struct_rvalue, avalue, closure->user_data);
     }
   else
     {
       /* Allocate space for the return value and call the function.  */
       long long rvalue;
       (closure->fun) (cif, &rvalue, avalue, closure->user_data);
     }
   else
     {
       /* Allocate space for the return value and call the function.  */
       long long rvalue;
       (closure->fun) (cif, &rvalue, avalue, closure->user_data);
-
-      /* Functions return 4-byte or smaller results in gr8.  8-byte
-        values also use gr9.  We fill the both, even for small return
-        values, just to avoid a branch.  */ /*
-      asm ("ldi  @(%0, #0), gr8" : : "r" (&rvalue));
-      asm ("ldi  @(%0, #0), gr9" : : "r" (&((int *) &rvalue)[1])); */
+      asm ("mov $r12, %0\n ld.l $r0, ($r12)\n ldo.l $r1, 4($r12)" : : "r" (&rvalue));
     }
 }
 
     }
 }
 
@@ -239,18 +248,21 @@ ffi_prep_closure_loc (ffi_closure* closure,
                      void *user_data,
                      void *codeloc)
 {
                      void *user_data,
                      void *codeloc)
 {
-  unsigned int *tramp = (unsigned int *) &closure->tramp[0];
+  unsigned short *tramp = (unsigned short *) &closure->tramp[0];
   unsigned long fn = (long) ffi_closure_eabi;
   unsigned long cls = (long) codeloc;
   unsigned long fn = (long) ffi_closure_eabi;
   unsigned long cls = (long) codeloc;
-  int i;
+
+  if (cif->abi != FFI_EABI)
+    return FFI_BAD_ABI;
 
   fn = (unsigned long) ffi_closure_eabi;
 
 
   fn = (unsigned long) ffi_closure_eabi;
 
-  tramp[0] = 0x8cfc0000 + (fn  & 0xffff); /* setlos lo(fn), gr6    */
-  tramp[1] = 0x8efc0000 + (cls & 0xffff); /* setlos lo(cls), gr7   */
-  tramp[2] = 0x8cf80000 + (fn  >> 16);   /* sethi hi(fn), gr6     */
-  tramp[3] = 0x8ef80000 + (cls >> 16);    /* sethi hi(cls), gr7    */
-  tramp[4] = 0x80300006;                  /* jmpl @(gr0, gr6)      */
+  tramp[0] = 0x01e0; /* ldi.l $r7, .... */
+  tramp[1] = cls >> 16;
+  tramp[2] = cls & 0xffff;
+  tramp[3] = 0x1a00; /* jmpa .... */
+  tramp[4] = fn >> 16;
+  tramp[5] = fn & 0xffff;
 
   closure->cif = cif;
   closure->fun = fun;
 
   closure->cif = cif;
   closure->fun = fun;
index 93fae39..623e3ec 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------*-C-*-
 /* -----------------------------------------------------------------*-C-*-
-   ffitarget.h - Copyright (c) 2012 Anthony Green
+   ffitarget.h - Copyright (c) 2012, 2013  Anthony Green
    Target configuration macros for Moxie
 
    Permission is hereby granted, free of charge, to any person obtaining
    Target configuration macros for Moxie
 
    Permission is hereby granted, free of charge, to any person obtaining
@@ -35,12 +35,8 @@ typedef signed long            ffi_sarg;
 
 typedef enum ffi_abi {
   FFI_FIRST_ABI = 0,
 
 typedef enum ffi_abi {
   FFI_FIRST_ABI = 0,
-
-#ifdef MOXIE
   FFI_EABI,
   FFI_DEFAULT_ABI = FFI_EABI,
   FFI_EABI,
   FFI_DEFAULT_ABI = FFI_EABI,
-#endif
-
   FFI_LAST_ABI = FFI_DEFAULT_ABI + 1
 } ffi_abi;
 #endif
   FFI_LAST_ABI = FFI_DEFAULT_ABI + 1
 } ffi_abi;
 #endif
@@ -50,7 +46,7 @@ typedef enum ffi_abi {
 #define FFI_CLOSURES 1
 #define FFI_NATIVE_RAW_API 0
 
 #define FFI_CLOSURES 1
 #define FFI_NATIVE_RAW_API 0
 
-/* Trampolines are 5 4-byte instructions long.  */
-#define FFI_TRAMPOLINE_SIZE (5*4)
+/* Trampolines are 12-bytes long.  See ffi_prep_closure_loc.  */
+#define FFI_TRAMPOLINE_SIZE (12)
 
 #endif
 
 #endif
index 365ed95..657fe54 100644 (file)
@@ -8,6 +8,7 @@
 /* { dg-excess-errors "" { target x86_64-*-mingw* x86_64-*-cygwin* } } */
 /* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
 /* { dg-options -mlong-double-128 { target powerpc64*-*-linux* } } */
 /* { dg-excess-errors "" { target x86_64-*-mingw* x86_64-*-cygwin* } } */
 /* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
 /* { dg-options -mlong-double-128 { target powerpc64*-*-linux* } } */
+/* { dg-options -Wformat=0 { target moxie*-*-elf } } */
 /* { dg-output "" { xfail x86_64-*-mingw* x86_64-*-cygwin* } } */
 
 #include "ffitest.h"
 /* { dg-output "" { xfail x86_64-*-mingw* x86_64-*-cygwin* } } */
 
 #include "ffitest.h"
index 1aab403..fd07e50 100644 (file)
@@ -9,6 +9,7 @@
 
 static double return_dbl(double dbl)
 {
 
 static double return_dbl(double dbl)
 {
+  printf ("%f\n", dbl);
   return 2 * dbl;
 }
 int main (void)
   return 2 * dbl;
 }
 int main (void)
index d7ffd4a..a78f4e7 100644 (file)
@@ -5,6 +5,7 @@
    Originator: Jeff Sturm <jsturm@one-point.com>  */
 
 /* { dg-do run } */
    Originator: Jeff Sturm <jsturm@one-point.com>  */
 
 /* { dg-do run } */
+
 #include "ffitestcxx.h"
 
 #if defined HAVE_STDINT_H
 #include "ffitestcxx.h"
 
 #if defined HAVE_STDINT_H
index 29739cd..57191f2 100644 (file)
@@ -5,6 +5,7 @@
    Originator: Andreas Tobler <andreast@gcc.gnu.org> 20061213  */
 
 /* { dg-do run } */
    Originator: Andreas Tobler <andreast@gcc.gnu.org> 20061213  */
 
 /* { dg-do run } */
+
 #include "ffitestcxx.h"
 
 static int checking(int a __UNUSED__, short b __UNUSED__,
 #include "ffitestcxx.h"
 
 static int checking(int a __UNUSED__, short b __UNUSED__,