diff --git a/libffi/ChangeLog b/libffi/ChangeLog index 7d553b7fede..5d51e0cd622 100644 --- a/libffi/ChangeLog +++ b/libffi/ChangeLog @@ -1,3 +1,78 @@ +2003-10-21 Andreas Tobler + + * configure.in: AC_LINK_FILES(ffitarget.h). + * configure: Regenerate. + * Makefile.in: Likewise. + * include/Makefile.in: Likewise. + * testsuite/Makefile.in: Likewise. + * fficonfig.h.in: Likewise. + +2003-10-21 Paolo Bonzini + Richard Henderson + + Avoid that ffi.h includes fficonfig.h. + + * Makefile.am (EXTRA_DIST): Include ffitarget.h files + (TARGET_SRC_MIPS_GCC): Renamed to TARGET_SRC_MIPS_IRIX. + (TARGET_SRC_MIPS_SGI): Removed. + (MIPS_GCC): Renamed to TARGET_SRC_MIPS_IRIX. + (MIPS_SGI): Removed. + (CLEANFILES): Removed. + (mostlyclean-am, clean-am, mostlyclean-sub, clean-sub): New + targets. + * acconfig.h: Removed. + * configure.in: Compute sizeofs only for double and long double. + Use them to define and subst HAVE_LONG_DOUBLE. Include comments + into AC_DEFINE instead of using acconfig.h. Create + include/ffitarget.h instead of include/fficonfig.h. Rename + MIPS_GCC to MIPS_IRIX, drop MIPS_SGI since we are in gcc's tree. + AC_DEFINE EH_FRAME_FLAGS. + * include/Makefile.am (DISTCLEANFILES): New automake macro. + (hack_DATA): Add ffitarget.h. + * include/ffi.h.in: Remove all system specific definitions. + Declare raw API even if it is not installed, why bother? + Use limits.h instead of SIZEOF_* to define ffi_type_*. Do + not define EH_FRAME_FLAGS, it is in fficonfig.h now. Include + ffitarget.h instead of fficonfig.h. Remove ALIGN macro. + (UINT_ARG, INT_ARG): Removed, use ffi_arg and ffi_sarg instead. + * include/ffi_common.h (bool): Do not define. + (ffi_assert): Accept failed assertion. + (ffi_type_test): Return void and accept file/line. + (FFI_ASSERT): Pass stringized failed assertion. + (FFI_ASSERT_AT): New macro. + (FFI_ASSERT_VALID_TYPE): New macro. + (UINT8, SINT8, UINT16, SINT16, UINT32, SINT32, + UINT64, SINT64): Define here with gcc's __attribute__ macro + instead of in ffi.h + (FLOAT32, ALIGN): Define here instead of in ffi.h + * include/ffi-mips.h: Removed. Its content moved to + src/mips/ffitarget.h after separating assembly and C sections. + * src/alpha/ffi.c, src/alpha/ffi.c, src/java_raw_api.c + src/prep_cif.c, src/raw_api.c, src/ia64/ffi.c, + src/mips/ffi.c, src/mips/n32.S, src/mips/o32.S, + src/mips/ffitarget.h, src/sparc/ffi.c, src/x86/ffi64.c: + SIZEOF_ARG -> FFI_SIZEOF_ARG. + * src/ia64/ffi.c: Include stdbool.h (provided by GCC 2.95+). + * src/debug.c (ffi_assert): Accept stringized failed assertion. + (ffi_type_test): Rewritten. + * src/prep-cif.c (initialize_aggregate, ffi_prep_cif): Call + FFI_ASSERT_VALID_TYPE. + * src/alpha/ffitarget.h, src/arm/ffitarget.h, + src/ia64/ffitarget.h, src/m68k/ffitarget.h, + src/mips/ffitarget.h, src/powerpc/ffitarget.h, + src/s390/ffitarget.h, src/sh/ffitarget.h, + src/sh64/ffitarget.h, src/sparc/ffitarget.h, + src/x86/ffitarget.h: New files. + * src/alpha/osf.S, src/arm/sysv.S, src/ia64/unix.S, + src/m68k/sysv.S, src/mips/n32.S, src/mips/o32.S, + src/powerpc/aix.S, src/powerpc/darwin.S, + src/powerpc/ffi_darwin.c, src/powerpc/linux64.S, + src/powerpc/linux64_closure.S, src/powerpc/ppc_closure.S, + src/powerpc/sysv.S, src/s390/sysv.S, src/sh/sysv.S, + src/sh64/sysv.S, src/sparc/v8.S, src/sparc/v9.S, + src/x86/sysv.S, src/x86/unix64.S, src/x86/win32.S: + include fficonfig.h + 2003-10-20 Rainer Orth * src/mips/ffi.c: Use _ABIN32, _ABIO32 instead of external diff --git a/libffi/LICENSE b/libffi/LICENSE index f8f54a04faf..f591795152d 100644 --- a/libffi/LICENSE +++ b/libffi/LICENSE @@ -1,4 +1,4 @@ -libffi - Copyright (c) 1996-1999 Cygnus Solutions +libffi - Copyright (c) 1996-2003 Red Hat, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/libffi/Makefile.am b/libffi/Makefile.am index cb05ea6d1a4..b599865e915 100644 --- a/libffi/Makefile.am +++ b/libffi/Makefile.am @@ -4,24 +4,26 @@ AUTOMAKE_OPTIONS = cygnus SUBDIRS = include testsuite +EXTRA_DIST = LICENSE ChangeLog.v1 \ + src/alpha/ffi.c src/alpha/osf.S src/alpha/ffitarget.h \ + src/arm/ffi.c src/arm/sysv.S src/arm/ffitarget.h \ + src/mips/ffi.c src/mips/n32.S src/mips/o32.S \ + src/mips/ffitarget.h \ + src/m68k/ffi.c src/m68k/sysv.S src/m68k/ffitarget.h \ + src/powerpc/ffi.c src/powerpc/sysv.S \ + src/powerpc/linux64.S src/powerpc/linux64_closure.S \ + src/powerpc/ppc_closure.S src/powerpc/asm.h \ + src/powerpc/aix.S src/powerpc/darwin.S \ + src/powerpc/aix_closure.S src/powerpc/darwin_closure.S \ + src/powerpc/ffi_darwin.c src/powerpc/ffitarget.h \ + src/s390/ffi.c src/s390/sysv.S src/s390/ffitarget.h \ + src/sh/ffi.c src/sh/sysv.S src/sh/ffitarget.h \ + src/sh64/ffi.c src/sh64/sysv.S src/sh64/ffitarget.h \ + src/sparc/v8.S src/sparc/v9.S src/sparc/ffitarget.h \ + src/sparc/ffi.c \ + src/x86/ffi.c src/x86/sysv.S src/x86/win32.S \ + src/x86/ffi64.c src/x86/unix64.S src/x86/ffitarget.h -EXTRA_DIST = LICENSE ChangeLog.v1 src/mips/ffi.c src/mips/n32.S \ - src/mips/n32.s src/mips/o32.S src/mips/o32.s \ - src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S \ - src/x86/ffi.c src/x86/sysv.S src/x86/win32.S \ - src/x86/ffi64.c src/x86/unix64.S \ - src/alpha/ffi.c src/alpha/osf.S \ - src/m68k/ffi.c src/m68k/sysv.S \ - src/powerpc/ffi.c src/powerpc/sysv.S \ - src/powerpc/linux64.S src/powerpc/linux64_closure.S \ - src/powerpc/ppc_closure.S src/powerpc/asm.h \ - src/powerpc/ffi_darwin.c \ - src/powerpc/darwin.S src/powerpc/aix.S \ - src/powerpc/darwin_closure.S src/powerpc/aix_closure.S \ - src/arm/ffi.c src/arm/sysv.S \ - src/s390/ffi.c src/s390/sysv.S \ - src/sh/ffi.c src/sh/sysv.S \ - src/sh64/ffi.c src/sh64/sysv.S VPATH = @srcdir@:@srcdir@/src:@srcdir@/src/@TARGETDIR@ @@ -85,9 +87,8 @@ noinst_LTLIBRARIES = libffi_convenience.la -TARGET_SRC_MIPS_GCC = src/mips/ffi.c src/mips/o32.S src/mips/n32.S +TARGET_SRC_MIPS_IRIX = src/mips/ffi.c src/mips/o32.S src/mips/n32.S TARGET_SRC_MIPS_LINUX = src/mips/ffi.c src/mips/o32.S -TARGET_SRC_MIPS_SGI = src/mips/ffi.c src/mips/o32.s src/mips/n32.s TARGET_SRC_X86 = src/x86/ffi.c src/x86/sysv.S TARGET_SRC_X86_WIN32 = src/x86/ffi.c src/x86/win32.S TARGET_SRC_SPARC = src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S @@ -107,18 +108,14 @@ TARGET_SRC_SH64 = src/sh64/sysv.S src/sh64/ffi.c ## Work around automake deficiency libffi_la_common_SOURCES = src/debug.c src/prep_cif.c src/types.c \ src/raw_api.c src/java_raw_api.c -if MIPS_GCC -libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC) -libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC) +if MIPS_IRIX +libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_IRIX) +libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_IRIX) endif if MIPS_LINUX libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX) libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX) endif -if MIPS_SGI -libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI) -libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI) -endif if X86 libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_X86) libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_X86) @@ -180,7 +177,7 @@ AM_CFLAGS = -Wall -g -fexceptions libffi_la_LDFLAGS = -release $(VERSION) -INCLUDES = -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src +INCLUDES = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src # Override these rules so that object files get put in the correct # subdirectories. @@ -229,7 +226,15 @@ maintainer-clean-multi: ## ################################################################ -CLEANFILES = $(libffi_convenience_la_OBJECTS) \ - $(libffi_la_OBJECTS) \ - $(libffi_convenience_la_OBJECTS:.lo=.o) \ - $(libffi_la_OBJECTS:.lo=.o) +# Our hacked automake doesn't clean subdirectories properly. +mostlyclean-am: mostlyclean-sub +mostlyclean-sub: + -rm -f src/*.o src/*.lo + -rm -f src/@TARGETDIR@/*.o src/@TARGETDIR@/*.lo + +clean-am: clean-sub +clean-sub: + -rm -rf src/.libs src/_libs + -rm -rf src/@TARGETDIR@/.libs src/@TARGETDIR@/_libs + + diff --git a/libffi/Makefile.in b/libffi/Makefile.in index 5ea0853501b..bca6caf87b2 100644 --- a/libffi/Makefile.in +++ b/libffi/Makefile.in @@ -71,6 +71,7 @@ DLLTOOL = @DLLTOOL@ EXEEXT = @EXEEXT@ GCJ = @GCJ@ GCJFLAGS = @GCJFLAGS@ +HAVE_LONG_DOUBLE = @HAVE_LONG_DOUBLE@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ MAINT = @MAINT@ @@ -92,23 +93,25 @@ AUTOMAKE_OPTIONS = cygnus SUBDIRS = include testsuite -EXTRA_DIST = LICENSE ChangeLog.v1 src/mips/ffi.c src/mips/n32.S \ - src/mips/n32.s src/mips/o32.S src/mips/o32.s \ - src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S \ - src/x86/ffi.c src/x86/sysv.S src/x86/win32.S \ - src/x86/ffi64.c src/x86/unix64.S \ - src/alpha/ffi.c src/alpha/osf.S \ - src/m68k/ffi.c src/m68k/sysv.S \ - src/powerpc/ffi.c src/powerpc/sysv.S \ - src/powerpc/linux64.S src/powerpc/linux64_closure.S \ - src/powerpc/ppc_closure.S src/powerpc/asm.h \ - src/powerpc/ffi_darwin.c \ - src/powerpc/darwin.S src/powerpc/aix.S \ - src/powerpc/darwin_closure.S src/powerpc/aix_closure.S \ - src/arm/ffi.c src/arm/sysv.S \ - src/s390/ffi.c src/s390/sysv.S \ - src/sh/ffi.c src/sh/sysv.S \ - src/sh64/ffi.c src/sh64/sysv.S +EXTRA_DIST = LICENSE ChangeLog.v1 \ + src/alpha/ffi.c src/alpha/osf.S src/alpha/ffitarget.h \ + src/arm/ffi.c src/arm/sysv.S src/arm/ffitarget.h \ + src/mips/ffi.c src/mips/n32.S src/mips/o32.S \ + src/mips/ffitarget.h \ + src/m68k/ffi.c src/m68k/sysv.S src/m68k/ffitarget.h \ + src/powerpc/ffi.c src/powerpc/sysv.S \ + src/powerpc/linux64.S src/powerpc/linux64_closure.S \ + src/powerpc/ppc_closure.S src/powerpc/asm.h \ + src/powerpc/aix.S src/powerpc/darwin.S \ + src/powerpc/aix_closure.S src/powerpc/darwin_closure.S \ + src/powerpc/ffi_darwin.c src/powerpc/ffitarget.h \ + src/s390/ffi.c src/s390/sysv.S src/s390/ffitarget.h \ + src/sh/ffi.c src/sh/sysv.S src/sh/ffitarget.h \ + src/sh64/ffi.c src/sh64/sysv.S src/sh64/ffitarget.h \ + src/sparc/v8.S src/sparc/v9.S src/sparc/ffitarget.h \ + src/sparc/ffi.c \ + src/x86/ffi.c src/x86/sysv.S src/x86/win32.S \ + src/x86/ffi64.c src/x86/unix64.S src/x86/ffitarget.h VPATH = @srcdir@:@srcdir@/src:@srcdir@/src/@TARGETDIR@ @@ -166,9 +169,8 @@ MULTICLEAN = true toolexeclib_LTLIBRARIES = libffi.la noinst_LTLIBRARIES = libffi_convenience.la -TARGET_SRC_MIPS_GCC = src/mips/ffi.c src/mips/o32.S src/mips/n32.S +TARGET_SRC_MIPS_IRIX = src/mips/ffi.c src/mips/o32.S src/mips/n32.S TARGET_SRC_MIPS_LINUX = src/mips/ffi.c src/mips/o32.S -TARGET_SRC_MIPS_SGI = src/mips/ffi.c src/mips/o32.s src/mips/n32.s TARGET_SRC_X86 = src/x86/ffi.c src/x86/sysv.S TARGET_SRC_X86_WIN32 = src/x86/ffi.c src/x86/win32.S TARGET_SRC_SPARC = src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S @@ -187,9 +189,8 @@ TARGET_SRC_SH64 = src/sh64/sysv.S src/sh64/ffi.c libffi_la_common_SOURCES = src/debug.c src/prep_cif.c src/types.c \ src/raw_api.c src/java_raw_api.c -@MIPS_GCC_TRUE@libffi_la_SOURCES = @MIPS_GCC_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC) +@MIPS_IRIX_TRUE@libffi_la_SOURCES = @MIPS_IRIX_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_IRIX) @MIPS_LINUX_TRUE@libffi_la_SOURCES = @MIPS_LINUX_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX) -@MIPS_SGI_TRUE@libffi_la_SOURCES = @MIPS_SGI_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI) @X86_TRUE@libffi_la_SOURCES = @X86_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86) @X86_WIN32_TRUE@libffi_la_SOURCES = @X86_WIN32_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86_WIN32) @SPARC_TRUE@libffi_la_SOURCES = @SPARC_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_SPARC) @@ -204,9 +205,8 @@ libffi_la_common_SOURCES = src/debug.c src/prep_cif.c src/types.c \ @X86_64_TRUE@libffi_la_SOURCES = @X86_64_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86_64) @SH_TRUE@libffi_la_SOURCES = @SH_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_SH) @SH64_TRUE@libffi_la_SOURCES = @SH64_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_SH64) -@MIPS_GCC_TRUE@libffi_convenience_la_SOURCES = @MIPS_GCC_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC) +@MIPS_IRIX_TRUE@libffi_convenience_la_SOURCES = @MIPS_IRIX_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_IRIX) @MIPS_LINUX_TRUE@libffi_convenience_la_SOURCES = @MIPS_LINUX_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX) -@MIPS_SGI_TRUE@libffi_convenience_la_SOURCES = @MIPS_SGI_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI) @X86_TRUE@libffi_convenience_la_SOURCES = @X86_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86) @X86_WIN32_TRUE@libffi_convenience_la_SOURCES = @X86_WIN32_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86_WIN32) @SPARC_TRUE@libffi_convenience_la_SOURCES = @SPARC_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_SPARC) @@ -226,13 +226,7 @@ AM_CFLAGS = -Wall -g -fexceptions libffi_la_LDFLAGS = -release $(VERSION) -INCLUDES = -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src - -CLEANFILES = $(libffi_convenience_la_OBJECTS) \ - $(libffi_la_OBJECTS) \ - $(libffi_convenience_la_OBJECTS:.lo=.o) \ - $(libffi_la_OBJECTS:.lo=.o) - +INCLUDES = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/${libffi_basedir}../mkinstalldirs CONFIG_HEADER = fficonfig.h @@ -246,10 +240,6 @@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ libffi_convenience_la_LDFLAGS = libffi_convenience_la_LIBADD = -@MIPS_GCC_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ -@MIPS_GCC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ -@MIPS_GCC_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo \ -@MIPS_GCC_TRUE@src/mips/n32.lo @X86_64_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ @X86_64_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ @X86_64_TRUE@src/java_raw_api.lo src/x86/ffi64.lo src/x86/unix64.lo \ @@ -272,44 +262,41 @@ libffi_convenience_la_LIBADD = @POWERPC_DARWIN_TRUE@src/java_raw_api.lo src/powerpc/ffi_darwin.lo \ @POWERPC_DARWIN_TRUE@src/powerpc/darwin.lo \ @POWERPC_DARWIN_TRUE@src/powerpc/darwin_closure.lo -@MIPS_SGI_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ -@MIPS_SGI_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ -@MIPS_SGI_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo \ -@MIPS_SGI_TRUE@src/mips/n32.lo @MIPS_LINUX_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ @MIPS_LINUX_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ @MIPS_LINUX_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo -@S390_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \ -@S390_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ -@S390_TRUE@src/s390/sysv.lo src/s390/ffi.lo @X86_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \ @X86_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ @X86_TRUE@src/x86/ffi.lo src/x86/sysv.lo @X86_WIN32_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ @X86_WIN32_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ @X86_WIN32_TRUE@src/java_raw_api.lo src/x86/ffi.lo src/x86/win32.lo +@S390_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \ +@S390_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ +@S390_TRUE@src/s390/sysv.lo src/s390/ffi.lo @SH64_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \ @SH64_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ @SH64_TRUE@src/sh64/sysv.lo src/sh64/ffi.lo -@ARM_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \ -@ARM_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ -@ARM_TRUE@src/arm/sysv.lo src/arm/ffi.lo +@SPARC_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ +@SPARC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ +@SPARC_TRUE@src/java_raw_api.lo src/sparc/ffi.lo src/sparc/v8.lo \ +@SPARC_TRUE@src/sparc/v9.lo @POWERPC_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ @POWERPC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ @POWERPC_TRUE@src/java_raw_api.lo src/powerpc/ffi.lo \ @POWERPC_TRUE@src/powerpc/sysv.lo src/powerpc/ppc_closure.lo \ @POWERPC_TRUE@src/powerpc/linux64.lo src/powerpc/linux64_closure.lo -@SPARC_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ -@SPARC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ -@SPARC_TRUE@src/java_raw_api.lo src/sparc/ffi.lo src/sparc/v8.lo \ -@SPARC_TRUE@src/sparc/v9.lo +@ARM_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \ +@ARM_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ +@ARM_TRUE@src/arm/sysv.lo src/arm/ffi.lo +@MIPS_IRIX_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ +@MIPS_IRIX_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ +@MIPS_IRIX_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo \ +@MIPS_IRIX_TRUE@src/mips/n32.lo @M68K_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \ @M68K_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ @M68K_TRUE@src/m68k/ffi.lo src/m68k/sysv.lo libffi_la_LIBADD = -@MIPS_GCC_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ -@MIPS_GCC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ -@MIPS_GCC_TRUE@src/mips/ffi.lo src/mips/o32.lo src/mips/n32.lo @X86_64_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ @X86_64_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ @X86_64_TRUE@src/x86/ffi64.lo src/x86/unix64.lo src/x86/ffi.lo \ @@ -331,35 +318,35 @@ libffi_la_LIBADD = @POWERPC_DARWIN_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ @POWERPC_DARWIN_TRUE@src/powerpc/ffi_darwin.lo src/powerpc/darwin.lo \ @POWERPC_DARWIN_TRUE@src/powerpc/darwin_closure.lo -@MIPS_SGI_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ -@MIPS_SGI_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ -@MIPS_SGI_TRUE@src/mips/ffi.lo src/mips/o32.lo src/mips/n32.lo @MIPS_LINUX_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ @MIPS_LINUX_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ @MIPS_LINUX_TRUE@src/mips/ffi.lo src/mips/o32.lo -@S390_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ -@S390_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ -@S390_TRUE@src/s390/sysv.lo src/s390/ffi.lo @X86_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo src/types.lo \ @X86_TRUE@src/raw_api.lo src/java_raw_api.lo src/x86/ffi.lo \ @X86_TRUE@src/x86/sysv.lo @X86_WIN32_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ @X86_WIN32_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ @X86_WIN32_TRUE@src/x86/ffi.lo src/x86/win32.lo +@S390_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ +@S390_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ +@S390_TRUE@src/s390/sysv.lo src/s390/ffi.lo @SH64_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ @SH64_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ @SH64_TRUE@src/sh64/sysv.lo src/sh64/ffi.lo -@ARM_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo src/types.lo \ -@ARM_TRUE@src/raw_api.lo src/java_raw_api.lo src/arm/sysv.lo \ -@ARM_TRUE@src/arm/ffi.lo +@SPARC_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ +@SPARC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ +@SPARC_TRUE@src/sparc/ffi.lo src/sparc/v8.lo src/sparc/v9.lo @POWERPC_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ @POWERPC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ @POWERPC_TRUE@src/powerpc/ffi.lo src/powerpc/sysv.lo \ @POWERPC_TRUE@src/powerpc/ppc_closure.lo src/powerpc/linux64.lo \ @POWERPC_TRUE@src/powerpc/linux64_closure.lo -@SPARC_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ -@SPARC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ -@SPARC_TRUE@src/sparc/ffi.lo src/sparc/v8.lo src/sparc/v9.lo +@ARM_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo src/types.lo \ +@ARM_TRUE@src/raw_api.lo src/java_raw_api.lo src/arm/sysv.lo \ +@ARM_TRUE@src/arm/ffi.lo +@MIPS_IRIX_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ +@MIPS_IRIX_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ +@MIPS_IRIX_TRUE@src/mips/ffi.lo src/mips/o32.lo src/mips/n32.lo @M68K_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ @M68K_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ @M68K_TRUE@src/m68k/ffi.lo src/m68k/sysv.lo @@ -369,8 +356,7 @@ LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $ CCLD = $(CC) LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ DIST_COMMON = README ./stamp-h.in ChangeLog Makefile.am Makefile.in \ -acconfig.h acinclude.m4 aclocal.m4 configure configure.in \ -fficonfig.h.in +acinclude.m4 aclocal.m4 configure configure.in fficonfig.h.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) @@ -413,7 +399,7 @@ $(srcdir)/fficonfig.h.in: @MAINTAINER_MODE_TRUE@$(srcdir)/stamp-h.in rm -f $(srcdir)/stamp-h.in; \ $(MAKE) $(srcdir)/stamp-h.in; \ else :; fi -$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h +$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOHEADER) @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null @@ -679,7 +665,6 @@ installdirs-am: mostlyclean-generic: clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) @@ -787,6 +772,17 @@ distclean-multi: maintainer-clean-multi: $(MULTICLEAN) $(AM_MAKEFLAGS) DO=maintainer-clean multi-clean +# Our hacked automake doesn't clean subdirectories properly. +mostlyclean-am: mostlyclean-sub +mostlyclean-sub: + -rm -f src/*.o src/*.lo + -rm -f src/@TARGETDIR@/*.o src/@TARGETDIR@/*.lo + +clean-am: clean-sub +clean-sub: + -rm -rf src/.libs src/_libs + -rm -rf src/@TARGETDIR@/.libs src/@TARGETDIR@/_libs + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/libffi/configure b/libffi/configure index b22ac700092..0ffe09c68e4 100755 --- a/libffi/configure +++ b/libffi/configure @@ -2508,7 +2508,6 @@ fi TARGETDIR="unknown" case "$host" in -mips-sgi-irix5.* | mips-sgi-irix6.*) TARGET=MIPS; TARGETDIR=mips;; i*86-*-linux*) TARGET=X86; TARGETDIR=x86;; i*86-*-solaris*) TARGET=X86; TARGETDIR=x86;; i*86-*-beos*) TARGET=X86; TARGETDIR=x86;; @@ -2525,6 +2524,7 @@ alpha*-*-linux* | alpha*-*-osf* | alpha*-*-freebsd* | alpha*-*-netbsd*) TARGET=A ia64*-*-*) TARGET=IA64; TARGETDIR=ia64;; m68k-*-linux*) TARGET=M68K; TARGETDIR=m68k;; mips64*-*);; +mips-sgi-irix5.* | mips-sgi-irix6.*) TARGET=MIPS_IRIX; TARGETDIR=mips;; mips*-*-linux*) TARGET=MIPS_LINUX; TARGETDIR=mips;; powerpc*-*-linux* | powerpc-*-sysv*) TARGET=POWERPC; TARGETDIR=powerpc;; powerpc-*-beos*) TARGET=POWERPC; TARGETDIR=powerpc;; @@ -2548,21 +2548,12 @@ fi -if test ${TARGET}${ac_cv_prog_gcc} = MIPSyes; then - MIPS_GCC_TRUE= - MIPS_GCC_FALSE='#' +if test x$TARGET = xMIPS_IRIX; then + MIPS_IRIX_TRUE= + MIPS_IRIX_FALSE='#' else - MIPS_GCC_TRUE='#' - MIPS_GCC_FALSE= -fi - - -if test ${TARGET}${ac_cv_prog_gcc} = MIPSno; then - MIPS_SGI_TRUE= - MIPS_SGI_FALSE='#' -else - MIPS_SGI_TRUE='#' - MIPS_SGI_FALSE= + MIPS_IRIX_TRUE='#' + MIPS_IRIX_FALSE= fi @@ -2700,12 +2691,13 @@ else SH64_FALSE= fi -if test x$TARGET = xMIPS_LINUX; then - TARGET=MIPS -fi +case x$TARGET in + xMIPS*) TARGET=MIPS ;; + *) ;; +esac echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:2709: checking how to run the C preprocessor" >&5 +echo "configure:2701: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -2720,13 +2712,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2730: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2722: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2737,13 +2729,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2747: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2739: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2754,13 +2746,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2764: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2756: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2785,12 +2777,12 @@ fi echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:2789: checking for ANSI C header files" >&5 +echo "configure:2781: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2798,7 +2790,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2802: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2794: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2815,7 +2807,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2833,7 +2825,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2854,7 +2846,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -2865,7 +2857,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:2869: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -2891,12 +2883,12 @@ fi for ac_func in memcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2895: checking for $ac_func" >&5 +echo "configure:2887: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2946,19 +2938,19 @@ done # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:2950: checking for working alloca.h" >&5 +echo "configure:2942: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:2962: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2954: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -2979,12 +2971,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:2983: checking for alloca" >&5 +echo "configure:2975: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3008: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -3044,12 +3036,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:3048: checking whether alloca needs Cray hooks" >&5 +echo "configure:3040: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3078: checking for $ac_func" >&5 +echo "configure:3070: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3098: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3129,7 +3121,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:3133: checking stack direction for C alloca" >&5 +echo "configure:3125: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3137,7 +3129,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3152: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -3178,209 +3170,14 @@ EOF fi -echo $ac_n "checking size of short""... $ac_c" 1>&6 -echo "configure:3183: checking size of short" >&5 -if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. - cat > conftest.$ac_ext < - - -int main() { -switch (0) case 0: case (sizeof (short) == $ac_size):; -; return 0; } -EOF -if { (eval echo configure:3199: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_sizeof_short=$ac_size -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 -fi -rm -f conftest* - if test x$ac_cv_sizeof_short != x ; then break; fi -done - -fi - -if test x$ac_cv_sizeof_short = x ; then - { echo "configure: error: cannot determine a size for short" 1>&2; exit 1; } -fi -echo "$ac_t""$ac_cv_sizeof_short" 1>&6 -cat >> confdefs.h <&6 -echo "configure:3222: checking size of int" >&5 -if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. - cat > conftest.$ac_ext < - - -int main() { -switch (0) case 0: case (sizeof (int) == $ac_size):; -; return 0; } -EOF -if { (eval echo configure:3238: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_sizeof_int=$ac_size -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 -fi -rm -f conftest* - if test x$ac_cv_sizeof_int != x ; then break; fi -done - -fi - -if test x$ac_cv_sizeof_int = x ; then - { echo "configure: error: cannot determine a size for int" 1>&2; exit 1; } -fi -echo "$ac_t""$ac_cv_sizeof_int" 1>&6 -cat >> confdefs.h <&6 -echo "configure:3261: checking size of long" >&5 -if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. - cat > conftest.$ac_ext < - - -int main() { -switch (0) case 0: case (sizeof (long) == $ac_size):; -; return 0; } -EOF -if { (eval echo configure:3277: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_sizeof_long=$ac_size -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 -fi -rm -f conftest* - if test x$ac_cv_sizeof_long != x ; then break; fi -done - -fi - -if test x$ac_cv_sizeof_long = x ; then - { echo "configure: error: cannot determine a size for long" 1>&2; exit 1; } -fi -echo "$ac_t""$ac_cv_sizeof_long" 1>&6 -cat >> confdefs.h <&6 -echo "configure:3300: checking size of long long" >&5 -if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. - cat > conftest.$ac_ext < - - -int main() { -switch (0) case 0: case (sizeof (long long) == $ac_size):; -; return 0; } -EOF -if { (eval echo configure:3316: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_sizeof_long_long=$ac_size -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 -fi -rm -f conftest* - if test x$ac_cv_sizeof_long_long != x ; then break; fi -done - -fi - -if test x$ac_cv_sizeof_long_long = x ; then - { echo "configure: error: cannot determine a size for long long" 1>&2; exit 1; } -fi -echo "$ac_t""$ac_cv_sizeof_long_long" 1>&6 -cat >> confdefs.h <&6 -echo "configure:3339: checking size of float" >&5 -if eval "test \"`echo '$''{'ac_cv_sizeof_float'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. - cat > conftest.$ac_ext < - - -int main() { -switch (0) case 0: case (sizeof (float) == $ac_size):; -; return 0; } -EOF -if { (eval echo configure:3355: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_sizeof_float=$ac_size -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 -fi -rm -f conftest* - if test x$ac_cv_sizeof_float != x ; then break; fi -done - -fi - -if test x$ac_cv_sizeof_float = x ; then - { echo "configure: error: cannot determine a size for float" 1>&2; exit 1; } -fi -echo "$ac_t""$ac_cv_sizeof_float" 1>&6 -cat >> confdefs.h <&6 -echo "configure:3378: checking size of double" >&5 +echo "configure:3175: checking size of double" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. cat > conftest.$ac_ext < @@ -3390,7 +3187,7 @@ int main() { switch (0) case 0: case (sizeof (double) == $ac_size):; ; return 0; } EOF -if { (eval echo configure:3394: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3191: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sizeof_double=$ac_size else @@ -3413,13 +3210,13 @@ EOF echo $ac_n "checking size of long double""... $ac_c" 1>&6 -echo "configure:3417: checking size of long double" >&5 +echo "configure:3214: checking size of long double" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. cat > conftest.$ac_ext < @@ -3429,7 +3226,7 @@ int main() { switch (0) case 0: case (sizeof (long double) == $ac_size):; ; return 0; } EOF -if { (eval echo configure:3433: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3230: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sizeof_long_double=$ac_size else @@ -3452,54 +3249,28 @@ EOF -echo $ac_n "checking size of void *""... $ac_c" 1>&6 -echo "configure:3457: checking size of void *" >&5 -if eval "test \"`echo '$''{'ac_cv_sizeof_void_p'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. - cat > conftest.$ac_ext < - - -int main() { -switch (0) case 0: case (sizeof (void *) == $ac_size):; -; return 0; } +# Also AC_SUBST this variable for ffi.h. +HAVE_LONG_DOUBLE=0 +if test $ac_cv_sizeof_double != $ac_cv_sizeof_long_double; then + if test $ac_cv_sizeof_long_double != 0; then + HAVE_LONG_DOUBLE=1 + cat >> confdefs.h <<\EOF +#define HAVE_LONG_DOUBLE 1 EOF -if { (eval echo configure:3473: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_sizeof_void_p=$ac_size -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 -fi -rm -f conftest* - if test x$ac_cv_sizeof_void_p != x ; then break; fi -done + fi fi -if test x$ac_cv_sizeof_void_p = x ; then - { echo "configure: error: cannot determine a size for void *" 1>&2; exit 1; } -fi -echo "$ac_t""$ac_cv_sizeof_void_p" 1>&6 -cat >> confdefs.h <&6 -echo "configure:3496: checking whether byte ordering is bigendian" >&5 +echo "configure:3267: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < #include @@ -3510,11 +3281,11 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:3514: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3285: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < #include @@ -3525,7 +3296,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:3529: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3300: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -3545,7 +3316,7 @@ if test "$cross_compiling" = yes; then echo $ac_n "cross-compiling... " 2>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3333: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no else @@ -3576,7 +3347,7 @@ fi echo "$ac_t""$ac_cv_c_bigendian" 1>&6 if test $ac_cv_c_bigendian = unknown; then echo $ac_n "checking to probe for byte ordering""... $ac_c" 1>&6 -echo "configure:3580: checking to probe for byte ordering" >&5 +echo "configure:3351: checking to probe for byte ordering" >&5 cat >conftest.c <&6 -echo "configure:3634: checking assembler and linker support unaligned pc related relocs" >&5 +echo "configure:3405: checking assembler and linker support unaligned pc related relocs" >&5 if eval "test \"`echo '$''{'libffi_cv_as_sparc_ua_pcrel'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3640,14 +3411,14 @@ else CFLAGS="$CFLAGS -fpic" LDFLAGS="$LDFLAGS -shared" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* libffi_cv_as_sparc_ua_pcrel=yes else @@ -3670,7 +3441,7 @@ EOF fi echo $ac_n "checking assembler .register pseudo-op support""... $ac_c" 1>&6 -echo "configure:3674: checking assembler .register pseudo-op support" >&5 +echo "configure:3445: checking assembler .register pseudo-op support" >&5 if eval "test \"`echo '$''{'libffi_cv_as_register_pseudo_op'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3678,14 +3449,14 @@ else libffi_cv_as_register_pseudo_op=unknown # Check if we have .register cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3460: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* libffi_cv_as_register_pseudo_op=yes else @@ -3708,7 +3479,7 @@ EOF fi echo $ac_n "checking whether .eh_frame section should be read-only""... $ac_c" 1>&6 -echo "configure:3712: checking whether .eh_frame section should be read-only" >&5 +echo "configure:3483: checking whether .eh_frame section should be read-only" >&5 if eval "test \"`echo '$''{'libffi_cv_ro_eh_frame'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3731,6 +3502,15 @@ echo "$ac_t""$libffi_cv_ro_eh_frame" 1>&6 if test "x$libffi_cv_ro_eh_frame" = xyes; then cat >> confdefs.h <<\EOF #define HAVE_RO_EH_FRAME 1 +EOF + + cat >> confdefs.h <<\EOF +#define EH_FRAME_FLAGS "a" +EOF + +else + cat >> confdefs.h <<\EOF +#define EH_FRAME_FLAGS "aw" EOF fi @@ -3983,10 +3763,8 @@ s%@MAINT@%$MAINT%g s%@TESTSUBDIR_TRUE@%$TESTSUBDIR_TRUE%g s%@TESTSUBDIR_FALSE@%$TESTSUBDIR_FALSE%g s%@AM_RUNTESTFLAGS@%$AM_RUNTESTFLAGS%g -s%@MIPS_GCC_TRUE@%$MIPS_GCC_TRUE%g -s%@MIPS_GCC_FALSE@%$MIPS_GCC_FALSE%g -s%@MIPS_SGI_TRUE@%$MIPS_SGI_TRUE%g -s%@MIPS_SGI_FALSE@%$MIPS_SGI_FALSE%g +s%@MIPS_IRIX_TRUE@%$MIPS_IRIX_TRUE%g +s%@MIPS_IRIX_FALSE@%$MIPS_IRIX_FALSE%g s%@MIPS_LINUX_TRUE@%$MIPS_LINUX_TRUE%g s%@MIPS_LINUX_FALSE@%$MIPS_LINUX_FALSE%g s%@SPARC_TRUE@%$SPARC_TRUE%g @@ -4019,6 +3797,7 @@ s%@SH64_TRUE@%$SH64_TRUE%g s%@SH64_FALSE@%$SH64_FALSE%g s%@CPP@%$CPP%g s%@ALLOCA@%$ALLOCA%g +s%@HAVE_LONG_DOUBLE@%$HAVE_LONG_DOUBLE%g s%@TARGET@%$TARGET%g s%@TARGETDIR@%$TARGETDIR%g s%@toolexecdir@%$toolexecdir%g @@ -4230,6 +4009,51 @@ cat >> $CONFIG_STATUS <<\EOF fi fi; done +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +srcdir=$ac_given_srcdir +while test -n "$ac_sources"; do + set $ac_dests; ac_dest=$1; shift; ac_dests=$* + set $ac_sources; ac_source=$1; shift; ac_sources=$* + + echo "linking $srcdir/$ac_source to $ac_dest" + + if test ! -r $srcdir/$ac_source; then + { echo "configure: error: $srcdir/$ac_source: File not found" 1>&2; exit 1; } + fi + rm -f $ac_dest + + # Make relative symlinks. + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dest_dir=`echo $ac_dest|sed 's%/[^/][^/]*$%%'` + if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then + # The dest file is in a subdirectory. + test ! -d "$ac_dest_dir" && mkdir "$ac_dest_dir" + ac_dest_dir_suffix="/`echo $ac_dest_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dest_dir_suffix. + ac_dots=`echo $ac_dest_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dest_dir_suffix= ac_dots= + fi + + case "$srcdir" in + [/$]*) ac_rel_source="$srcdir/$ac_source" ;; + *) ac_rel_source="$ac_dots$srcdir/$ac_source" ;; + esac + + # Make a symlink if possible; otherwise try a hard link. + if ln -s $ac_rel_source $ac_dest 2>/dev/null || + ln $srcdir/$ac_source $ac_dest; then : + else + { echo "configure: error: can not link $ac_dest to $srcdir/$ac_source" 1>&2; exit 1; } + fi +done EOF cat >> $CONFIG_STATUS </dev/null; then - echo fficonfig.h unchanged -else - echo Moving fficonfig.h to include/fficonfig.h - cp fficonfig.h include/fficonfig.h -fi + +# Make target subdirectories if required. +test -d src || mkdir src +test -d src/${TARGETDIR} || mkdir src/${TARGETDIR} +test -d include || mkdir include + + EOF cat >> $CONFIG_STATUS <<\EOF @@ -4267,7 +4090,3 @@ chmod +x $CONFIG_STATUS rm -fr confdefs* $ac_clean_files test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 - -# Make target subdirectories if required. -test -d src || mkdir src -test -d src/${TARGETDIR} || mkdir src/${TARGETDIR} diff --git a/libffi/configure.in b/libffi/configure.in index aab8f097bf8..b44daed0033 100644 --- a/libffi/configure.in +++ b/libffi/configure.in @@ -52,7 +52,6 @@ AM_CONDITIONAL(TESTSUBDIR, test -d $srcdir/testsuite) TARGETDIR="unknown" case "$host" in -mips-sgi-irix5.* | mips-sgi-irix6.*) TARGET=MIPS; TARGETDIR=mips;; i*86-*-linux*) TARGET=X86; TARGETDIR=x86;; i*86-*-solaris*) TARGET=X86; TARGETDIR=x86;; i*86-*-beos*) TARGET=X86; TARGETDIR=x86;; @@ -69,6 +68,7 @@ alpha*-*-linux* | alpha*-*-osf* | alpha*-*-freebsd* | alpha*-*-netbsd*) TARGET=A ia64*-*-*) TARGET=IA64; TARGETDIR=ia64;; m68k-*-linux*) TARGET=M68K; TARGETDIR=m68k;; mips64*-*);; +mips-sgi-irix5.* | mips-sgi-irix6.*) TARGET=MIPS_IRIX; TARGETDIR=mips;; mips*-*-linux*) TARGET=MIPS_LINUX; TARGETDIR=mips;; powerpc*-*-linux* | powerpc-*-sysv*) TARGET=POWERPC; TARGETDIR=powerpc;; powerpc-*-beos*) TARGET=POWERPC; TARGETDIR=powerpc;; @@ -90,8 +90,7 @@ if test $TARGETDIR = unknown; then AC_ERROR("libffi has not been ported to $host.") fi -AM_CONDITIONAL(MIPS_GCC, test ${TARGET}${ac_cv_prog_gcc} = MIPSyes) -AM_CONDITIONAL(MIPS_SGI, test ${TARGET}${ac_cv_prog_gcc} = MIPSno) +AM_CONDITIONAL(MIPS_IRIX, test x$TARGET = xMIPS_IRIX) AM_CONDITIONAL(MIPS_LINUX, test x$TARGET = xMIPS_LINUX) AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC) AM_CONDITIONAL(X86, test x$TARGET = xX86) @@ -108,24 +107,28 @@ AM_CONDITIONAL(X86_64, test x$TARGET = xX86_64) AM_CONDITIONAL(SH, test x$TARGET = xSH) AM_CONDITIONAL(SH64, test x$TARGET = xSH64) -if test x$TARGET = xMIPS_LINUX; then - TARGET=MIPS -fi +case x$TARGET in + xMIPS*) TARGET=MIPS ;; + *) ;; +esac AC_HEADER_STDC AC_CHECK_FUNCS(memcpy) AC_FUNC_ALLOCA -dnl AC_CHECK_SIZEOF(char) -AC_COMPILE_CHECK_SIZEOF(short) -AC_COMPILE_CHECK_SIZEOF(int) -AC_COMPILE_CHECK_SIZEOF(long) -AC_COMPILE_CHECK_SIZEOF(long long) -AC_COMPILE_CHECK_SIZEOF(float) AC_COMPILE_CHECK_SIZEOF(double) AC_COMPILE_CHECK_SIZEOF(long double) -AC_COMPILE_CHECK_SIZEOF(void *) +# Also AC_SUBST this variable for ffi.h. +HAVE_LONG_DOUBLE=0 +if test $ac_cv_sizeof_double != $ac_cv_sizeof_long_double; then + if test $ac_cv_sizeof_long_double != 0; then + HAVE_LONG_DOUBLE=1 + AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the long double type and it is bigger than a double]) + fi +fi +AC_SUBST(HAVE_LONG_DOUBLE) + AC_C_BIGENDIAN_CROSS if test x$TARGET = xSPARC; then @@ -176,6 +179,11 @@ AC_CACHE_CHECK([whether .eh_frame section should be read-only], if test "x$libffi_cv_ro_eh_frame" = xyes; then AC_DEFINE(HAVE_RO_EH_FRAME, 1, [Define if .eh_frame sections should be read-only.]) + AC_DEFINE(EH_FRAME_FLAGS, "a", + [Define to the flags needed for the .section .eh_frame directive.]) +else + AC_DEFINE(EH_FRAME_FLAGS, "aw", + [Define to the flags needed for the .section .eh_frame directive.]) fi AC_SUBST(TARGET) @@ -186,25 +194,25 @@ AC_SUBST(SHELL) AC_ARG_ENABLE(debug, [ --enable-debug debugging mode], if test "$enable_debug" = "yes"; then - AC_DEFINE(FFI_DEBUG) + AC_DEFINE(FFI_DEBUG, 1, [Define this if you want extra debugging.]) fi) AC_ARG_ENABLE(structs, [ --disable-structs omit code for struct support], if test "$enable_structs" = "no"; then - AC_DEFINE(FFI_NO_STRUCTS) + AC_DEFINE(FFI_NO_STRUCTS, 1, [Define this is you do not want support for aggregate types.]) fi) AC_ARG_ENABLE(raw-api, [ --disable-raw-api make the raw api unavailable], if test "$enable_raw_api" = "no"; then - AC_DEFINE(FFI_NO_RAW_API) + AC_DEFINE(FFI_NO_RAW_API, 1, [Define this is you do not want support for the raw API.]) fi) AC_ARG_ENABLE(purify-safety, [ --enable-purify-safety purify-safe mode], if test "$enable_purify_safety" = "yes"; then - AC_DEFINE(USING_PURIFY) + AC_DEFINE(USING_PURIFY, 1, [Define this if you are using Purify and want to suppress spurious messages.]) fi) if test -n "$with_cross_host" && @@ -246,16 +254,11 @@ libffi_basedir=${libffi_basedir} CC="${CC}" DEFS="$DEFS" ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}" -test ! -d include && mkdir include -test ! -f include/fficonfig.h && cp fficonfig.h include/fficonfig.h -if cmp -s fficonfig.h include/fficonfig.h 2>/dev/null; then - echo fficonfig.h unchanged -else - echo Moving fficonfig.h to include/fficonfig.h - cp fficonfig.h include/fficonfig.h -fi -) # Make target subdirectories if required. test -d src || mkdir src test -d src/${TARGETDIR} || mkdir src/${TARGETDIR} +test -d include || mkdir include + +AC_LINK_FILES(src/$TARGETDIR/ffitarget.h, include/ffitarget.h) +) diff --git a/libffi/fficonfig.h.in b/libffi/fficonfig.h.in index 636110cd40a..0664506e5b8 100644 --- a/libffi/fficonfig.h.in +++ b/libffi/fficonfig.h.in @@ -25,49 +25,25 @@ /* Define if you have the ANSI C header files. */ #undef STDC_HEADERS -/* Define this if you want extra debugging */ -#undef FFI_DEBUG - -/* Define this if you are using Purify and want to suppress - spurious messages. */ -#undef USING_PURIFY - -/* Define this is you do not want support for aggregate types. */ -#undef FFI_NO_STRUCTS - -/* Define this is you do not want support for the raw API. */ -#undef FFI_NO_RAW_API - /* Define if you have the memcpy function. */ #undef HAVE_MEMCPY -/* The number of bytes in type short */ -#undef SIZEOF_SHORT - -/* The number of bytes in type int */ -#undef SIZEOF_INT - -/* The number of bytes in type long */ -#undef SIZEOF_LONG - -/* The number of bytes in type long long */ -#undef SIZEOF_LONG_LONG - -/* The number of bytes in type float */ -#undef SIZEOF_FLOAT - /* The number of bytes in type double */ #undef SIZEOF_DOUBLE /* The number of bytes in type long double */ #undef SIZEOF_LONG_DOUBLE -/* The number of bytes in type void * */ -#undef SIZEOF_VOID_P +/* Define if you have the long double type and it is bigger than a double */ +#undef HAVE_LONG_DOUBLE /* whether byteorder is bigendian */ #undef WORDS_BIGENDIAN +/* Define if the host machine stores words of multi-word integers in + big-endian order. */ +#undef HOST_WORDS_BIG_ENDIAN + /* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */ #undef BYTEORDER @@ -79,3 +55,22 @@ /* Define if .eh_frame sections should be read-only. */ #undef HAVE_RO_EH_FRAME + +/* Define to the flags needed for the .section .eh_frame directive. */ +#undef EH_FRAME_FLAGS + +/* Define to the flags needed for the .section .eh_frame directive. */ +#undef EH_FRAME_FLAGS + +/* Define this if you want extra debugging. */ +#undef FFI_DEBUG + +/* Define this is you do not want support for aggregate types. */ +#undef FFI_NO_STRUCTS + +/* Define this is you do not want support for the raw API. */ +#undef FFI_NO_RAW_API + +/* Define this if you are using Purify and want to suppress spurious messages. */ +#undef USING_PURIFY + diff --git a/libffi/include/Makefile.am b/libffi/include/Makefile.am index 74fd5a665db..f9231a66c93 100644 --- a/libffi/include/Makefile.am +++ b/libffi/include/Makefile.am @@ -1,9 +1,10 @@ ## Process this with automake to create Makefile.in -AUTOMAKE_OPTIONS = foreign +AUTOMAKE_OPTIONS=foreign -EXTRA_DIST = ffi.h.in ffi_common.h ffi_mips.h +DISTCLEANFILES=ffitarget.h +EXTRA_DIST=ffi.h.in ffi_common.h hackdir=$(includedir) -hack_DATA=fficonfig.h ffi.h ffi_mips.h \ No newline at end of file +hack_DATA=ffitarget.h ffi.h diff --git a/libffi/include/Makefile.in b/libffi/include/Makefile.in index d2cb67d8a8b..0eb19193674 100644 --- a/libffi/include/Makefile.in +++ b/libffi/include/Makefile.in @@ -72,6 +72,7 @@ DLLTOOL = @DLLTOOL@ EXEEXT = @EXEEXT@ GCJ = @GCJ@ GCJFLAGS = @GCJFLAGS@ +HAVE_LONG_DOUBLE = @HAVE_LONG_DOUBLE@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ MAINT = @MAINT@ @@ -91,11 +92,12 @@ toolexeclibdir = @toolexeclibdir@ AUTOMAKE_OPTIONS = foreign -EXTRA_DIST = ffi.h.in ffi_common.h ffi_mips.h +DISTCLEANFILES = ffitarget.h +EXTRA_DIST = ffi.h.in ffi_common.h hackdir = $(includedir) -hack_DATA = fficonfig.h ffi.h ffi_mips.h +hack_DATA = ffitarget.h ffi.h mkinstalldirs = $(SHELL) $(top_srcdir)/${libffi_basedir}../mkinstalldirs CONFIG_HEADER = ../fficonfig.h CONFIG_CLEAN_FILES = ffi.h @@ -196,6 +198,7 @@ clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: mostlyclean-am: mostlyclean-generic diff --git a/libffi/include/ffi.h.in b/libffi/include/ffi.h.in index fe32ea2527f..9f61d48aae6 100644 --- a/libffi/include/ffi.h.in +++ b/libffi/include/ffi.h.in @@ -1,5 +1,5 @@ /* -----------------------------------------------------------------*-C-*- - libffi @VERSION@ - Copyright (c) 1996-2003 Cygnus Solutions + libffi @VERSION@ - Copyright (c) 1996-2003 Red Hat, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -60,258 +60,70 @@ extern "C" { /* ---- System configuration information --------------------------------- */ -#include +#include + +#ifndef LIBFFI_ASM -#if !defined(LIBFFI_ASM) #include -#if defined(FFI_DEBUG) -#include -#endif -#endif - -/* ---- Generic type definitions ----------------------------------------- */ - -#define FLOAT32 float -#define FLOAT64 double -#define FLOAT80 long double - -#define UINT8 unsigned char -#define SINT8 signed char - -#if SIZEOF_INT == 2 - -#define UINT16 unsigned int -#define SINT16 int -#define ffi_type_uint ffi_type_uint16 -#define ffi_type_sint ffi_type_sint16 - -#else -#if SIZEOF_SHORT == 2 - -#define UINT16 unsigned short -#define SINT16 short -#define ffi_type_ushort ffi_type_uint16 -#define ffi_type_sshort ffi_type_sint16 - -#endif -#endif - -#if SIZEOF_INT == 4 - -#define UINT32 unsigned int -#define SINT32 int -#define ffi_type_uint ffi_type_uint32 -#define ffi_type_sint ffi_type_sint32 - -#else -#if SIZEOF_SHORT == 4 - -#define UINT32 unsigned short -#define SINT32 short -#define ffi_type_ushort ffi_type_uint32 -#define ffi_type_sshort ffi_type_sint32 +#include +/* LONG_LONG_MAX is not always defined (not if STRICT_ANSI, for example). + But we can find it either under the correct ANSI name, or under GNU + C's internal name. */ +#ifdef LONG_LONG_MAX +# define FFI_LONG_LONG_MAX LONG_LONG_MAX #else -#if SIZEOF_LONG == 4 - -#define UINT32 unsigned long -#define SINT32 long -#define ffi_type_ulong ffi_type_uint32 -#define ffi_type_slong ffi_type_sint32 - -#endif -#endif -#endif - -#if SIZEOF_INT == 8 - -#define UINT64 unsigned int -#define SINT64 int -#define ffi_type_uint ffi_type_uint64 -#define ffi_type_sint ffi_type_sint64 - -#else -#if SIZEOF_LONG == 8 - -#define UINT64 unsigned long -#define SINT64 long -#define ffi_type_ulong ffi_type_uint64 -#define ffi_type_slong ffi_type_sint64 - -#else -#if SIZEOF_LONG_LONG == 8 - -#define UINT64 unsigned long long -#define SINT64 long long -#define ffi_type_ulong ffi_type_uint64 -#define ffi_type_slong ffi_type_sint64 - -#endif -#endif -#endif - -/* ---- System specific configurations ----------------------------------- */ - -#ifdef MIPS -#include -#else -#define SIZEOF_ARG SIZEOF_VOID_P -#endif - -#ifdef POWERPC -#if defined (__powerpc64__) -#define POWERPC64 -#endif -#endif - -#ifdef SPARC -#if defined(__arch64__) || defined(__sparcv9) -#define SPARC64 -#endif -#endif - -#ifdef S390 -#if defined (__s390x__) -#define S390X -#endif -#endif - -#ifdef X86_64 -#if defined (__i386__) -#undef X86_64 -#define X86 -#endif -#endif - -#ifdef LIBFFI_ASM - -#ifdef HAVE_RO_EH_FRAME -#define EH_FRAME_FLAGS "a" -#else -#define EH_FRAME_FLAGS "aw" -#endif - -#else - -/* ---- Generic type definitions ----------------------------------------- */ - -#define ALIGN(v, a) (((((size_t) (v))-1) | ((a)-1))+1) -/* The closure code assumes that this works on pointers, i.e. a size_t */ -/* can hold a pointer. */ - -typedef enum ffi_abi { - - /* Leave this for debugging purposes */ - FFI_FIRST_ABI = 0, - - /* ---- Sparc -------------------- */ -#ifdef SPARC - FFI_V8, - FFI_V8PLUS, - FFI_V9, -#ifdef SPARC64 - FFI_DEFAULT_ABI = FFI_V9, -#else - FFI_DEFAULT_ABI = FFI_V8, -#endif -#endif - - /* ---- Intel x86 Win32 ---------- */ -#ifdef X86_WIN32 - FFI_SYSV, - FFI_STDCALL, - /* TODO: Add fastcall support for the sake of completeness */ - FFI_DEFAULT_ABI = FFI_SYSV, -#endif - - /* ---- Intel x86 and AMD x86-64 - */ -#if !defined(X86_WIN32) && (defined(__i386__) || defined(__x86_64__)) - FFI_SYSV, - FFI_UNIX64, /* Unix variants all use the same ABI for x86-64 */ -#ifdef __i386__ - FFI_DEFAULT_ABI = FFI_SYSV, -#else - FFI_DEFAULT_ABI = FFI_UNIX64, -#endif -#endif - - /* ---- Intel ia64 ---------------- */ -#ifdef IA64 - FFI_UNIX, /* Linux and all Unix variants use the same conventions */ - FFI_DEFAULT_ABI = FFI_UNIX, -#endif - - /* ---- Mips --------------------- */ -#ifdef MIPS - FFI_O32, - FFI_N32, - FFI_N64, -#endif - - /* ---- Alpha -------------------- */ -#ifdef ALPHA - FFI_OSF, - FFI_DEFAULT_ABI = FFI_OSF, -#endif - - /* ---- Motorola m68k ------------ */ -#ifdef M68K - FFI_SYSV, - FFI_DEFAULT_ABI = FFI_SYSV, -#endif - - /* ---- PowerPC ------------------ */ -#ifdef POWERPC - FFI_SYSV, - FFI_GCC_SYSV, - FFI_LINUX64, -# ifdef POWERPC64 - FFI_DEFAULT_ABI = FFI_LINUX64, +# ifdef LLONG_MAX +# define FFI_LONG_LONG_MAX LLONG_MAX # else - FFI_DEFAULT_ABI = FFI_GCC_SYSV, +# ifdef __GNUC__ +# define FFI_LONG_LONG_MAX __LONG_LONG_MAX__ +# endif # endif #endif -#ifdef POWERPC_AIX - FFI_AIX, - FFI_DARWIN, - FFI_DEFAULT_ABI = FFI_AIX, +#if SCHAR_MAX == 127 +# define ffi_type_uchar ffi_type_uint8 +# define ffi_type_schar ffi_type_sint8 +#else + #error "char size not supported" #endif -#ifdef POWERPC_DARWIN - FFI_AIX, - FFI_DARWIN, - FFI_DEFAULT_ABI = FFI_DARWIN, +#if SHRT_MAX == 32767 +# define ffi_type_ushort ffi_type_uint16 +# define ffi_type_sshort ffi_type_sint16 +#elif SHRT_MAX == 2147483647 +# define ffi_type_ushort ffi_type_uint32 +# define ffi_type_sshort ffi_type_sint32 +#else + #error "short size not supported" #endif - /* ---- ARM --------------------- */ -#ifdef ARM - FFI_SYSV, - FFI_DEFAULT_ABI = FFI_SYSV, +#if INT_MAX == 32767 +# define ffi_type_uint ffi_type_uint16 +# define ffi_type_sint ffi_type_sint16 +#elif INT_MAX == 2147483647 +# define ffi_type_uint ffi_type_uint32 +# define ffi_type_sint ffi_type_sint32 +#elif INT_MAX == 9223372036854775807 +# define ffi_type_uint ffi_type_uint64 +# define ffi_type_sint ffi_type_sint64 +#else + #error "int size not supported" #endif - /* ---- S390 --------------------- */ -#ifdef S390 - FFI_SYSV, - FFI_DEFAULT_ABI = FFI_SYSV, +#define ffi_type_ulong ffi_type_uint64 +#define ffi_type_slong ffi_type_sint64 +#if LONG_MAX == 2147483647 +# if FFI_LONG_LONG_MAX != 9223372036854775807 + #error "no 64-bit data type supported" +# endif +#elif LONG_MAX != 9223372036854775807 + #error "long size not supported" #endif - /* ---- SuperH ------------------- */ -#ifdef SH - FFI_SYSV, - FFI_DEFAULT_ABI = FFI_SYSV, -#endif - - /* ---- SuperH - SHmedia --------- */ -#ifdef SH64 - FFI_SYSV, - FFI_DEFAULT_ABI = FFI_SYSV, -#endif - - /* Leave this for debugging purposes */ - FFI_LAST_ABI - -} ffi_abi; +/* The closure code assumes that this works on pointers, i.e. a size_t */ +/* can hold a pointer. */ typedef struct _ffi_type { @@ -336,9 +148,6 @@ extern ffi_type ffi_type_double; extern ffi_type ffi_type_longdouble; extern ffi_type ffi_type_pointer; -/* Characters are 8 bit integral types */ -#define ffi_type_schar ffi_type_sint8 -#define ffi_type_uchar ffi_type_uint8 typedef enum { FFI_OK = 0, @@ -355,53 +164,27 @@ typedef struct { /*@dependent@*/ ffi_type *rtype; unsigned bytes; unsigned flags; - -#ifdef MIPS -#if _MIPS_SIM == _ABIN32 - unsigned rstruct_flag; +#ifdef FFI_EXTRA_CIF_FIELDS + FFI_EXTRA_CIF_FIELDS; #endif -#endif - -#ifdef SH64 - long long flags2; -#endif - } ffi_cif; -#if SIZEOF_ARG == 4 -typedef UINT32 ffi_arg; -#else -#if SIZEOF_ARG == 8 -typedef UINT64 ffi_arg; -#else --- unsupported configuration -#endif -#endif - /* ---- Definitions for the raw API -------------------------------------- */ -#if !FFI_NO_RAW_API - -#if SIZEOF_ARG == 4 - -#define UINT_ARG UINT32 -#define SINT_ARG SINT32 - -#endif - -#if SIZEOF_ARG == 8 - -#define UINT_ARG UINT64 -#define SINT_ARG SINT64 - +#ifndef FFI_SIZEOF_ARG +# if LONG_MAX == 2147483647 +# define FFI_SIZEOF_ARG 4 +# elif LONG_MAX == 9223372036854775807 +# define FFI_SIZEOF_ARG 8 +# endif #endif typedef union { - SINT_ARG sint; - UINT_ARG uint; - float flt; - char data[SIZEOF_ARG]; - void* ptr; + ffi_sarg sint; + ffi_arg uint; + float flt; + char data[FFI_SIZEOF_ARG]; + void* ptr; } ffi_raw; void ffi_raw_call (/*@dependent@*/ ffi_cif *cif, @@ -413,8 +196,6 @@ void ffi_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw); void ffi_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args); size_t ffi_raw_size (ffi_cif *cif); -#if !NO_JAVA_RAW_API - /* This is analogous to the raw API, except it uses Java parameter */ /* packing, even on 64-bit machines. I.e. on 64-bit machines */ /* longs and doubles are followed by an empty 64-bit word. */ @@ -428,120 +209,8 @@ void ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw); void ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args); size_t ffi_java_raw_size (ffi_cif *cif); -#endif /* !NO_JAVA_RAW_API */ - -#endif /* !FFI_NO_RAW_API */ - /* ---- Definitions for closures ----------------------------------------- */ -#ifdef __i386__ - -#define FFI_CLOSURES 1 /* x86 supports closures */ -#define FFI_TRAMPOLINE_SIZE 10 -#define FFI_NATIVE_RAW_API 1 /* and has native raw api support */ - -#elif defined(IA64) - -#define FFI_CLOSURES 1 -#define FFI_TRAMPOLINE_SIZE 24 /* Really the following struct, which */ - /* can be interpreted as a C function */ - /* decriptor: */ - -struct ffi_ia64_trampoline_struct { - void * code_pointer; /* Pointer to ffi_closure_UNIX */ - void * fake_gp; /* Pointer to closure, installed as gp */ - void * real_gp; /* Real gp value, reinstalled by */ - /* ffi_closure_UNIX. */ -}; -#define FFI_NATIVE_RAW_API 0 - -#elif defined(ALPHA) - -#define FFI_CLOSURES 1 -#define FFI_TRAMPOLINE_SIZE 24 -#define FFI_NATIVE_RAW_API 0 - -#elif defined(POWERPC) - -#define FFI_CLOSURES 1 -#ifdef POWERPC64 -#define FFI_TRAMPOLINE_SIZE 24 -#else -#define FFI_TRAMPOLINE_SIZE 40 -#endif -#define FFI_NATIVE_RAW_API 0 - -#elif defined(POWERPC_DARWIN) - -#define FFI_CLOSURES 1 -#define FFI_TRAMPOLINE_SIZE 40 -#define FFI_NATIVE_RAW_API 0 - -#elif defined(POWERPC_AIX) - -#define FFI_CLOSURES 1 -#define FFI_TRAMPOLINE_SIZE 24 /* see struct below */ -#define FFI_NATIVE_RAW_API 0 - -#elif defined(SPARC64) - -#define FFI_CLOSURES 1 -#define FFI_TRAMPOLINE_SIZE 24 -#define FFI_NATIVE_RAW_API 0 - -#elif defined(SPARC) - -#define FFI_CLOSURES 1 -#define FFI_TRAMPOLINE_SIZE 16 -#define FFI_NATIVE_RAW_API 0 - -#elif defined(S390) - -#define FFI_CLOSURES 1 -#ifdef S390X -#define FFI_TRAMPOLINE_SIZE 32 -#else -#define FFI_TRAMPOLINE_SIZE 16 -#endif -#define FFI_NATIVE_RAW_API 0 - -#elif defined(SH) - -#define FFI_CLOSURES 1 -#define FFI_TRAMPOLINE_SIZE 16 -#define FFI_NATIVE_RAW_API 0 - -#elif defined(SH64) - -#define FFI_CLOSURES 1 -#define FFI_TRAMPOLINE_SIZE 32 -#define FFI_NATIVE_RAW_API 0 - -#elif defined(__x86_64__) - -#define FFI_CLOSURES 1 -#define FFI_TRAMPOLINE_SIZE 24 -#define FFI_NATIVE_RAW_API 0 - -#else - -#define FFI_CLOSURES 0 -#define FFI_NATIVE_RAW_API 0 - -#endif - -#if defined(POWERPC_DARWIN) || defined(POWERPC_AIX) - -struct ffi_aix_trampoline_struct { - void * code_pointer; /* Pointer to ffi_closure_ASM */ - void * toc; /* TOC */ - void * static_chain; /* Pointer to closure */ -}; - -#endif - - - #if FFI_CLOSURES typedef struct { @@ -557,8 +226,6 @@ ffi_prep_closure (ffi_closure*, void (*fun)(ffi_cif*,void*,void**,void*), void *user_data); -#if !FFI_NO_RAW_API - typedef struct { char tramp[FFI_TRAMPOLINE_SIZE]; @@ -586,15 +253,12 @@ ffi_prep_raw_closure (ffi_raw_closure*, void (*fun)(ffi_cif*,void*,ffi_raw*,void*), void *user_data); -#ifndef NO_JAVA_RAW_API ffi_status ffi_prep_java_raw_closure (ffi_raw_closure*, ffi_cif *cif, void (*fun)(ffi_cif*,void*,ffi_raw*,void*), void *user_data); -#endif -#endif /* !FFI_NO_RAW_API */ #endif /* FFI_CLOSURES */ /* ---- Public interface definition -------------------------------------- */ @@ -617,25 +281,25 @@ void ffi_call(/*@dependent@*/ ffi_cif *cif, #endif +/* If these change, update src/mips/ffitarget.h. */ #define FFI_TYPE_VOID 0 #define FFI_TYPE_INT 1 #define FFI_TYPE_FLOAT 2 #define FFI_TYPE_DOUBLE 3 -#if SIZEOF_LONG_DOUBLE == SIZEOF_DOUBLE -#define FFI_TYPE_LONGDOUBLE FFI_TYPE_DOUBLE -#else +#if @HAVE_LONG_DOUBLE@ #define FFI_TYPE_LONGDOUBLE 4 +#else +#define FFI_TYPE_LONGDOUBLE FFI_TYPE_DOUBLE #endif - -#define FFI_TYPE_UINT8 5 /* If this changes, update ffi_mips.h. */ -#define FFI_TYPE_SINT8 6 /* If this changes, update ffi_mips.h. */ +#define FFI_TYPE_UINT8 5 +#define FFI_TYPE_SINT8 6 #define FFI_TYPE_UINT16 7 #define FFI_TYPE_SINT16 8 #define FFI_TYPE_UINT32 9 #define FFI_TYPE_SINT32 10 #define FFI_TYPE_UINT64 11 #define FFI_TYPE_SINT64 12 -#define FFI_TYPE_STRUCT 13 /* If this changes, update ffi_mips.h. */ +#define FFI_TYPE_STRUCT 13 #define FFI_TYPE_POINTER 14 /* This should always refer to the last type code (for sanity checks) */ diff --git a/libffi/include/ffi_common.h b/libffi/include/ffi_common.h index c9d4acf9085..1b948d54ae2 100644 --- a/libffi/include/ffi_common.h +++ b/libffi/include/ffi_common.h @@ -1,7 +1,5 @@ /* ----------------------------------------------------------------------- - ffi_common.h - Copyright (c) 1996 Cygnus Solutions - - $Id: ffi_common.h,v 1.1.1.1 1998/11/29 16:48:16 green Exp $ + ffi_common.h - Copyright (c) 1996 Red Hat, Inc. Common internal definitions and macros. Only necessary for building libffi. @@ -14,6 +12,8 @@ extern "C" { #endif +#include + /* Do not move this. Some versions of AIX are very picky about where this is positioned. */ #ifdef __GNUC__ @@ -41,36 +41,26 @@ char *alloca (); # endif #endif -#ifndef FALSE -#define FALSE 0 -#endif - -#ifndef TRUE -#define TRUE (!FALSE) -#endif - -#ifndef __cplusplus -/* bool is a keyword in C++ */ -/*@-cppnames@*/ -typedef int bool; -/*@=cppnames@*/ +#if defined(FFI_DEBUG) +#include #endif #ifdef FFI_DEBUG - -/* Debugging functions */ -/*@exits@*/ int ffi_assert(/*@temp@*/ char *file, int line); +/*@exits@*/ void ffi_assert(/*@temp@*/ char *expr, /*@temp@*/ char *file, int line); void ffi_stop_here(void); -bool ffi_type_test(/*@temp@*/ /*@out@*/ ffi_type *a); - -#define FFI_ASSERT(x) ((x) ? 0 : ffi_assert(__FILE__,__LINE__)) +void ffi_type_test(/*@temp@*/ /*@out@*/ ffi_type *a, /*@temp@*/ char *file, int line); +#define FFI_ASSERT(x) ((x) ? (void)0 : ffi_assert(#x, __FILE__,__LINE__)) +#define FFI_ASSERT_AT(x, f, l) ((x) ? 0 : ffi_assert(#x, (f), (l))) +#define FFI_ASSERT_VALID_TYPE(x) ffi_type_test (x, __FILE__, __LINE__) #else - #define FFI_ASSERT(x) - +#define FFI_ASSERT_AT(x, f, l) +#define FFI_ASSERT_VALID_TYPE(x) #endif +#define ALIGN(v, a) (((((size_t) (v))-1) | ((a)-1))+1) + /* Perform machine dependent cif processing */ ffi_status ffi_prep_cif_machdep(ffi_cif *cif); @@ -82,6 +72,19 @@ typedef struct /*@dependent@*/ void **avalue; } extended_cif; +/* Terse sized type definitions. */ +typedef unsigned int UINT8 __attribute__((__mode__(__QI__))); +typedef signed int SINT8 __attribute__((__mode__(__QI__))); +typedef unsigned int UINT16 __attribute__((__mode__(__HI__))); +typedef signed int SINT16 __attribute__((__mode__(__HI__))); +typedef unsigned int UINT32 __attribute__((__mode__(__SI__))); +typedef signed int SINT32 __attribute__((__mode__(__SI__))); +typedef unsigned int UINT64 __attribute__((__mode__(__DI__))); +typedef signed int SINT64 __attribute__((__mode__(__DI__))); + +typedef float FLOAT32; + + #ifdef __cplusplus } #endif diff --git a/libffi/src/alpha/ffi.c b/libffi/src/alpha/ffi.c index 2ed36732790..00d33790109 100644 --- a/libffi/src/alpha/ffi.c +++ b/libffi/src/alpha/ffi.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------- - ffi.c - Copyright (c) 1998, 2001 Cygnus Solutions + ffi.c - Copyright (c) 1998, 2001 Red Hat, Inc. Alpha Foreign Function Interface @@ -37,8 +37,8 @@ ffi_prep_cif_machdep(ffi_cif *cif) { /* Adjust cif->bytes to represent a minimum 6 words for the temporary register argument loading area. */ - if (cif->bytes < 6*SIZEOF_ARG) - cif->bytes = 6*SIZEOF_ARG; + if (cif->bytes < 6*FFI_SIZEOF_ARG) + cif->bytes = 6*FFI_SIZEOF_ARG; /* Set the return type flag */ switch (cif->rtype->type) @@ -73,7 +73,7 @@ ffi_call(ffi_cif *cif, void (*fn)(), void *rvalue, void **avalue) /* Allocate the space for the arguments, plus 4 words of temp space for ffi_call_osf. */ - argp = stack = alloca(cif->bytes + 4*SIZEOF_ARG); + argp = stack = alloca(cif->bytes + 4*FFI_SIZEOF_ARG); if (cif->flags == FFI_TYPE_STRUCT) *(void **) argp++ = rvalue; @@ -137,7 +137,7 @@ ffi_call(ffi_cif *cif, void (*fn)(), void *rvalue, void **avalue) FFI_ASSERT(0); } - argp += ALIGN((*arg_types)->size, SIZEOF_ARG) / SIZEOF_ARG; + argp += ALIGN((*arg_types)->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG; i++, arg_types++, avalue++; } @@ -240,7 +240,7 @@ ffi_closure_osf_inner(ffi_closure *closure, void *rvalue, unsigned long *argp) FFI_ASSERT(0); } - argn += ALIGN(arg_types[i]->size, SIZEOF_ARG) / SIZEOF_ARG; + argn += ALIGN(arg_types[i]->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG; i++; } diff --git a/libffi/src/alpha/osf.S b/libffi/src/alpha/osf.S index 1f6b4059c64..cfa7a964bc1 100644 --- a/libffi/src/alpha/osf.S +++ b/libffi/src/alpha/osf.S @@ -26,6 +26,7 @@ ----------------------------------------------------------------------- */ #define LIBFFI_ASM +#include #include .arch ev6 diff --git a/libffi/src/arm/ffi.c b/libffi/src/arm/ffi.c index dcd9891dcc2..37e3838246a 100644 --- a/libffi/src/arm/ffi.c +++ b/libffi/src/arm/ffi.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------- - ffi.c - Copyright (c) 1998 Cygnus Solutions + ffi.c - Copyright (c) 1998 Red Hat, Inc. ARM Foreign Function Interface diff --git a/libffi/src/arm/sysv.S b/libffi/src/arm/sysv.S index c600c83d9f5..0e4186114a9 100644 --- a/libffi/src/arm/sysv.S +++ b/libffi/src/arm/sysv.S @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------- - sysv.S - Copyright (c) 1998 Cygnus Solutions + sysv.S - Copyright (c) 1998 Red Hat, Inc. ARM Foreign Function Interface @@ -24,6 +24,7 @@ ----------------------------------------------------------------------- */ #define LIBFFI_ASM +#include #include #ifdef HAVE_MACHINE_ASM_H #include diff --git a/libffi/src/debug.c b/libffi/src/debug.c index 099b3977825..98f1f9f0b4e 100644 --- a/libffi/src/debug.c +++ b/libffi/src/debug.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------- - debug.c - Copyright (c) 1996 Cygnus Solutions + debug.c - Copyright (c) 1996 Red Hat, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -37,29 +37,23 @@ void ffi_stop_here(void) /* This function should only be called via the FFI_ASSERT() macro */ -int ffi_assert(char *file, int line) +void ffi_assert(char *expr, char *file, int line) { - fprintf(stderr, "ASSERTION FAILURE: %s line %d\n", file, line); + fprintf(stderr, "ASSERTION FAILURE: %s at %s:%d\n", expr, file, line); ffi_stop_here(); abort(); - - /* This has to return something for the compiler not to complain */ - /*@notreached@*/ - return 0; } /* Perform a sanity check on an ffi_type structure */ -bool ffi_type_test(ffi_type *a) +void ffi_type_test(ffi_type *a, char *file, int line) { - /*@-usedef@*/ - FFI_ASSERT(a->type <= FFI_TYPE_LAST); - FFI_ASSERT(a->type > FFI_TYPE_VOID ? a->size > 0 : 1); - FFI_ASSERT(a->type > FFI_TYPE_VOID ? a->alignment > 0 : 1); - FFI_ASSERT(a->type == FFI_TYPE_STRUCT ? a->elements != NULL : 1); - /*@=usedef@*/ + FFI_ASSERT_AT(a != NULL, file, line); - /* This is a silly thing to return, but it keeps the compiler from - issuing warnings about "a" not being used in non-debug builds. */ - return (a != NULL); + /*@-usedef@*/ + FFI_ASSERT_AT(a->type <= FFI_TYPE_LAST, file, line); + FFI_ASSERT_AT(a->type == FFI_TYPE_VOID || a->size > 0, file, line); + FFI_ASSERT_AT(a->type == FFI_TYPE_VOID || a->alignment > 0, file, line); + FFI_ASSERT_AT(a->type != FFI_TYPE_STRUCT || a->elements != NULL, file, line); + /*@=usedef@*/ } diff --git a/libffi/src/ia64/ffi.c b/libffi/src/ia64/ffi.c index 4338d34c4b0..2908081a12b 100644 --- a/libffi/src/ia64/ffi.c +++ b/libffi/src/ia64/ffi.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------- - ffi.c - Copyright (c) 1998 Cygnus Solutions + ffi.c - Copyright (c) 1998 Red Hat, Inc. Copyright (c) 2000 Hewlett Packard Company IA64 Foreign Function Interface @@ -28,6 +28,7 @@ #include #include +#include #include "ia64_flags.h" @@ -210,7 +211,7 @@ ffi_prep_args(struct ia64_args *stack, extended_cif *ecif, int bytes) { size_t sz = (*p_arg)->size; unsigned short element_type; - z = ((*p_arg)->size + SIZEOF_ARG - 1)/SIZEOF_ARG; + z = ((*p_arg)->size + FFI_SIZEOF_ARG - 1)/FFI_SIZEOF_ARG; if (is_homogeneous_fp_aggregate(*p_arg, 8, &element_type)) { int i; int nelements = sz/float_type_size(element_type); @@ -596,7 +597,7 @@ ffi_prep_incoming_args_UNIX(struct ia64_args *args, void **rvalue, { size_t sz = (*p_arg)->size; unsigned short element_type; - z = ((*p_arg)->size + SIZEOF_ARG - 1)/SIZEOF_ARG; + z = ((*p_arg)->size + FFI_SIZEOF_ARG - 1)/FFI_SIZEOF_ARG; if (is_homogeneous_fp_aggregate(*p_arg, 8, &element_type)) { int nelements = sz/float_type_size(element_type); if (nelements + fp_reg_num >= 8) { diff --git a/libffi/src/ia64/unix.S b/libffi/src/ia64/unix.S index e599268c721..c0c5058b76e 100644 --- a/libffi/src/ia64/unix.S +++ b/libffi/src/ia64/unix.S @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------- - unix.S - Copyright (c) 1998 Cygnus Solutions + unix.S - Copyright (c) 1998 Red Hat, Inc. Copyright (c) 2000 Hewlett Packard Company IA64/unix Foreign Function Interface @@ -29,6 +29,7 @@ ----------------------------------------------------------------------- */ #define LIBFFI_ASM +#include #include #include "ia64_flags.h" diff --git a/libffi/src/java_raw_api.c b/libffi/src/java_raw_api.c index c3b3b8226d8..e4664112b11 100644 --- a/libffi/src/java_raw_api.c +++ b/libffi/src/java_raw_api.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------- - java_raw_api.c - Copyright (c) 1999 Cygnus Solutions + java_raw_api.c - Copyright (c) 1999 Red Hat, Inc. Cloned from raw_api.c @@ -54,13 +54,13 @@ ffi_java_raw_size (ffi_cif *cif) case FFI_TYPE_UINT64: case FFI_TYPE_SINT64: case FFI_TYPE_DOUBLE: - result += 2 * SIZEOF_ARG; + result += 2 * FFI_SIZEOF_ARG; break; case FFI_TYPE_STRUCT: /* No structure parameters in Java. */ abort(); default: - result += SIZEOF_ARG; + result += FFI_SIZEOF_ARG; } } @@ -90,7 +90,7 @@ ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args) *args = (void*) ((char*)(raw++) + 2); break; -#if SIZEOF_ARG == 8 +#if FFI_SIZEOF_ARG == 8 case FFI_TYPE_UINT64: case FFI_TYPE_SINT64: case FFI_TYPE_DOUBLE: @@ -105,7 +105,7 @@ ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args) default: *args = raw; - raw += ALIGN ((*tp)->size, SIZEOF_ARG) / SIZEOF_ARG; + raw += ALIGN ((*tp)->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG; } } @@ -116,7 +116,7 @@ ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args) /* then assume little endian */ for (i = 0; i < cif->nargs; i++, tp++, args++) { -#if SIZEOF_ARG == 8 +#if FFI_SIZEOF_ARG == 8 switch((*tp)->type) { case FFI_TYPE_UINT64: case FFI_TYPE_SINT64: @@ -127,10 +127,10 @@ ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args) default: *args = (void*) raw++; } -#else /* SIZEOF_ARG != 8 */ +#else /* FFI_SIZEOF_ARG != 8 */ *args = (void*) raw; raw += ALIGN ((*tp)->size, sizeof (void*)) / sizeof (void*); -#endif /* SIZEOF_ARG == 8 */ +#endif /* FFI_SIZEOF_ARG == 8 */ } #else @@ -202,7 +202,7 @@ ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw) (raw++)->flt = *(FLOAT32*) (*args); break; -#if SIZEOF_ARG == 8 +#if FFI_SIZEOF_ARG == 8 case FFI_TYPE_UINT64: case FFI_TYPE_SINT64: case FFI_TYPE_DOUBLE: @@ -216,11 +216,11 @@ ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw) break; default: -#if SIZEOF_ARG == 8 +#if FFI_SIZEOF_ARG == 8 FFI_ASSERT(FALSE); /* Should have covered all cases */ #else memcpy ((void*) raw->data, (void*)*args, (*tp)->size); - raw += ALIGN ((*tp)->size, SIZEOF_ARG) / SIZEOF_ARG; + raw += ALIGN ((*tp)->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG; #endif } } @@ -231,7 +231,7 @@ ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw) static void ffi_java_rvalue_to_raw (ffi_cif *cif, void *rvalue) { -#if WORDS_BIGENDIAN && SIZEOF_ARG == 8 +#if WORDS_BIGENDIAN && FFI_SIZEOF_ARG == 8 switch (cif->rtype->type) { case FFI_TYPE_UINT8: @@ -256,7 +256,7 @@ ffi_java_rvalue_to_raw (ffi_cif *cif, void *rvalue) static void ffi_java_raw_to_rvalue (ffi_cif *cif, void *rvalue) { -#if WORDS_BIGENDIAN && SIZEOF_ARG == 8 +#if WORDS_BIGENDIAN && FFI_SIZEOF_ARG == 8 switch (cif->rtype->type) { case FFI_TYPE_UINT8: diff --git a/libffi/src/m68k/sysv.S b/libffi/src/m68k/sysv.S index a925d99e3ce..d019a377e5b 100644 --- a/libffi/src/m68k/sysv.S +++ b/libffi/src/m68k/sysv.S @@ -5,6 +5,7 @@ ----------------------------------------------------------------------- */ #define LIBFFI_ASM +#include #include .text diff --git a/libffi/src/mips/ffi.c b/libffi/src/mips/ffi.c index 01ad20e4c0d..cc2078bc7e2 100644 --- a/libffi/src/mips/ffi.c +++ b/libffi/src/mips/ffi.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------- - ffi.c - Copyright (c) 1996 Cygnus Solutions + ffi.c - Copyright (c) 1996 Red Hat, Inc. MIPS Foreign Function Interface @@ -23,7 +23,6 @@ OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ -#include #include #include @@ -59,8 +58,8 @@ static void ffi_prep_args(char *stack, /* If more than 8 double words are used, the remainder go on the stack. We reorder stuff on the stack here to support this easily. */ - if (bytes > 8 * SIZEOF_ARG) - argp = &stack[bytes - (8 * SIZEOF_ARG)]; + if (bytes > 8 * FFI_SIZEOF_ARG) + argp = &stack[bytes - (8 * FFI_SIZEOF_ARG)]; else argp = stack; #else @@ -75,8 +74,8 @@ static void ffi_prep_args(char *stack, if ( ecif->cif->rtype->type == FFI_TYPE_STRUCT ) #endif { - *(SLOT_TYPE_UNSIGNED *) argp = (SLOT_TYPE_UNSIGNED) ecif->rvalue; - argp += sizeof(SLOT_TYPE_UNSIGNED); + *(ffi_arg *) argp = (ffi_arg) ecif->rvalue; + argp += sizeof(ffi_arg); FIX_ARGP; } @@ -99,9 +98,9 @@ static void ffi_prep_args(char *stack, #endif z = (*p_arg)->size; - if (z < sizeof(SLOT_TYPE_UNSIGNED)) + if (z < sizeof(ffi_arg)) { - z = sizeof(SLOT_TYPE_UNSIGNED); + z = sizeof(ffi_arg); switch ((*p_arg)->type) { diff --git a/libffi/src/mips/n32.S b/libffi/src/mips/n32.S index 04b5e40b41f..767fa52bd5c 100644 --- a/libffi/src/mips/n32.S +++ b/libffi/src/mips/n32.S @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------- - n32.S - Copyright (c) 1996, 1998 Cygnus Solutions + n32.S - Copyright (c) 1996, 1998 Red Hat, Inc. MIPS Foreign Function Interface @@ -24,6 +24,7 @@ ----------------------------------------------------------------------- */ #define LIBFFI_ASM +#include #include /* Only build this code if we are compiling for n32 */ @@ -36,7 +37,7 @@ #define raddr a4 #define fn a5 -#define SIZEOF_FRAME ( 8 * SIZEOF_ARG ) +#define SIZEOF_FRAME ( 8 * FFI_SIZEOF_ARG ) .text .align 2 @@ -46,37 +47,37 @@ ffi_call_N32: # Prologue SUBU $sp, SIZEOF_FRAME # Frame size - REG_S $fp, SIZEOF_FRAME - 2*SIZEOF_ARG($sp) # Save frame pointer - REG_S ra, SIZEOF_FRAME - 1*SIZEOF_ARG($sp) # Save return address + REG_S $fp, SIZEOF_FRAME - 2*FFI_SIZEOF_ARG($sp) # Save frame pointer + REG_S ra, SIZEOF_FRAME - 1*FFI_SIZEOF_ARG($sp) # Save return address move $fp, $sp move t9, callback # callback function pointer - REG_S bytes, 2*SIZEOF_ARG($fp) # bytes - REG_S flags, 3*SIZEOF_ARG($fp) # flags - REG_S raddr, 4*SIZEOF_ARG($fp) # raddr - REG_S fn, 5*SIZEOF_ARG($fp) # fn + REG_S bytes, 2*FFI_SIZEOF_ARG($fp) # bytes + REG_S flags, 3*FFI_SIZEOF_ARG($fp) # flags + REG_S raddr, 4*FFI_SIZEOF_ARG($fp) # raddr + REG_S fn, 5*FFI_SIZEOF_ARG($fp) # fn # Allocate at least 4 words in the argstack move v0, bytes - bge bytes, 4 * SIZEOF_ARG, bigger - LI v0, 4 * SIZEOF_ARG + bge bytes, 4 * FFI_SIZEOF_ARG, bigger + LI v0, 4 * FFI_SIZEOF_ARG b sixteen bigger: - ADDU t4, v0, 2 * SIZEOF_ARG -1 # make sure it is aligned - and v0, t4, -2 * SIZEOF_ARG # to a proper boundry. + ADDU t4, v0, 2 * FFI_SIZEOF_ARG -1 # make sure it is aligned + and v0, t4, -2 * FFI_SIZEOF_ARG # to a proper boundry. sixteen: SUBU $sp, $sp, v0 # move the stack pointer to reflect the # arg space - ADDU a0, $sp, 0 # 4 * SIZEOF_ARG - ADDU a3, $fp, 3 * SIZEOF_ARG + ADDU a0, $sp, 0 # 4 * FFI_SIZEOF_ARG + ADDU a3, $fp, 3 * FFI_SIZEOF_ARG # Call ffi_prep_args jal t9 - # ADDU $sp, $sp, 4 * SIZEOF_ARG # adjust $sp to new args + # ADDU $sp, $sp, 4 * FFI_SIZEOF_ARG # adjust $sp to new args # Copy the stack pointer to t9 move t9, $sp @@ -85,10 +86,10 @@ sixteen: # of arguments. # Load the number of bytes - REG_L t6, 2*SIZEOF_ARG($fp) + REG_L t6, 2*FFI_SIZEOF_ARG($fp) - # Is it bigger than 8 * SIZEOF_ARG? - dadd t7, $0, 8 * SIZEOF_ARG + # Is it bigger than 8 * FFI_SIZEOF_ARG? + dadd t7, $0, 8 * FFI_SIZEOF_ARG dsub t8, t6, t7 bltz t8, loadregs @@ -96,125 +97,125 @@ sixteen: loadregs: - REG_L t4, 3*SIZEOF_ARG($fp) # load the flags word + REG_L t4, 3*FFI_SIZEOF_ARG($fp) # load the flags word add t6, t4, 0 # and copy it into t6 and t4, ((1< #include /* Only build this code if we are compiling for o32 */ @@ -34,7 +35,7 @@ #define bytes a2 #define flags a3 -#define SIZEOF_FRAME ( 4 * SIZEOF_ARG + 2 * SIZEOF_ARG ) +#define SIZEOF_FRAME ( 4 * FFI_SIZEOF_ARG + 2 * FFI_SIZEOF_ARG ) .text .align 2 @@ -44,114 +45,114 @@ ffi_call_O32: # Prologue SUBU $sp, SIZEOF_FRAME # Frame size - REG_S $fp, SIZEOF_FRAME - 2*SIZEOF_ARG($sp) # Save frame pointer - REG_S ra, SIZEOF_FRAME - 1*SIZEOF_ARG($sp) # Save return address + REG_S $fp, SIZEOF_FRAME - 2*FFI_SIZEOF_ARG($sp) # Save frame pointer + REG_S ra, SIZEOF_FRAME - 1*FFI_SIZEOF_ARG($sp) # Save return address move $fp, $sp move t9, callback # callback function pointer - REG_S flags, SIZEOF_FRAME + 3*SIZEOF_ARG($fp) # flags + REG_S flags, SIZEOF_FRAME + 3*FFI_SIZEOF_ARG($fp) # flags # Allocate at least 4 words in the argstack move v0, bytes - bge bytes, 4 * SIZEOF_ARG, bigger - LI v0, 4 * SIZEOF_ARG + bge bytes, 4 * FFI_SIZEOF_ARG, bigger + LI v0, 4 * FFI_SIZEOF_ARG b sixteen bigger: - ADDU t0, v0, 2 * SIZEOF_ARG -1 # make sure it is aligned - and v0, t0, -2 * SIZEOF_ARG # to an 8 byte boundry + ADDU t0, v0, 2 * FFI_SIZEOF_ARG -1 # make sure it is aligned + and v0, t0, -2 * FFI_SIZEOF_ARG # to an 8 byte boundry sixteen: SUBU $sp, $sp, v0 # move the stack pointer to reflect the # arg space - ADDU a0, $sp, 4 * SIZEOF_ARG - ADDU a3, $fp, SIZEOF_FRAME + 3*SIZEOF_ARG + ADDU a0, $sp, 4 * FFI_SIZEOF_ARG + ADDU a3, $fp, SIZEOF_FRAME + 3*FFI_SIZEOF_ARG jal t9 - REG_L t0, SIZEOF_FRAME + 3*SIZEOF_ARG($fp) # load the flags word + REG_L t0, SIZEOF_FRAME + 3*FFI_SIZEOF_ARG($fp) # load the flags word add t2, t0, 0 # and copy it into t2 and t0, ((1<<4)-1) # mask out the return type SRL t2, 4 # shift our arg info - ADDU $sp, $sp, 4 * SIZEOF_ARG # adjust $sp to new args + ADDU $sp, $sp, 4 * FFI_SIZEOF_ARG # adjust $sp to new args bnez t0, pass_d # make it quick for int - REG_L a0, 0*SIZEOF_ARG($sp) # just go ahead and load the - REG_L a1, 1*SIZEOF_ARG($sp) # four regs. - REG_L a2, 2*SIZEOF_ARG($sp) - REG_L a3, 3*SIZEOF_ARG($sp) + REG_L a0, 0*FFI_SIZEOF_ARG($sp) # just go ahead and load the + REG_L a1, 1*FFI_SIZEOF_ARG($sp) # four regs. + REG_L a2, 2*FFI_SIZEOF_ARG($sp) + REG_L a3, 3*FFI_SIZEOF_ARG($sp) b call_it pass_d: bne t0, FFI_ARGS_D, pass_f - l.d $f12, 0*SIZEOF_ARG($sp) # load $fp regs from args - REG_L a2, 2*SIZEOF_ARG($sp) # passing a double - REG_L a3, 3*SIZEOF_ARG($sp) + l.d $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args + REG_L a2, 2*FFI_SIZEOF_ARG($sp) # passing a double + REG_L a3, 3*FFI_SIZEOF_ARG($sp) b call_it pass_f: bne t0, FFI_ARGS_F, pass_d_d - l.s $f12, 0*SIZEOF_ARG($sp) # load $fp regs from args - REG_L a1, 1*SIZEOF_ARG($sp) # passing a float - REG_L a2, 2*SIZEOF_ARG($sp) - REG_L a3, 3*SIZEOF_ARG($sp) + l.s $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args + REG_L a1, 1*FFI_SIZEOF_ARG($sp) # passing a float + REG_L a2, 2*FFI_SIZEOF_ARG($sp) + REG_L a3, 3*FFI_SIZEOF_ARG($sp) b call_it pass_d_d: bne t0, FFI_ARGS_DD, pass_f_f - l.d $f12, 0*SIZEOF_ARG($sp) # load $fp regs from args - l.d $f14, 2*SIZEOF_ARG($sp) # passing two doubles + l.d $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args + l.d $f14, 2*FFI_SIZEOF_ARG($sp) # passing two doubles b call_it pass_f_f: bne t0, FFI_ARGS_FF, pass_d_f - l.s $f12, 0*SIZEOF_ARG($sp) # load $fp regs from args - l.s $f14, 1*SIZEOF_ARG($sp) # passing two floats - REG_L a2, 2*SIZEOF_ARG($sp) - REG_L a3, 3*SIZEOF_ARG($sp) + l.s $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args + l.s $f14, 1*FFI_SIZEOF_ARG($sp) # passing two floats + REG_L a2, 2*FFI_SIZEOF_ARG($sp) + REG_L a3, 3*FFI_SIZEOF_ARG($sp) b call_it pass_d_f: bne t0, FFI_ARGS_DF, pass_f_d - l.d $f12, 0*SIZEOF_ARG($sp) # load $fp regs from args - l.s $f14, 2*SIZEOF_ARG($sp) # passing double and float - REG_L a3, 3*SIZEOF_ARG($sp) + l.d $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args + l.s $f14, 2*FFI_SIZEOF_ARG($sp) # passing double and float + REG_L a3, 3*FFI_SIZEOF_ARG($sp) b call_it pass_f_d: # assume that the only other combination must be float then double # bne t0, FFI_ARGS_F_D, call_it - l.s $f12, 0*SIZEOF_ARG($sp) # load $fp regs from args - l.d $f14, 2*SIZEOF_ARG($sp) # passing double and float + l.s $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args + l.d $f14, 2*FFI_SIZEOF_ARG($sp) # passing double and float call_it: # Load the function pointer - REG_L t9, SIZEOF_FRAME + 5*SIZEOF_ARG($fp) + REG_L t9, SIZEOF_FRAME + 5*FFI_SIZEOF_ARG($fp) # If the return value pointer is NULL, assume no return value. - REG_L t1, SIZEOF_FRAME + 4*SIZEOF_ARG($fp) + REG_L t1, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp) beqz t1, noretval bne t2, FFI_TYPE_INT, retfloat jal t9 - REG_L t0, SIZEOF_FRAME + 4*SIZEOF_ARG($fp) + REG_L t0, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp) REG_S v0, 0(t0) b epilogue retfloat: bne t2, FFI_TYPE_FLOAT, retdouble jal t9 - REG_L t0, SIZEOF_FRAME + 4*SIZEOF_ARG($fp) + REG_L t0, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp) s.s $f0, 0(t0) b epilogue retdouble: bne t2, FFI_TYPE_DOUBLE, noretval jal t9 - REG_L t0, SIZEOF_FRAME + 4*SIZEOF_ARG($fp) + REG_L t0, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp) s.d $f0, 0(t0) b epilogue @@ -161,8 +162,8 @@ noretval: # Epilogue epilogue: move $sp, $fp - REG_L $fp, SIZEOF_FRAME - 2*SIZEOF_ARG($sp) # Restore frame pointer - REG_L ra, SIZEOF_FRAME - 1*SIZEOF_ARG($sp) # Restore return address + REG_L $fp, SIZEOF_FRAME - 2*FFI_SIZEOF_ARG($sp) # Restore frame pointer + REG_L ra, SIZEOF_FRAME - 1*FFI_SIZEOF_ARG($sp) # Restore return address ADDU $sp, SIZEOF_FRAME # Fix stack pointer j ra diff --git a/libffi/src/powerpc/aix.S b/libffi/src/powerpc/aix.S index 1346fb200c0..590717f6f55 100644 --- a/libffi/src/powerpc/aix.S +++ b/libffi/src/powerpc/aix.S @@ -80,6 +80,7 @@ .set f21,21 #define LIBFFI_ASM +#include #include #define JUMPTARGET(name) name #define L(x) x diff --git a/libffi/src/powerpc/darwin.S b/libffi/src/powerpc/darwin.S index 712252666fd..70c48e531d9 100644 --- a/libffi/src/powerpc/darwin.S +++ b/libffi/src/powerpc/darwin.S @@ -24,6 +24,7 @@ ----------------------------------------------------------------------- */ #define LIBFFI_ASM +#include #include #define JUMPTARGET(name) name #define L(x) x diff --git a/libffi/src/powerpc/ffi_darwin.c b/libffi/src/powerpc/ffi_darwin.c index aafe1aa704e..39b3cbb8c4a 100644 --- a/libffi/src/powerpc/ffi_darwin.c +++ b/libffi/src/powerpc/ffi_darwin.c @@ -25,6 +25,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ + #include #include diff --git a/libffi/src/powerpc/linux64.S b/libffi/src/powerpc/linux64.S index 22079807720..f12d4ec0004 100644 --- a/libffi/src/powerpc/linux64.S +++ b/libffi/src/powerpc/linux64.S @@ -24,6 +24,7 @@ ----------------------------------------------------------------------- */ #define LIBFFI_ASM +#include #include #ifdef __powerpc64__ diff --git a/libffi/src/powerpc/linux64_closure.S b/libffi/src/powerpc/linux64_closure.S index 2d44d67c20f..db78ea6e822 100644 --- a/libffi/src/powerpc/linux64_closure.S +++ b/libffi/src/powerpc/linux64_closure.S @@ -1,4 +1,5 @@ #define LIBFFI_ASM +#include #include .file "linux64_closure.S" diff --git a/libffi/src/powerpc/ppc_closure.S b/libffi/src/powerpc/ppc_closure.S index 72c59e812e3..dce9daba6b1 100644 --- a/libffi/src/powerpc/ppc_closure.S +++ b/libffi/src/powerpc/ppc_closure.S @@ -1,4 +1,5 @@ #define LIBFFI_ASM +#include #include #include diff --git a/libffi/src/powerpc/sysv.S b/libffi/src/powerpc/sysv.S index c045c779dfc..a7aaa3f8c8a 100644 --- a/libffi/src/powerpc/sysv.S +++ b/libffi/src/powerpc/sysv.S @@ -26,6 +26,7 @@ ----------------------------------------------------------------------- */ #define LIBFFI_ASM +#include #include #include diff --git a/libffi/src/prep_cif.c b/libffi/src/prep_cif.c index d60d98ee9f5..f43ccfc4558 100644 --- a/libffi/src/prep_cif.c +++ b/libffi/src/prep_cif.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------- - prep_cif.c - Copyright (c) 1996, 1998 Cygnus Solutions + prep_cif.c - Copyright (c) 1996, 1998 Red Hat, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -26,9 +26,9 @@ #include -/* Round up to SIZEOF_ARG. */ +/* Round up to FFI_SIZEOF_ARG. */ -#define STACK_ARG_SIZE(x) ALIGN(x, SIZEOF_ARG) +#define STACK_ARG_SIZE(x) ALIGN(x, FFI_SIZEOF_ARG) /* Perform machine independent initialization of aggregate type specifications. */ @@ -53,7 +53,7 @@ static ffi_status initialize_aggregate(/*@out@*/ ffi_type *arg) return FFI_BAD_TYPEDEF; /* Perform a sanity check on the argument type */ - FFI_ASSERT(ffi_type_test((*ptr))); + FFI_ASSERT_VALID_TYPE(*ptr); arg->size = ALIGN(arg->size, (*ptr)->alignment); arg->size += (*ptr)->size; @@ -94,7 +94,7 @@ ffi_status ffi_prep_cif(/*@out@*/ /*@partial@*/ ffi_cif *cif, ffi_type **ptr; FFI_ASSERT(cif != NULL); - FFI_ASSERT((abi > FFI_FIRST_ABI) && (abi < FFI_LAST_ABI)); + FFI_ASSERT((abi > FFI_FIRST_ABI) && (abi <= FFI_DEFAULT_ABI)); cif->abi = abi; cif->arg_types = atypes; @@ -110,7 +110,7 @@ ffi_status ffi_prep_cif(/*@out@*/ /*@partial@*/ ffi_cif *cif, /*@=usedef@*/ /* Perform a sanity check on the return type */ - FFI_ASSERT(ffi_type_test(cif->rtype)); + FFI_ASSERT_VALID_TYPE(cif->rtype); /* x86-64 and s390 stack space allocation is handled in prep_machdep. */ #if !defined M68K && !defined __x86_64__ && !defined S390 @@ -126,7 +126,7 @@ ffi_status ffi_prep_cif(/*@out@*/ /*@partial@*/ ffi_cif *cif, for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++) { /* Perform a sanity check on the argument type */ - FFI_ASSERT(ffi_type_test(*ptr)); + FFI_ASSERT_VALID_TYPE(*ptr); /* Initialize any uninitialized aggregate type definitions */ if (((*ptr)->size == 0) && (initialize_aggregate((*ptr)) != FFI_OK)) diff --git a/libffi/src/raw_api.c b/libffi/src/raw_api.c index 45cb0043c4d..f4f4d80b152 100644 --- a/libffi/src/raw_api.c +++ b/libffi/src/raw_api.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------- - raw_api.c - Copyright (c) 1999 Cygnus Solutions + raw_api.c - Copyright (c) 1999 Red Hat, Inc. Author: Kresten Krab Thorup @@ -44,10 +44,10 @@ ffi_raw_size (ffi_cif *cif) { #if !FFI_NO_STRUCTS if ((*at)->type == FFI_TYPE_STRUCT) - result += ALIGN (sizeof (void*), SIZEOF_ARG); + result += ALIGN (sizeof (void*), FFI_SIZEOF_ARG); else #endif - result += ALIGN ((*at)->size, SIZEOF_ARG); + result += ALIGN ((*at)->size, FFI_SIZEOF_ARG); } return result; @@ -68,18 +68,18 @@ ffi_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args) { case FFI_TYPE_UINT8: case FFI_TYPE_SINT8: - *args = (void*) ((char*)(raw++) + SIZEOF_ARG - 1); + *args = (void*) ((char*)(raw++) + FFI_SIZEOF_ARG - 1); break; case FFI_TYPE_UINT16: case FFI_TYPE_SINT16: - *args = (void*) ((char*)(raw++) + SIZEOF_ARG - 2); + *args = (void*) ((char*)(raw++) + FFI_SIZEOF_ARG - 2); break; -#if SIZEOF_ARG >= 4 +#if FFI_SIZEOF_ARG >= 4 case FFI_TYPE_UINT32: case FFI_TYPE_SINT32: - *args = (void*) ((char*)(raw++) + SIZEOF_ARG - 4); + *args = (void*) ((char*)(raw++) + FFI_SIZEOF_ARG - 4); break; #endif @@ -95,7 +95,7 @@ ffi_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args) default: *args = raw; - raw += ALIGN ((*tp)->size, SIZEOF_ARG) / SIZEOF_ARG; + raw += ALIGN ((*tp)->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG; } } @@ -152,7 +152,7 @@ ffi_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw) (raw++)->sint = *(SINT16*) (*args); break; -#if SIZEOF_ARG >= 4 +#if FFI_SIZEOF_ARG >= 4 case FFI_TYPE_UINT32: (raw++)->uint = *(UINT32*) (*args); break; @@ -174,7 +174,7 @@ ffi_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw) default: memcpy ((void*) raw->data, (void*)*args, (*tp)->size); - raw += ALIGN ((*tp)->size, SIZEOF_ARG) / SIZEOF_ARG; + raw += ALIGN ((*tp)->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG; } } } diff --git a/libffi/src/s390/sysv.S b/libffi/src/s390/sysv.S index ac14fa751af..e9cbed977a9 100644 --- a/libffi/src/s390/sysv.S +++ b/libffi/src/s390/sysv.S @@ -24,6 +24,7 @@ ----------------------------------------------------------------------- */ #define LIBFFI_ASM +#include #include #ifndef __s390x__ diff --git a/libffi/src/sh/sysv.S b/libffi/src/sh/sysv.S index ab98a8af433..a7121c5425b 100644 --- a/libffi/src/sh/sysv.S +++ b/libffi/src/sh/sysv.S @@ -24,6 +24,7 @@ ----------------------------------------------------------------------- */ #define LIBFFI_ASM +#include #include #ifdef HAVE_MACHINE_ASM_H #include diff --git a/libffi/src/sh64/sysv.S b/libffi/src/sh64/sysv.S index e478ced57fe..949f69f9884 100644 --- a/libffi/src/sh64/sysv.S +++ b/libffi/src/sh64/sysv.S @@ -24,6 +24,7 @@ ----------------------------------------------------------------------- */ #define LIBFFI_ASM +#include #include #ifdef HAVE_MACHINE_ASM_H #include diff --git a/libffi/src/sparc/ffi.c b/libffi/src/sparc/ffi.c index 3c71771f745..a08e65ac571 100644 --- a/libffi/src/sparc/ffi.c +++ b/libffi/src/sparc/ffi.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------- - ffi.c - Copyright (c) 1996, 2003 Cygnus Solutions + ffi.c - Copyright (c) 1996, 2003 Red Hat, Inc. Sparc Foreign Function Interface @@ -491,7 +491,7 @@ ffi_closure_sparc_inner(ffi_closure *closure, while (i < avn) { /* Assume big-endian. FIXME */ - argn += ALIGN(arg_types[i]->size, SIZEOF_ARG) / SIZEOF_ARG; + argn += ALIGN(arg_types[i]->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG; #ifdef SPARC64 if (i < 16 && (arg_types[i]->type == FFI_TYPE_FLOAT diff --git a/libffi/src/sparc/v8.S b/libffi/src/sparc/v8.S index e9db51b0456..880aae1f69e 100644 --- a/libffi/src/sparc/v8.S +++ b/libffi/src/sparc/v8.S @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------- - v8.S - Copyright (c) 1996, 1997, 2003 Cygnus Solutions + v8.S - Copyright (c) 1996, 1997, 2003 Red Hat, Inc. Sparc Foreign Function Interface @@ -24,6 +24,7 @@ ----------------------------------------------------------------------- */ #define LIBFFI_ASM +#include #include #define STACKFRAME 96 /* Minimum stack framesize for SPARC */ diff --git a/libffi/src/sparc/v9.S b/libffi/src/sparc/v9.S index 20ce0f4b57f..03b487bb54d 100644 --- a/libffi/src/sparc/v9.S +++ b/libffi/src/sparc/v9.S @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------- - v9.S - Copyright (c) 2000, 2003 Cygnus Solutions + v9.S - Copyright (c) 2000, 2003 Red Hat, Inc. Sparc 64bit Foreign Function Interface @@ -24,6 +24,7 @@ ----------------------------------------------------------------------- */ #define LIBFFI_ASM +#include #include #ifdef SPARC64 diff --git a/libffi/src/types.c b/libffi/src/types.c index eec282d4b69..df32190d115 100644 --- a/libffi/src/types.c +++ b/libffi/src/types.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------- - types.c - Copyright (c) 1996, 1998 Cygnus Solutions + types.c - Copyright (c) 1996, 1998 Red Hat, Inc. Predefined ffi_types needed by libffi. diff --git a/libffi/src/x86/ffi64.c b/libffi/src/x86/ffi64.c index 9427a37c8b5..905ed6f1b87 100644 --- a/libffi/src/x86/ffi64.c +++ b/libffi/src/x86/ffi64.c @@ -689,7 +689,7 @@ ffi_closure_UNIX64_inner(ffi_closure *closure, va_list l, void *rp) FFI_ASSERT(0); } - argn += ALIGN(arg_types[i]->size, SIZEOF_ARG) / SIZEOF_ARG; + argn += ALIGN(arg_types[i]->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG; i++; } diff --git a/libffi/src/x86/sysv.S b/libffi/src/x86/sysv.S index 8ce2d87ba38..53a4c2b7e98 100644 --- a/libffi/src/x86/sysv.S +++ b/libffi/src/x86/sysv.S @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------- - sysv.S - Copyright (c) 1996, 1998, 2001, 2002, 2003 Cygnus Solutions + sysv.S - Copyright (c) 1996, 1998, 2001, 2002, 2003 Red Hat, Inc. X86 Foreign Function Interface @@ -26,6 +26,7 @@ #ifndef __x86_64__ #define LIBFFI_ASM +#include #include .text diff --git a/libffi/src/x86/unix64.S b/libffi/src/x86/unix64.S index e39d60415b6..310fed71843 100644 --- a/libffi/src/x86/unix64.S +++ b/libffi/src/x86/unix64.S @@ -25,6 +25,7 @@ #ifdef __x86_64__ #define LIBFFI_ASM +#include #include .section .rodata diff --git a/libffi/src/x86/win32.S b/libffi/src/x86/win32.S index 796af18754b..40743af5893 100644 --- a/libffi/src/x86/win32.S +++ b/libffi/src/x86/win32.S @@ -27,6 +27,7 @@ ----------------------------------------------------------------------- */ #define LIBFFI_ASM +#include #include .text diff --git a/libffi/testsuite/Makefile.in b/libffi/testsuite/Makefile.in index 01f4bbd5f60..2314441899d 100644 --- a/libffi/testsuite/Makefile.in +++ b/libffi/testsuite/Makefile.in @@ -71,6 +71,7 @@ DLLTOOL = @DLLTOOL@ EXEEXT = @EXEEXT@ GCJ = @GCJ@ GCJFLAGS = @GCJFLAGS@ +HAVE_LONG_DOUBLE = @HAVE_LONG_DOUBLE@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ MAINT = @MAINT@