From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23836 invoked by alias); 4 Jun 2009 15:41:38 -0000 Received: (qmail 23653 invoked by uid 22791); 4 Jun 2009 15:41:26 -0000 X-SWARE-Spam-Status: No, hits=-1.1 required=5.0 tests=AWL,BAYES_20,J_CHICKENPOX_45,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 04 Jun 2009 15:41:15 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n54FfDub009392; Thu, 4 Jun 2009 11:41:13 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n54FfBXe008640; Thu, 4 Jun 2009 11:41:12 -0400 Received: from zebedee.pink (vpn-12-111.rdu.redhat.com [10.11.12.111]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n54Ff9XP008590; Thu, 4 Jun 2009 11:41:10 -0400 Message-ID: <4A27EB15.9090804@redhat.com> Date: Thu, 04 Jun 2009 15:41:00 -0000 From: Andrew Haley User-Agent: Thunderbird 2.0.0.17 (X11/20081009) MIME-Version: 1.0 To: Dave Korn CC: Anthony Green , Anthony Green , libffi-discuss@sourceware.org, gcc-patches , Java Patch List Subject: Re: libffi merge References: <4A255CF4.7030203@redhat.com> <4A265860.2050207@redhat.com> <4A26646A.80300@moxielogic.com> <4A26D4AC.8080507@redhat.com> <4A26DC78.6010508@redhat.com> <4A27A347.7070009@redhat.com> <4A27A508.2000409@redhat.com> <4A27A87F.2000405@redhat.com> <4A27C08D.9070801@moxielogic.com> <4A27C2B9.9050105@redhat.com> <4A27D82F.1030507@gmail.com> <4A27E2E4.2090902@redhat.com> In-Reply-To: <4A27E2E4.2090902@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact java-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-patches-owner@gcc.gnu.org X-SW-Source: 2009-q2/txt/msg00115.txt.bz2 Merge from libffi -> gcc. Mostly trivial changes to declarations and licence text, but also includes the change that uses __builtin___clear_cache on MIPS. Andrew. 2009-06-04 Andrew Haley * src/powerpc/ppc_closure.S: Insert licence header. * src/powerpc/linux64_closure.S: Likewise. * src/m68k/sysv.S: Likewise. * src/sh64/ffi.c: Change void (*)() to void (*)(void). * src/powerpc/ffi.c: Likewise. * src/powerpc/ffi_darwin.c: Likewise. * src/m32r/ffi.c: Likewise. * src/sh64/ffi.c: Likewise. * src/x86/ffi64.c: Likewise. * src/alpha/ffi.c: Likewise. * src/alpha/osf.S: Likewise. * src/frv/ffi.c: Likewise. * src/s390/ffi.c: Likewise. * src/pa/ffi.c: Likewise. * src/pa/hpux32.S: Likewise. * src/ia64/unix.S: Likewise. * src/ia64/ffi.c: Likewise. * src/sparc/ffi.c: Likewise. * src/mips/ffi.c: Likewise. * src/sh/ffi.c: Likewise. 2008-02-15 David Daney * src/mips/ffi.c (USE__BUILTIN___CLEAR_CACHE): Define (conditionally), and use it to include cachectl.h. (ffi_prep_closure_loc): Fix cache flushing. * src/mips/ffitarget.h (_ABIN32, _ABI64, _ABIO32): Define. Index: src/arm/ffi.c =================================================================== --- src/arm/ffi.c (revision 148171) +++ src/arm/ffi.c (working copy) @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------- - ffi.c - Copyright (c) 1998 Red Hat, Inc. + ffi.c - Copyright (c) 1998, 2008 Red Hat, Inc. ARM Foreign Function Interface @@ -149,9 +149,9 @@ } extern void ffi_call_SYSV(void (*)(char *, extended_cif *), extended_cif *, - unsigned, unsigned, unsigned *, void (*fn)()); + unsigned, unsigned, unsigned *, void (*fn)(void)); -void ffi_call(ffi_cif *cif, void (*fn)(), void *rvalue, void **avalue) +void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) { extended_cif ecif; Index: src/arm/sysv.S =================================================================== --- src/arm/sysv.S (revision 148171) +++ src/arm/sysv.S (working copy) @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------- - sysv.S - Copyright (c) 1998 Red Hat, Inc. + sysv.S - Copyright (c) 1998, 2008 Red Hat, Inc. ARM Foreign Function Interface Index: src/powerpc/ppc_closure.S =================================================================== --- src/powerpc/ppc_closure.S (revision 148170) +++ src/powerpc/ppc_closure.S (working copy) @@ -1,3 +1,29 @@ +/* ----------------------------------------------------------------------- + sysv.h - Copyright (c) 2003 Jakub Jelinek + Copyright (c) 2008 Red Hat, Inc. + + PowerPC Assembly glue. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ #define LIBFFI_ASM #include #include Index: src/powerpc/ffi.c =================================================================== --- src/powerpc/ffi.c (revision 148170) +++ src/powerpc/ffi.c (working copy) @@ -1,6 +1,7 @@ /* ----------------------------------------------------------------------- ffi.c - Copyright (c) 1998 Geoffrey Keating Copyright (C) 2007, 2008 Free Software Foundation, Inc + Copyright (C) 2008 Red Hat, Inc PowerPC Foreign Function Interface @@ -875,13 +876,13 @@ } extern void ffi_call_SYSV(extended_cif *, unsigned, unsigned, unsigned *, - void (*fn)()); + void (*fn)(void)); extern void FFI_HIDDEN ffi_call_LINUX64(extended_cif *, unsigned long, unsigned long, unsigned long *, - void (*fn)()); + void (*fn)(void)); void -ffi_call(ffi_cif *cif, void (*fn)(), void *rvalue, void **avalue) +ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) { extended_cif ecif; Index: src/powerpc/linux64_closure.S =================================================================== --- src/powerpc/linux64_closure.S (revision 148170) +++ src/powerpc/linux64_closure.S (working copy) @@ -1,3 +1,29 @@ +/* ----------------------------------------------------------------------- + sysv.h - Copyright (c) 2003 Jakub Jelinek + Copyright (c) 2008 Red Hat, Inc. + + PowerPC64 Assembly glue. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ #define LIBFFI_ASM #include #include @@ -204,3 +230,7 @@ .align 3 .LEFDE1: #endif + +#if defined __ELF__ && defined __linux__ + .section .note.GNU-stack,"",@progbits +#endif Index: src/powerpc/ffi_darwin.c =================================================================== --- src/powerpc/ffi_darwin.c (revision 148170) +++ src/powerpc/ffi_darwin.c (working copy) @@ -425,11 +425,11 @@ } extern void ffi_call_AIX(extended_cif *, unsigned, unsigned, unsigned *, - void (*fn)(), void (*fn2)()); + void (*fn)(void), void (*fn2)(void)); extern void ffi_call_DARWIN(extended_cif *, unsigned, unsigned, unsigned *, - void (*fn)(), void (*fn2)()); + void (*fn)(void), void (*fn2)(void)); -void ffi_call(ffi_cif *cif, void (*fn)(), void *rvalue, void **avalue) +void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) { extended_cif ecif; Index: src/powerpc/linux64.S =================================================================== --- src/powerpc/linux64.S (revision 148171) +++ src/powerpc/linux64.S (working copy) @@ -1,5 +1,6 @@ /* ----------------------------------------------------------------------- sysv.h - Copyright (c) 2003 Jakub Jelinek + Copyright (c) 2008 Red Hat, Inc. PowerPC64 Assembly glue. @@ -180,3 +181,7 @@ .align 3 .LEFDE1: #endif + +#if defined __ELF__ && defined __linux__ + .section .note.GNU-stack,"",@progbits +#endif Index: src/m32r/ffi.c =================================================================== --- src/m32r/ffi.c (revision 148170) +++ src/m32r/ffi.c (working copy) @@ -1,5 +1,6 @@ /* ----------------------------------------------------------------------- ffi.c - Copyright (c) 2004 Renesas Technology + Copyright (c) 2008 Red Hat, Inc. M32R Foreign Function Interface @@ -172,9 +173,9 @@ } extern void ffi_call_SYSV(void (*)(char *, extended_cif *), extended_cif *, - unsigned, unsigned, unsigned *, void (*fn)()); + unsigned, unsigned, unsigned *, void (*fn)(void)); -void ffi_call(ffi_cif *cif, void (*fn)(), void *rvalue, void **avalue) +void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) { extended_cif ecif; Index: src/sh64/ffi.c =================================================================== --- src/sh64/ffi.c (revision 148171) +++ src/sh64/ffi.c (working copy) @@ -1,5 +1,6 @@ /* ----------------------------------------------------------------------- ffi.c - Copyright (c) 2003, 2004, 2006, 2007 Kaz Kojima + Copyright (c) 2008 Anthony Green SuperH SHmedia Foreign Function Interface @@ -237,11 +238,20 @@ return FFI_OK; } -extern void ffi_call_SYSV(void (*)(char *, extended_cif *), extended_cif *, - unsigned, unsigned, long long, unsigned *, - void (*fn)()); - -void ffi_call(ffi_cif *cif, void (*fn)(), void *rvalue, void **avalue) +/*@-declundef@*/ +/*@-exportheader@*/ +extern void ffi_call_SYSV(void (*)(char *, extended_cif *), + /*@out@*/ extended_cif *, + unsigned, unsigned, long long, + /*@out@*/ unsigned *, + void (*fn)(void)); +/*@=declundef@*/ +/*@=exportheader@*/ + +void ffi_call(/*@dependent@*/ ffi_cif *cif, + void (*fn)(void), + /*@out@*/ void *rvalue, + /*@dependent@*/ void **avalue) { extended_cif ecif; UINT64 trvalue; Index: src/x86/darwin64.S =================================================================== --- src/x86/darwin64.S (revision 148170) +++ src/x86/darwin64.S (working copy) @@ -1,5 +1,6 @@ /* ----------------------------------------------------------------------- darwin64.S - Copyright (c) 2006 Free Software Foundation, Inc. + Copyright (c) 2008 Red Hat, Inc. derived from unix64.S x86-64 Foreign Function Interface for Darwin. @@ -33,7 +34,7 @@ .text /* ffi_call_unix64 (void *args, unsigned long bytes, unsigned flags, - void *raddr, void (*fnaddr)()); + void *raddr, void (*fnaddr)(void)); Bit o trickiness here -- ARGS+BYTES is the base of the stack frame for this function. This has been allocated by ffi_call. We also Index: src/x86/ffi64.c =================================================================== --- src/x86/ffi64.c (revision 148171) +++ src/x86/ffi64.c (working copy) @@ -1,5 +1,6 @@ /* ----------------------------------------------------------------------- ffi.c - Copyright (c) 2002, 2007 Bo Thorsen + Copyright (c) 2008 Red Hat, Inc. x86-64 Foreign Function Interface @@ -43,7 +44,7 @@ }; extern void ffi_call_unix64 (void *args, unsigned long bytes, unsigned flags, - void *raddr, void (*fnaddr)(), unsigned ssecount); + void *raddr, void (*fnaddr)(void), unsigned ssecount); /* All reference to register classes here is identical to the code in gcc/config/i386/i386.c. Do *not* change one without the other. */ @@ -340,7 +341,7 @@ } void -ffi_call (ffi_cif *cif, void (*fn)(), void *rvalue, void **avalue) +ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) { enum x86_64_reg_class classes[MAX_CLASSES]; char *stack, *argp; Index: src/x86/sysv.S =================================================================== --- src/x86/sysv.S (revision 148171) +++ src/x86/sysv.S (working copy) @@ -1,6 +1,5 @@ /* ----------------------------------------------------------------------- - sysv.S - Copyright (c) 1996, 1998, 2001, 2002, 2003, 2005, 2008 - Red Hat, Inc. + sysv.S - Copyright (c) 1996, 1998, 2001-2003, 2005, 2008 Red Hat, Inc. X86 Foreign Function Interface Index: src/x86/unix64.S =================================================================== --- src/x86/unix64.S (revision 148171) +++ src/x86/unix64.S (working copy) @@ -1,5 +1,6 @@ /* ----------------------------------------------------------------------- - unix64.S - Copyright (c) 2002, 2008 Bo Thorsen + unix64.S - Copyright (c) 2002 Bo Thorsen + Copyright (c) 2008 Red Hat, Inc x86-64 Foreign Function Interface @@ -32,7 +33,7 @@ .text /* ffi_call_unix64 (void *args, unsigned long bytes, unsigned flags, - void *raddr, void (*fnaddr)()); + void *raddr, void (*fnaddr)(void)); Bit o trickiness here -- ARGS+BYTES is the base of the stack frame for this function. This has been allocated by ffi_call. We also Index: src/alpha/ffi.c =================================================================== --- src/alpha/ffi.c (revision 148171) +++ src/alpha/ffi.c (working copy) @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------- - ffi.c - Copyright (c) 1998, 2001, 2007 Red Hat, Inc. + ffi.c - Copyright (c) 1998, 2001, 2007, 2008 Red Hat, Inc. Alpha Foreign Function Interface @@ -39,7 +39,7 @@ # define FFI_TYPE_LONGDOUBLE 4 #endif -extern void ffi_call_osf(void *, unsigned long, unsigned, void *, void (*)()) +extern void ffi_call_osf(void *, unsigned long, unsigned, void *, void (*)(void)) FFI_HIDDEN; extern void ffi_closure_osf(void) FFI_HIDDEN; @@ -76,7 +76,7 @@ void -ffi_call(ffi_cif *cif, void (*fn)(), void *rvalue, void **avalue) +ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) { unsigned long *stack, *argp; long i, avn; Index: src/alpha/osf.S =================================================================== --- src/alpha/osf.S (revision 148171) +++ src/alpha/osf.S (working copy) @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------- - osf.S - Copyright (c) 1998, 2001, 2007 Red Hat + osf.S - Copyright (c) 1998, 2001, 2007, 2008 Red Hat Alpha/OSF Foreign Function Interface @@ -32,7 +32,7 @@ .text /* ffi_call_osf (void *args, unsigned long bytes, unsigned flags, - void *raddr, void (*fnaddr)()); + void *raddr, void (*fnaddr)(void)); Bit o trickiness here -- ARGS+BYTES is the base of the stack frame for this function. This has been allocated by ffi_call. We also Index: src/m68k/sysv.S =================================================================== --- src/m68k/sysv.S (revision 148170) +++ src/m68k/sysv.S (working copy) @@ -1,7 +1,28 @@ /* ----------------------------------------------------------------------- - sysv.S + sysv.S - Copyright (c) 1998 Andreas Schwab + Copyright (c) 2008 Red Hat, Inc. m68k Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #define LIBFFI_ASM Index: src/frv/ffi.c =================================================================== --- src/frv/ffi.c (revision 148171) +++ src/frv/ffi.c (working copy) @@ -1,6 +1,7 @@ /* ----------------------------------------------------------------------- - ffi.c - Copyright (c) 2004 Anthony Green + ffi.c - Copyright (C) 2004 Anthony Green Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2008 Red Hat, Inc. FR-V Foreign Function Interface @@ -126,10 +127,10 @@ extended_cif *, unsigned, unsigned, unsigned *, - void (*fn)()); + void (*fn)(void)); void ffi_call(ffi_cif *cif, - void (*fn)(), + void (*fn)(void), void *rvalue, void **avalue) { Index: src/s390/ffi.c =================================================================== --- src/s390/ffi.c (revision 148170) +++ src/s390/ffi.c (working copy) @@ -1,5 +1,6 @@ /* ----------------------------------------------------------------------- ffi.c - Copyright (c) 2000, 2007 Software AG + Copyright (c) 2008 Red Hat, Inc S390 Foreign Function Interface @@ -88,7 +89,7 @@ void (*)(unsigned char *, extended_cif *), unsigned, void *, - void (*fn)()); + void (*fn)(void)); extern void ffi_closure_SYSV(void); @@ -498,7 +499,7 @@ void ffi_call(ffi_cif *cif, - void (*fn)(), + void (*fn)(void), void *rvalue, void **avalue) { Index: src/s390/sysv.S =================================================================== --- src/s390/sysv.S (revision 148171) +++ src/s390/sysv.S (working copy) @@ -1,5 +1,6 @@ /* ----------------------------------------------------------------------- sysv.S - Copyright (c) 2000 Software AG + Copyright (c) 2008 Red Hat, Inc. S390 Foreign Function Interface Index: src/pa/linux.S =================================================================== --- src/pa/linux.S (revision 148171) +++ src/pa/linux.S (working copy) @@ -1,5 +1,6 @@ /* ----------------------------------------------------------------------- linux.S - (c) 2003-2004 Randolph Chung + (c) 2008 Red Hat, Inc. HPPA Foreign Function Interface @@ -36,7 +37,7 @@ unsigned bytes, unsigned flags, unsigned *rvalue, - void (*fn)()); + void (*fn)(void)); */ .export ffi_call_pa32,code Index: src/pa/ffi.c =================================================================== --- src/pa/ffi.c (revision 148171) +++ src/pa/ffi.c (working copy) @@ -1,5 +1,6 @@ /* ----------------------------------------------------------------------- ffi.c - (c) 2003-2004 Randolph Chung + (c) 2008 Red Hat, Inc. HPPA Foreign Function Interface HP-UX PA ABI support (c) 2006 Free Software Foundation, Inc. @@ -368,9 +369,9 @@ extern void ffi_call_pa32(void (*)(UINT32 *, extended_cif *, unsigned), extended_cif *, unsigned, unsigned, unsigned *, - void (*fn)()); + void (*fn)(void)); -void ffi_call(ffi_cif *cif, void (*fn)(), void *rvalue, void **avalue) +void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) { extended_cif ecif; Index: src/pa/hpux32.S =================================================================== --- src/pa/hpux32.S (revision 148170) +++ src/pa/hpux32.S (working copy) @@ -1,5 +1,6 @@ /* ----------------------------------------------------------------------- hpux32.S - Copyright (c) 2006 Free Software Foundation, Inc. + (c) 2008 Red Hat, Inc. based on src/pa/linux.S HP-UX PA Foreign Function Interface @@ -40,7 +41,7 @@ unsigned bytes, unsigned flags, unsigned *rvalue, - void (*fn)()); + void (*fn)(void)); */ .export ffi_call_pa32,ENTRY,PRIV_LEV=3 Index: src/raw_api.c =================================================================== --- src/raw_api.c (revision 148171) +++ src/raw_api.c (working copy) @@ -1,10 +1,8 @@ /* ----------------------------------------------------------------------- - raw_api.c - Copyright (c) 1999 Red Hat, Inc. + raw_api.c - Copyright (c) 1999, 2008 Red Hat, Inc. Author: Kresten Krab Thorup - $Id $ - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including @@ -190,7 +188,7 @@ * these following couple of functions will handle the translation forth * and back automatically. */ -void ffi_raw_call (ffi_cif *cif, void (*fn)(), void *rvalue, ffi_raw *raw) +void ffi_raw_call (ffi_cif *cif, void (*fn)(void), void *rvalue, ffi_raw *raw) { void **avalue = (void**) alloca (cif->nargs * sizeof (void*)); ffi_raw_to_ptrarray (cif, raw, avalue); Index: src/ia64/unix.S =================================================================== --- src/ia64/unix.S (revision 148171) +++ src/ia64/unix.S (working copy) @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------- - unix.S - Copyright (c) 1998 Red Hat, Inc. + unix.S - Copyright (c) 1998, 2008 Red Hat, Inc. Copyright (c) 2000 Hewlett Packard Company IA64/unix Foreign Function Interface @@ -38,7 +38,7 @@ .text /* int ffi_call_unix (struct ia64_args *stack, PTR64 rvalue, - void (*fn)(), int flags); + void (*fn)(void), int flags); */ .align 16 @@ -554,3 +554,7 @@ data8 @pcrel(.Lld_hfa_float) // FFI_IA64_TYPE_HFA_FLOAT data8 @pcrel(.Lld_hfa_double) // FFI_IA64_TYPE_HFA_DOUBLE data8 @pcrel(.Lld_hfa_ldouble) // FFI_IA64_TYPE_HFA_LDOUBLE + +#if defined __ELF__ && defined __linux__ + .section .note.GNU-stack,"",@progbits +#endif Index: src/ia64/ffi.c =================================================================== --- src/ia64/ffi.c (revision 148171) +++ src/ia64/ffi.c (working copy) @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------- - ffi.c - Copyright (c) 1998, 2007 Red Hat, Inc. + ffi.c - Copyright (c) 1998, 2007, 2008 Red Hat, Inc. Copyright (c) 2000 Hewlett Packard Company IA64 Foreign Function Interface @@ -270,10 +270,10 @@ return FFI_OK; } -extern int ffi_call_unix (struct ia64_args *, PTR64, void (*)(), UINT64); +extern int ffi_call_unix (struct ia64_args *, PTR64, void (*)(void), UINT64); void -ffi_call(ffi_cif *cif, void (*fn)(), void *rvalue, void **avalue) +ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) { struct ia64_args *stack; long i, avn, gpcount, fpcount; Index: src/java_raw_api.c =================================================================== --- src/java_raw_api.c (revision 148171) +++ src/java_raw_api.c (working copy) @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------- - java_raw_api.c - Copyright (c) 1999, 2007 Red Hat, Inc. + java_raw_api.c - Copyright (c) 1999, 2007, 2008 Red Hat, Inc. Cloned from raw_api.c @@ -295,7 +295,7 @@ * these following couple of functions will handle the translation forth * and back automatically. */ -void ffi_java_raw_call (ffi_cif *cif, void (*fn)(), void *rvalue, +void ffi_java_raw_call (ffi_cif *cif, void (*fn)(void), void *rvalue, ffi_java_raw *raw) { void **avalue = (void**) alloca (cif->nargs * sizeof (void*)); Index: src/sparc/v9.S =================================================================== --- src/sparc/v9.S (revision 148171) +++ src/sparc/v9.S (working copy) @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------- - v9.S - Copyright (c) 2000, 2003, 2004 Red Hat, Inc. + v9.S - Copyright (c) 2000, 2003, 2004, 2008 Red Hat, Inc. SPARC 64-bit Foreign Function Interface Index: src/sparc/ffi.c =================================================================== --- src/sparc/ffi.c (revision 148171) +++ src/sparc/ffi.c (working copy) @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------- - ffi.c - Copyright (c) 1996, 2003, 2004, 2007 Red Hat, Inc. + ffi.c - Copyright (c) 1996, 2003, 2004, 2007, 2008 Red Hat, Inc. SPARC Foreign Function Interface @@ -369,13 +369,13 @@ #ifdef SPARC64 extern int ffi_call_v9(void *, extended_cif *, unsigned, - unsigned, unsigned *, void (*fn)()); + unsigned, unsigned *, void (*fn)(void)); #else extern int ffi_call_v8(void *, extended_cif *, unsigned, - unsigned, unsigned *, void (*fn)()); + unsigned, unsigned *, void (*fn)(void)); #endif -void ffi_call(ffi_cif *cif, void (*fn)(), void *rvalue, void **avalue) +void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) { extended_cif ecif; void *rval = rvalue; Index: src/sparc/v8.S =================================================================== --- src/sparc/v8.S (revision 148171) +++ src/sparc/v8.S (working copy) @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------- - v8.S - Copyright (c) 1996, 1997, 2003, 2004 Red Hat, Inc. + v8.S - Copyright (c) 1996, 1997, 2003, 2004, 2008 Red Hat, Inc. SPARC Foreign Function Interface Index: src/mips/ffitarget.h =================================================================== --- src/mips/ffitarget.h (revision 148171) +++ src/mips/ffitarget.h (working copy) @@ -27,6 +27,19 @@ #ifndef LIBFFI_TARGET_H #define LIBFFI_TARGET_H +#ifdef linux +#include +# ifndef _ABIN32 +# define _ABIN32 _MIPS_SIM_NABI32 +# endif +# ifndef _ABI64 +# define _ABI64 _MIPS_SIM_ABI64 +# endif +# ifndef _ABIO32 +# define _ABIO32 _MIPS_SIM_ABI32 +# endif +#endif + #if !defined(_MIPS_SIM) -- something is very wrong -- #else Index: src/mips/ffi.c =================================================================== --- src/mips/ffi.c (revision 148171) +++ src/mips/ffi.c (working copy) @@ -1,5 +1,6 @@ /* ----------------------------------------------------------------------- - ffi.c - Copyright (c) 1996, 2007 Red Hat, Inc. + ffi.c - Copyright (c) 1996, 2007, 2008 Red Hat, Inc. + Copyright (c) 2008 David Daney MIPS Foreign Function Interface @@ -29,6 +30,16 @@ #include +#ifdef __GNUC__ +# if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) +# define USE__BUILTIN___CLEAR_CACHE 1 +# endif +#endif + +#ifndef USE__BUILTIN___CLEAR_CACHE +#include +#endif + #ifdef FFI_DEBUG # define FFI_MIPS_STOP_HERE() ffi_stop_here() #else @@ -483,14 +494,14 @@ /* Low level routine for calling O32 functions */ extern int ffi_call_O32(void (*)(char *, extended_cif *, int, int), extended_cif *, unsigned, - unsigned, unsigned *, void (*)()); + unsigned, unsigned *, void (*)(void)); /* Low level routine for calling N32 functions */ extern int ffi_call_N32(void (*)(char *, extended_cif *, int, int), extended_cif *, unsigned, - unsigned, unsigned *, void (*)()); + unsigned, unsigned *, void (*)(void)); -void ffi_call(ffi_cif *cif, void (*fn)(), void *rvalue, void **avalue) +void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) { extended_cif ecif; @@ -616,8 +627,11 @@ closure->fun = fun; closure->user_data = user_data; +#ifdef USE__BUILTIN___CLEAR_CACHE __builtin___clear_cache(clear_location, clear_location + FFI_TRAMPOLINE_SIZE); - +#else + cacheflush (clear_location, FFI_TRAMPOLINE_SIZE, ICACHE); +#endif return FFI_OK; } Index: src/sh/ffi.c =================================================================== --- src/sh/ffi.c (revision 148171) +++ src/sh/ffi.c (working copy) @@ -1,6 +1,6 @@ /* ----------------------------------------------------------------------- - ffi.c - Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008 - Kaz Kojima + ffi.c - Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Kaz Kojima + Copyright (c) 2008 Red Hat, Inc. SuperH Foreign Function Interface @@ -407,9 +407,9 @@ } extern void ffi_call_SYSV(void (*)(char *, extended_cif *), extended_cif *, - unsigned, unsigned, unsigned *, void (*fn)()); + unsigned, unsigned, unsigned *, void (*fn)(void)); -void ffi_call(ffi_cif *cif, void (*fn)(), void *rvalue, void **avalue) +void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) { extended_cif ecif; UINT64 trvalue;