From 6fdb7de0fe3b7385e1fd78812ae69d9b3069d994 Mon Sep 17 00:00:00 2001 From: green Date: Sun, 22 Apr 2001 19:38:34 +0000 Subject: [PATCH] * README: Update some comments. * Makefile.am (SUBDIRS): Add include so ffi.h gets installed. * Makefile.in: Rebuilt. * include/ffi.h: Change ALPHA to __alpha__ and SPARC to __sparc__. * types.c: Ditto. * prep_cif.c (ffi_prep_cif): Ditto. * alpha/ffi.c, alpha/osf.S, sparc/ffi.c, sparc/v8.S, sparc/v9.S: Include ffi_private.h. * include/ffi_private.h (FFI_TYPE_LAST): Define. --- libffi/ChangeLog | 22 +++++++++ libffi/Makefile.am | 4 +- libffi/Makefile.in | 6 +-- libffi/README | 22 +++++---- libffi/alpha/ffi.c | 1 + libffi/alpha/osf.S | 3 +- libffi/ffitest.c | 4 +- libffi/include/Makefile.am | 7 +-- libffi/include/Makefile.in | 89 ++++++++++++++++++++++-------------- libffi/include/ffi.h | 10 +--- libffi/include/ffi_private.h | 1 + libffi/prep_cif.c | 4 +- libffi/sparc/ffi.c | 1 + libffi/sparc/v8.S | 3 +- libffi/sparc/v9.S | 5 +- libffi/types.c | 2 +- 16 files changed, 113 insertions(+), 71 deletions(-) diff --git a/libffi/ChangeLog b/libffi/ChangeLog index e8c12872..b58d0fb3 100644 --- a/libffi/ChangeLog +++ b/libffi/ChangeLog @@ -1,3 +1,25 @@ +Sun Apr 22 12:37:44 2001 Anthony Green + + * README: Update some comments. + + * Makefile.am (SUBDIRS): Add include so ffi.h gets installed. + * Makefile.in: Rebuilt. + + * include/ffi.h: Change ALPHA to __alpha__ and SPARC to __sparc__. + * types.c: Ditto. + * prep_cif.c (ffi_prep_cif): Ditto. + + * alpha/ffi.c, alpha/osf.S, sparc/ffi.c, sparc/v8.S, sparc/v9.S: + Include ffi_private.h. + + * include/ffi_private.h (FFI_TYPE_LAST): Define. + +Sun Apr 22 11:41:55 2001 Anthony Green + + * Revolutionary changes. Target independent ffi.h. dejagnu + testing infrastructure. Moved source files around. Configure no + longer depends on run tests. + Sat Apr 14 20:49:46 2001 Anthony Green * mips/ffi.c: Include mips/mips.h. diff --git a/libffi/Makefile.am b/libffi/Makefile.am index 8cd8b612..f46f4c5c 100644 --- a/libffi/Makefile.am +++ b/libffi/Makefile.am @@ -3,7 +3,9 @@ AUTOMAKE_OPTIONS = foreign no-installinfo if TESTSUBDIR -SUBDIRS = testsuite +SUBDIRS = include testsuite +else +SUBDIRS = include endif EXTRA_DIST = LICENSE README ChangeLog.v1 alpha/ffi.c arm/ffi.c \ diff --git a/libffi/Makefile.in b/libffi/Makefile.in index 2c38f9ce..60a547b6 100644 --- a/libffi/Makefile.in +++ b/libffi/Makefile.in @@ -80,8 +80,8 @@ VERSION = @VERSION@ libffi_basedir = @libffi_basedir@ AUTOMAKE_OPTIONS = foreign no-installinfo - -@TESTSUBDIR_TRUE@SUBDIRS = testsuite +@TESTSUBDIR_TRUE@SUBDIRS = include testsuite +@TESTSUBDIR_FALSE@SUBDIRS = include EXTRA_DIST = LICENSE README ChangeLog.v1 alpha/ffi.c arm/ffi.c ia64/ffi.c m68k/ffi.c mips/ffi.c powerpc/ffi.c s390/ffi.c sparc/ffi.c x86/ffi.c alpha/osf.S arm/sysv.S ia64/unix.S m68k/sysv.S mips/n32.S mips/o32.S powerpc/sysv.S s390/sysv.S sparc/v8.S sparc/v9.S x86/win32.S x86/sysv.S @@ -137,7 +137,7 @@ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = gtar GZIP_ENV = --best -DIST_SUBDIRS = testsuite +DIST_SUBDIRS = include testsuite include DEP_FILES = .deps/debug.P .deps/java_raw_api.P .deps/prep_cif.P \ .deps/raw_api.P .deps/t-asm.P .deps/t-ffi.P .deps/types.P SOURCES = $(libffi_la_SOURCES) diff --git a/libffi/README b/libffi/README index 3e9154f9..05b0046b 100644 --- a/libffi/README +++ b/libffi/README @@ -63,7 +63,7 @@ Libffi has been ported to: Sparc, 64-bit - Linux (Sparc v9) -Libffi has been tested with GCC 2.95 and newer compilers. +Libffi has been tested with GCC 3.00 and newer compilers. You must use GNU make to build libffi. @@ -379,18 +379,20 @@ single-precision anyway. This causes one test to fail (the `many arguments' test). -What's With The Crazy Comments? -=============================== - -You might notice a number of cryptic comments in the code, delimited -by /*@ and @*/. These are annotations read by the program LCLint, a -tool for statically checking C programs. You can read all about it at -. - - History ======= +2.00 ???-??-01 + + Many configure improvements. No more run tests required at + configure time so cross compiling should work well. ffi.h is + target independent now and may be installed safely anywhere. + ffitest replaced with dejagnu testing infrastructure. s390 + port from ????. ia64 port from Hans Boehm. General + performance improvements. Closures designed and implemented + by Kresten Krab Thorup and ported to ia64 and powerpc by Hans + Boehm and ???? respectively. + 1.20 Oct-5-98 Raffaele Sena produces ARM port. diff --git a/libffi/alpha/ffi.c b/libffi/alpha/ffi.c index a0becb3b..94bd6bc1 100644 --- a/libffi/alpha/ffi.c +++ b/libffi/alpha/ffi.c @@ -24,6 +24,7 @@ ----------------------------------------------------------------------- */ #include +#include #include #include diff --git a/libffi/alpha/osf.S b/libffi/alpha/osf.S index b3dc477f..6ede1aa1 100644 --- a/libffi/alpha/osf.S +++ b/libffi/alpha/osf.S @@ -25,7 +25,8 @@ #define LIBFFI_ASM #include - +#include + .arch ev6 .text diff --git a/libffi/ffitest.c b/libffi/ffitest.c index 2489a719..70fecb1c 100644 --- a/libffi/ffitest.c +++ b/libffi/ffitest.c @@ -28,7 +28,7 @@ #include /* This is lame. Long double support is barely there under SunOS 4.x */ -#if defined(SPARC) && (SIZEOF_LONG_DOUBLE != 16) +#if defined(__sparc__) && (SIZEOF_LONG_DOUBLE != 16) #define BROKEN_LONG_DOUBLE #endif @@ -222,7 +222,7 @@ int main(/*@unused@*/ int argc, /*@unused@*/ char *argv[]) signed int si1; signed int si2; -#if defined(ALPHA) || defined(IA64) || defined(SPARC64) || (defined(__mips__) && (_MIPS_SIM == _ABIN32)) +#if defined(__alpha__) || defined(IA64) || defined(SPARC64) || (defined(__mips__) && (_MIPS_SIM == _ABIN32)) long long rint; #else int rint; diff --git a/libffi/include/Makefile.am b/libffi/include/Makefile.am index 74fd5a66..43077275 100644 --- a/libffi/include/Makefile.am +++ b/libffi/include/Makefile.am @@ -2,8 +2,5 @@ AUTOMAKE_OPTIONS = foreign -EXTRA_DIST = ffi.h.in ffi_common.h ffi_mips.h - -hackdir=$(includedir) - -hack_DATA=fficonfig.h ffi.h ffi_mips.h \ No newline at end of file +noinst_HEADERS=ffi_common.h ffi_private.h +include_HEADERS=ffi.h diff --git a/libffi/include/Makefile.in b/libffi/include/Makefile.in index 8c211087..4223d629 100644 --- a/libffi/include/Makefile.in +++ b/libffi/include/Makefile.in @@ -81,15 +81,12 @@ libffi_basedir = @libffi_basedir@ AUTOMAKE_OPTIONS = foreign -EXTRA_DIST = ffi.h.in ffi_common.h ffi_mips.h - -hackdir = $(includedir) - -hack_DATA = fficonfig.h ffi.h ffi_mips.h +noinst_HEADERS = ffi_common.h ffi_private.h +include_HEADERS = ffi.h mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../fficonfig.h CONFIG_CLEAN_FILES = -DATA = $(hack_DATA) +HEADERS = $(include_HEADERS) $(noinst_HEADERS) DIST_COMMON = Makefile.am Makefile.in @@ -108,27 +105,49 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status -install-hackDATA: $(hack_DATA) +install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(hackdir) - @list='$(hack_DATA)'; for p in $$list; do \ - if test -f $(srcdir)/$$p; then \ - echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(hackdir)/$$p"; \ - $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(hackdir)/$$p; \ - else if test -f $$p; then \ - echo " $(INSTALL_DATA) $$p $(DESTDIR)$(hackdir)/$$p"; \ - $(INSTALL_DATA) $$p $(DESTDIR)$(hackdir)/$$p; \ - fi; fi; \ + $(mkinstalldirs) $(DESTDIR)$(includedir) + @list='$(include_HEADERS)'; for p in $$list; do \ + if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \ + echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(includedir)/$$p"; \ + $(INSTALL_DATA) $$d$$p $(DESTDIR)$(includedir)/$$p; \ done -uninstall-hackDATA: +uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) - list='$(hack_DATA)'; for p in $$list; do \ - rm -f $(DESTDIR)$(hackdir)/$$p; \ + list='$(include_HEADERS)'; for p in $$list; do \ + rm -f $(DESTDIR)$(includedir)/$$p; \ done -tags: TAGS -TAGS: +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) @@ -161,20 +180,20 @@ installcheck: installcheck-am install-exec-am: install-exec: install-exec-am -install-data-am: install-hackDATA +install-data-am: install-includeHEADERS install-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am -uninstall-am: uninstall-hackDATA +uninstall-am: uninstall-includeHEADERS uninstall: uninstall-am -all-am: Makefile $(DATA) +all-am: Makefile $(HEADERS) all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: - $(mkinstalldirs) $(DESTDIR)$(hackdir) + $(mkinstalldirs) $(DESTDIR)$(includedir) mostlyclean-generic: @@ -186,30 +205,32 @@ distclean-generic: -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: -mostlyclean-am: mostlyclean-generic +mostlyclean-am: mostlyclean-tags mostlyclean-generic mostlyclean: mostlyclean-am -clean-am: clean-generic mostlyclean-am +clean-am: clean-tags clean-generic mostlyclean-am clean: clean-am -distclean-am: distclean-generic clean-am +distclean-am: distclean-tags distclean-generic clean-am -rm -f libtool distclean: distclean-am -maintainer-clean-am: maintainer-clean-generic distclean-am +maintainer-clean-am: maintainer-clean-tags maintainer-clean-generic \ + distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." maintainer-clean: maintainer-clean-am -.PHONY: uninstall-hackDATA install-hackDATA tags distdir info-am info \ -dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ -install-exec install-data-am install-data install-am install \ -uninstall-am uninstall all-redirect all-am all installdirs \ -mostlyclean-generic distclean-generic clean-generic \ +.PHONY: uninstall-includeHEADERS install-includeHEADERS tags \ +mostlyclean-tags distclean-tags clean-tags maintainer-clean-tags \ +distdir info-am info dvi-am dvi check check-am installcheck-am \ +installcheck install-exec-am install-exec install-data-am install-data \ +install-am install uninstall-am uninstall all-redirect all-am all \ +installdirs mostlyclean-generic distclean-generic clean-generic \ maintainer-clean-generic clean mostlyclean distclean maintainer-clean diff --git a/libffi/include/ffi.h b/libffi/include/ffi.h index e63cfc04..1ad4acf1 100644 --- a/libffi/include/ffi.h +++ b/libffi/include/ffi.h @@ -67,14 +67,6 @@ extern "C" { #endif #endif -/* ---- System specific configurations ----------------------------------- */ - -#ifdef SPARC -#if defined(__arch64__) || defined(__sparcv9) -#define SPARC64 -#endif -#endif - #ifndef LIBFFI_ASM /* ---- Generic type definitions ----------------------------------------- */ @@ -299,7 +291,7 @@ struct ffi_ia64_trampoline_struct { }; #define FFI_NATIVE_RAW_API 0 -#elif defined(ALPHA) +#elif defined(__alpha__) #define FFI_CLOSURES 1 #define FFI_TRAMPOLINE_SIZE 24 diff --git a/libffi/include/ffi_private.h b/libffi/include/ffi_private.h index 763143aa..59644b9e 100644 --- a/libffi/include/ffi_private.h +++ b/libffi/include/ffi_private.h @@ -111,6 +111,7 @@ #define FFI_TYPE_SINT64 12 #define FFI_TYPE_STRUCT 13 /* If this changes, update ffi_mips.h. */ #define FFI_TYPE_POINTER 14 +#define FFI_TYPE_LAST 14 #if _MIPS_SIM==_ABIN32 && defined(_ABIN32) #define SIZEOF_ARG 8 diff --git a/libffi/prep_cif.c b/libffi/prep_cif.c index a15d676f..5e97a184 100644 --- a/libffi/prep_cif.c +++ b/libffi/prep_cif.c @@ -107,7 +107,7 @@ ffi_status ffi_prep_cif(/*@out@*/ /*@partial@*/ ffi_cif *cif, #ifndef M68K /* Make space for the return structure pointer */ if (cif->rtype->type == FFI_TYPE_STRUCT -#ifdef SPARC +#ifdef __sparc__ && (cif->abi != FFI_V9 || cif->rtype->size > 32) #endif ) @@ -123,7 +123,7 @@ ffi_status ffi_prep_cif(/*@out@*/ /*@partial@*/ ffi_cif *cif, if (((*ptr)->size == 0) && (initialize_aggregate((*ptr)) != FFI_OK)) return FFI_BAD_TYPEDEF; -#ifdef SPARC +#ifdef __sparc__ if (((*ptr)->type == FFI_TYPE_STRUCT && ((*ptr)->size > 16 || cif->abi != FFI_V9)) || ((*ptr)->type == FFI_TYPE_LONGDOUBLE diff --git a/libffi/sparc/ffi.c b/libffi/sparc/ffi.c index f557013a..65e295ba 100644 --- a/libffi/sparc/ffi.c +++ b/libffi/sparc/ffi.c @@ -24,6 +24,7 @@ ----------------------------------------------------------------------- */ #include +#include #include #include diff --git a/libffi/sparc/v8.S b/libffi/sparc/v8.S index 0357f4de..3f29dce9 100644 --- a/libffi/sparc/v8.S +++ b/libffi/sparc/v8.S @@ -25,7 +25,8 @@ #define LIBFFI_ASM #include - +#include + #define STACKFRAME 96 /* Minimum stack framesize for SPARC */ #define ARGS (64+4) /* Offset of register area in frame */ diff --git a/libffi/sparc/v9.S b/libffi/sparc/v9.S index c937f439..f7e44c15 100644 --- a/libffi/sparc/v9.S +++ b/libffi/sparc/v9.S @@ -25,8 +25,9 @@ #define LIBFFI_ASM #include - -#ifdef SPARC64 +#include + +#if defined(__arch64__) || defined(__sparcv9) /* Only compile this in for 64bit builds, because otherwise the object file will have inproper architecture due to used instructions. */ diff --git a/libffi/types.c b/libffi/types.c index 76aff40b..d1eb0896 100644 --- a/libffi/types.c +++ b/libffi/types.c @@ -43,7 +43,7 @@ FFI_INTEGRAL_TYPEDEF(uint32, 4, 4, FFI_TYPE_UINT32); FFI_INTEGRAL_TYPEDEF(sint32, 4, 4, FFI_TYPE_SINT32); FFI_INTEGRAL_TYPEDEF(float, 4, 4, FFI_TYPE_FLOAT); -#if defined ALPHA || defined SPARC64 +#if defined __alpha__ || defined SPARC64 FFI_INTEGRAL_TYPEDEF(pointer, 8, 8, FFI_TYPE_POINTER);