Index: ffcall/avcall/Makefile.in
diff -c ffcall/avcall/Makefile.in:1.1.1.1 ffcall/avcall/Makefile.in:1.2
*** ffcall/avcall/Makefile.in:1.1.1.1	Wed Dec 20 10:31:37 2000
--- ffcall/avcall/Makefile.in	Fri Dec 22 14:23:46 2000
***************
*** 114,120 ****
  	$(CPP) $(ASPFLAGS) $(srcdir)/avcall-arm.S | grep -v '^ *#line' | grep -v '^#' | sed -e 's,% ,%,g' -e 's,//,@,g' -e 's,\$$,#,g' > avcall-arm.s
  
  avcall-rs6000.lo : $(srcdir)/avcall-rs6000-aix.old.s $(srcdir)/avcall-rs6000-aix.new.s $(srcdir)/avcall-rs6000-sysv4.s
! 	case "$(OS)" in aix3*) syntax=aix.old;; aix*) syntax=aix.new;; *) syntax=sysv4;; esac; $(LIBTOOL_COMPILE) $(CC) @GCC_X_NONE@ -c $(srcdir)/avcall-rs6000-$${syntax}.s ; cp avcall-rs6000-$${syntax}.lo avcall-rs6000.lo ; rm -f avcall-rs6000-$${syntax}.lo ; if test -f avcall-rs6000-$${syntax}.o; then mv avcall-rs6000-$${syntax}.o avcall-rs6000.o; fi
  
  avcall-m88k.lo : $(srcdir)/avcall-m88k.s
  	$(LIBTOOL_COMPILE) $(CC) @GCC_X_NONE@ -c $(srcdir)/avcall-m88k.s
--- 114,120 ----
  	$(CPP) $(ASPFLAGS) $(srcdir)/avcall-arm.S | grep -v '^ *#line' | grep -v '^#' | sed -e 's,% ,%,g' -e 's,//,@,g' -e 's,\$$,#,g' > avcall-arm.s
  
  avcall-rs6000.lo : $(srcdir)/avcall-rs6000-aix.old.s $(srcdir)/avcall-rs6000-aix.new.s $(srcdir)/avcall-rs6000-sysv4.s
! 	case "$(OS)" in aix3*) syntax=aix.old;; aix*) syntax=aix.new;; linux*) syntax=linux;; *) syntax=sysv4;; esac; $(LIBTOOL_COMPILE) $(CC) @GCC_X_NONE@ -c $(srcdir)/avcall-rs6000-$${syntax}.s ; cp avcall-rs6000-$${syntax}.lo avcall-rs6000.lo ; rm -f avcall-rs6000-$${syntax}.lo ; if test -f avcall-rs6000-$${syntax}.o; then mv avcall-rs6000-$${syntax}.o avcall-rs6000.o; fi
  
  avcall-m88k.lo : $(srcdir)/avcall-m88k.s
  	$(LIBTOOL_COMPILE) $(CC) @GCC_X_NONE@ -c $(srcdir)/avcall-m88k.s
Index: ffcall/avcall/PLATFORMS
diff -c ffcall/avcall/PLATFORMS:1.1.1.1 ffcall/avcall/PLATFORMS:1.2
*** ffcall/avcall/PLATFORMS:1.1.1.1	Wed Dec 20 10:31:37 2000
--- ffcall/avcall/PLATFORMS	Fri Dec 22 14:23:46 2000
***************
*** 31,36 ****
--- 31,37 ----
     arm      -- untested
     rs6000   rs6000-ibm-aix3.2.5 (gcc, cc, c89, xlc)  IBM RS/6000   AIX 3.2.5
              powerpc-ibm-aix4.1.4.0 (cc)
+ 	    powerpc-unknown-linuxlibc6		     Apple PPC	   LinuxPPC	
     m88k     -- untested
     convex   -- untested
  
Index: ffcall/avcall/avcall-rs6000-linux.s
diff -c /dev/null ffcall/avcall/avcall-rs6000-linux.s:1.1
*** /dev/null	Fri Dec 22 14:25:10 2000
--- ffcall/avcall/avcall-rs6000-linux.s	Fri Dec 22 14:23:46 2000
***************
*** 0 ****
--- 1,256 ----
+ 	.file	"avcall-rs6000.c"
+ gcc2_compiled.:
+ 	.section	".text"
+ 	.align 2
+ 	.globl __builtin_avcall
+ 	.type	 __builtin_avcall,@function
+ __builtin_avcall:
+ 	stwu 1,-1040(1)
+ 	mflr 0
+ 	stw 31,1036(1)
+ 	stw 0,1044(1)
+ 	mr 31,3
+ 	addi 7,1,8
+ 	lwz 9,20(31)
+ 	addi 11,9,-40
+ 	subf 11,31,11
+ 	srawi 11,11,2
+ 	lwz 9,1064(31)
+ 	addi 10,9,-1072
+ 	subf 10,31,10
+ 	srawi 10,10,3
+ 	subfic 3,10,8
+ 	cmpw 0,3,11
+ 	bc 4,0,.L4
+ 	addi 8,31,40
+ .L6:
+ 	add 9,10,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1,1040(1)
+ 	blr
+ .Lfe1:
+ 	.size	 __builtin_avcall,.Lfe1-__builtin_avcall
+ 	.ident	"GCC: (GNU) 2.95.2 19991024 (release/franzo)"
Index: ffcall/avcall/avcall-rs6000.c
diff -c ffcall/avcall/avcall-rs6000.c:1.1.1.1 ffcall/avcall/avcall-rs6000.c:1.2
*** ffcall/avcall/avcall-rs6000.c:1.1.1.1	Wed Dec 20 10:31:38 2000
--- ffcall/avcall/avcall-rs6000.c	Fri Dec 22 14:23:46 2000
***************
*** 44,51 ****
    to get the right register variables. For other compilers use the
    pre-compiled assembler version.
    ----------------------------------------------------------------------*/
! #include "avcall.h.in"
  
  #define RETURN(TYPE,VAL)	(*(TYPE*)l->raddr = (TYPE)(VAL))
  
  register double farg1	__asm__("fr1");
--- 44,57 ----
    to get the right register variables. For other compilers use the
    pre-compiled assembler version.
    ----------------------------------------------------------------------*/
! #include "avcall.h"
  
+ #ifdef __linux__
+ #define STACK_OFFSET 2
+ #else
+ #define STACK_OFFSET 14
+ #endif
+ 
  #define RETURN(TYPE,VAL)	(*(TYPE*)l->raddr = (TYPE)(VAL))
  
  register double farg1	__asm__("fr1");
***************
*** 72,83 ****
    register double	dret	__asm__("fr1");
  
    __avword space[__AV_ALIST_WORDS];	/* space for callee's stack frame */
!   __avword* argframe = sp + 14;		/* stack offset for argument list */
    int arglen = l->aptr - l->args;
    __avword i;
  
!   for (i = 8; i < arglen; i++)		/* push function args onto stack */
!     argframe[i-8] = l->args[i];
  
    /* pass first 13 floating-point args in registers */
    arglen = l->faptr - l->fargs;
--- 78,93 ----
    register double	dret	__asm__("fr1");
  
    __avword space[__AV_ALIST_WORDS];	/* space for callee's stack frame */
!   __avword* argframe = sp + STACK_OFFSET;/* stack offset for argument list */
    int arglen = l->aptr - l->args;
+   int farglen = l->faptr - l->fargs;
    __avword i;
  
! #ifdef _AIX
!   farglen = 0;
! #endif
!   for (i = (8-farglen); i < arglen; i++) /* push function args onto stack */
!     argframe[i-8+farglen] = l->args[i];
  
    /* pass first 13 floating-point args in registers */
    arglen = l->faptr - l->fargs;
Index: ffcall/avcall/avcall.h.in
diff -c ffcall/avcall/avcall.h.in:1.1.1.1 ffcall/avcall/avcall.h.in:1.2
*** ffcall/avcall/avcall.h.in:1.1.1.1	Wed Dec 20 10:31:38 2000
--- ffcall/avcall/avcall.h.in	Fri Dec 22 14:23:46 2000
***************
*** 334,340 ****
    unsigned long		rsize;
    /* current pointer into the args[] array */
    __avword*		aptr;
! #if defined(__sparc__) || defined(__sparc64__) || defined(__hppa__)
    /* limit pointer into the args[] array */
    __avword*		eptr;
  #endif
--- 334,340 ----
    unsigned long		rsize;
    /* current pointer into the args[] array */
    __avword*		aptr;
! #if defined(__sparc__) || defined(__sparc64__) || defined(__hppa__) || (defined(__rs6000__) && !defined(_AIX))
    /* limit pointer into the args[] array */
    __avword*		eptr;
  #endif
***************
*** 384,390 ****
  } av_alist;
  
  /* The limit for the pointer into the args[] array. */
! #if defined(__sparc__) || defined(__sparc64__) || defined(__hppa__)
  #define __av_eptr(LIST)	((LIST).eptr)
  #else
  #define __av_eptr(LIST)	(&(LIST).args[__AV_ALIST_WORDS])
--- 384,390 ----
  } av_alist;
  
  /* The limit for the pointer into the args[] array. */
! #if defined(__sparc__) || defined(__sparc64__) || defined(__hppa__) || (defined(__rs6000__) && !defined(_AIX))
  #define __av_eptr(LIST)	((LIST).eptr)
  #else
  #define __av_eptr(LIST)	(&(LIST).args[__AV_ALIST_WORDS])
***************
*** 440,448 ****
--- 440,455 ----
     (LIST).eptr = &(LIST).args[0],
  #endif
  #if defined(__rs6000__)
+ #if defined(_AIX)
  #define __av_start1(LIST)						\
     (LIST).aptr = &(LIST).args[0],					\
     (LIST).faptr = &(LIST).fargs[0],
+ #else
+ #define __av_start1(LIST)						\
+    (LIST).aptr = &(LIST).args[0],					\
+    (LIST).faptr = &(LIST).fargs[0],                                     \
+    (LIST).eptr = &(LIST).args[__AV_ALIST_WORDS],
+ #endif
  #endif
  
  #define av_start_void(LIST,FUNC)		__av_start(LIST,FUNC,0,    __AVvoid)
***************
*** 881,887 ****
     : (++(LIST).aptr > __av_eptr(LIST)					\
        ? -1 : (((float*)(LIST).aptr)[-1] = (float)(VAL), 0)))
  
! #define __av_double(LIST,VAL)						\
    ((LIST).faptr < &(LIST).fargs[8]					\
     ? ((*(LIST).faptr++ = (double)(VAL)), 0)				\
     : (((LIST).aptr += 2) > __av_eptr(LIST)				\
--- 888,894 ----
     : (++(LIST).aptr > __av_eptr(LIST)					\
        ? -1 : (((float*)(LIST).aptr)[-1] = (float)(VAL), 0)))
  
! #define av_double(LIST,VAL)						\
    ((LIST).faptr < &(LIST).fargs[8]					\
     ? ((*(LIST).faptr++ = (double)(VAL)), 0)				\
     : (((LIST).aptr += 2) > __av_eptr(LIST)				\
Index: ffcall/callback/PLATFORMS
diff -c ffcall/callback/PLATFORMS:1.1.1.1 ffcall/callback/PLATFORMS:1.2
*** ffcall/callback/PLATFORMS:1.1.1.1	Wed Dec 20 10:31:38 2000
--- ffcall/callback/PLATFORMS	Fri Dec 22 14:23:52 2000
***************
*** 8,13 ****
--- 8,14 ----
                hppa2.0-hp-hpux10.20 (cc +DA1.1)
       arm      -- untested
       rs6000   rs6000-ibm-aix3.2.5 (xlc, gcc)
+      	      powerpc-unknown-linuxlibc6
       m88k     -- untested
       convex   -- untested
  
Index: ffcall/callback/trampoline_r/Makefile.in
diff -c ffcall/callback/trampoline_r/Makefile.in:1.1.1.1 ffcall/callback/trampoline_r/Makefile.in:1.2
*** ffcall/callback/trampoline_r/Makefile.in:1.1.1.1	Wed Dec 20 10:31:38 2000
--- ffcall/callback/trampoline_r/Makefile.in	Fri Dec 22 14:23:52 2000
***************
*** 87,93 ****
  	$(LIBTOOL_COMPILE) $(CC) @GCC_X_NONE@ -c $(srcdir)/cache-hppa.s
  
  cache-rs6000.lo : $(srcdir)/cache-rs6000-sysv4.s
! 	$(LIBTOOL_COMPILE) $(CC) @GCC_X_NONE@ -c $(srcdir)/cache-rs6000-sysv4.s ; mv cache-rs6000-sysv4.o cache-rs6000.o
  
  cache-convex.lo : $(srcdir)/cache-convex.s
  	$(LIBTOOL_COMPILE) $(CC) @GCC_X_NONE@ -c $(srcdir)/cache-convex.s
--- 87,93 ----
  	$(LIBTOOL_COMPILE) $(CC) @GCC_X_NONE@ -c $(srcdir)/cache-hppa.s
  
  cache-rs6000.lo : $(srcdir)/cache-rs6000-sysv4.s
! 	$(LIBTOOL_COMPILE) $(CC) @GCC_X_NONE@ -c $(srcdir)/cache-rs6000-sysv4.s ; rm -f cache-rs6000.o ; ln cache-rs6000-sysv4.o cache-rs6000.o
  
  cache-convex.lo : $(srcdir)/cache-convex.s
  	$(LIBTOOL_COMPILE) $(CC) @GCC_X_NONE@ -c $(srcdir)/cache-convex.s
Index: ffcall/callback/vacall_r/Makefile.in
diff -c ffcall/callback/vacall_r/Makefile.in:1.1.1.1 ffcall/callback/vacall_r/Makefile.in:1.2
*** ffcall/callback/vacall_r/Makefile.in:1.1.1.1	Wed Dec 20 10:31:38 2000
--- ffcall/callback/vacall_r/Makefile.in	Fri Dec 22 14:23:52 2000
***************
*** 113,120 ****
  vacall-arm.s : $(srcdir)/vacall-arm.S
  	$(CPP) $(ASPFLAGS) $(srcdir)/vacall-arm.S | grep -v '^ *#line' | grep -v '^#' | sed -e 's,% ,%,g' -e 's,//,@,g' -e 's,\$$,#,g' > vacall-arm.s
  
! vacall-rs6000.lo : $(srcdir)/vacall-rs6000-aix.old.s $(srcdir)/vacall-rs6000-aix.new.s $(srcdir)/vacall-rs6000-sysv4.s
! 	case "$(OS)" in aix3*) syntax=aix.old;; aix*) syntax=aix.new;; *) syntax=sysv4;; esac; $(LIBTOOL_COMPILE) $(CC) @GCC_X_NONE@ -c $(srcdir)/vacall-rs6000-$${syntax}.s ; cp vacall-rs6000-$${syntax}.lo vacall-rs6000.lo ; rm -f vacall-rs6000-$${syntax}.lo ; if test -f vacall-rs6000-$${syntax}.o; then mv vacall-rs6000-$${syntax}.o vacall-rs6000.o; fi
  
  vacall-m88k.lo : $(srcdir)/vacall-m88k.s
  	$(LIBTOOL_COMPILE) $(CC) @GCC_X_NONE@ -c $(srcdir)/vacall-m88k.s
--- 113,126 ----
  vacall-arm.s : $(srcdir)/vacall-arm.S
  	$(CPP) $(ASPFLAGS) $(srcdir)/vacall-arm.S | grep -v '^ *#line' | grep -v '^#' | sed -e 's,% ,%,g' -e 's,//,@,g' -e 's,\$$,#,g' > vacall-arm.s
  
! vacall-rs6000.lo : $(srcdir)/vacall-rs6000-aix.old.s $(srcdir)/vacall-rs6000-aix.new.s $(srcdir)/vacall-rs6000-sysv4.s $(srcdir)/vacall-rs6000-linux.s
! 	case "$(OS)" in \
! 	  aix3*) syntax=aix.old;; \
! 	  aix*) syntax=aix.new;; \
! 	  linux*) syntax=linux;; \
! 	  *) syntax=sysv4;; \
! 	esac; \
! 	$(LIBTOOL_COMPILE) $(CC) @GCC_X_NONE@ -c $(srcdir)/vacall-rs6000-$${syntax}.s ; cp vacall-rs6000-$${syntax}.lo vacall-rs6000.lo ; rm -f vacall-rs6000-$${syntax}.lo ; if test -f vacall-rs6000-$${syntax}.o; then mv vacall-rs6000-$${syntax}.o vacall-rs6000.o; fi
  
  vacall-m88k.lo : $(srcdir)/vacall-m88k.s
  	$(LIBTOOL_COMPILE) $(CC) @GCC_X_NONE@ -c $(srcdir)/vacall-m88k.s
Index: ffcall/callback/vacall_r/vacall-rs6000-linux.s
diff -c /dev/null ffcall/callback/vacall_r/vacall-rs6000-linux.s:1.1
*** /dev/null	Fri Dec 22 14:25:10 2000
--- ffcall/callback/vacall_r/vacall-rs6000-linux.s	Fri Dec 22 14:23:52 2000
***************
*** 0 ****
--- 1,164 ----
+ 	.file	"vacall-rs6000.c"
+ gcc2_compiled.:
+ 	.section	".text"
+ 	.align 2
+ 	.globl __vacall_r
+ 	.type	 __vacall_r,@function
+ __vacall_r:
+ 	stwu 1,-208(1)
+ 	mflr 0
+ 	stw 0,212(1)
+ 	stw 3,152(1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lfe1-__vacall_r
+ 	.ident	"GCC: (GNU) 2.95.2 19991024 (release/franzo)"
Index: ffcall/callback/vacall_r/vacall-rs6000.c
diff -c ffcall/callback/vacall_r/vacall-rs6000.c:1.1.1.1 ffcall/callback/vacall_r/vacall-rs6000.c:1.2
*** ffcall/callback/vacall_r/vacall-rs6000.c:1.1.1.1	Wed Dec 20 10:31:38 2000
--- ffcall/callback/vacall_r/vacall-rs6000.c	Fri Dec 22 14:23:52 2000
***************
*** 10,18 ****
   */
  
  #ifndef REENTRANT
! #include "vacall.h.in"
  #else /* REENTRANT */
! #include "vacall_r.h.in"
  #endif
  
  #ifdef REENTRANT
--- 10,18 ----
   */
  
  #ifndef REENTRANT
! #include "vacall.h"
  #else /* REENTRANT */
! #include "vacall_r.h"
  #endif
  
  #ifdef REENTRANT
***************
*** 47,52 ****
--- 47,53 ----
    /* gcc-2.6.3 source says: When a parameter is passed in a register,
     * stack space is still allocated for it.
     */
+ #if defined(_AIX)
    /* Move the arguments passed in registers to their stack locations. */
    (&firstword)[-8] = word1;
    (&firstword)[-7] = word2;
***************
*** 56,61 ****
--- 57,74 ----
    (&firstword)[-3] = word6;
    (&firstword)[-2] = word7;
    (&firstword)[-1] = word8;
+ #else
+   /* Move the arguments passed in registers to temp storage, since 
+      moving them to the stack would mess up the stack */
+   list.regarg[0] = word1;
+   list.regarg[1] = word2;
+   list.regarg[2] = word3;
+   list.regarg[3] = word4;
+   list.regarg[4] = word5;
+   list.regarg[5] = word6;
+   list.regarg[6] = word7;
+   list.regarg[7] = word8;
+ #endif
    list.farg[0] = farg1;
    list.farg[1] = farg2;
    list.farg[2] = farg3;
***************
*** 71,77 ****
--- 84,96 ----
    list.farg[12] = farg13;
    /* Prepare the va_alist. */
    list.flags = 0;
+ #if defined(_AIX)
    list.aptr = (long)(&firstword - 8);
+ #else
+   list.aptr = (long)(&list.regarg[0]);
+   list.saptr = (long)(&firstword);
+   list.onstack = 0;
+ #endif
    list.raddr = (void*)0;
    list.rtype = __VAvoid;
    list.memfargptr = &list.farg[0];
Index: ffcall/callback/vacall_r/vacall_r.h.in
diff -c ffcall/callback/vacall_r/vacall_r.h.in:1.1.1.1 ffcall/callback/vacall_r/vacall_r.h.in:1.2
*** ffcall/callback/vacall_r/vacall_r.h.in:1.1.1.1	Wed Dec 20 10:31:38 2000
--- ffcall/callback/vacall_r/vacall_r.h.in	Fri Dec 22 14:23:52 2000
***************
*** 402,408 ****
--- 402,413 ----
  #if defined(__rs6000__)
    double*        memfargptr;
    double         farg[13];
+ #if !defined(_AIX)
+   __vaword       regarg[8];
+   unsigned long  saptr;
+   int            onstack;
  #endif
+ #endif
  } __va_alist;
  
  typedef __va_alist* va_alist;
***************
*** 598,604 ****
  /* Padding of non-struct arguments. */
  #define __va_argsize(TYPE_SIZE)  \
    (((TYPE_SIZE) + sizeof(__vaword)-1) & -(long)sizeof(__vaword))
! #if defined(__i386__) || defined(__m68k__) || defined(__mips__) && !defined(__mipsn32__) || (defined(__sparc__) && !defined(__sparc64__)) || defined(__alpha__) || defined(__arm__) || defined(__rs6000__) || defined(__m88k__) || defined(__convex__)
  /* args grow up */
  /* small structures < 1 word are adjusted depending on compiler */
  #define __va_arg_leftadjusted(LIST,TYPE_SIZE,TYPE_ALIGN)  \
--- 603,609 ----
  /* Padding of non-struct arguments. */
  #define __va_argsize(TYPE_SIZE)  \
    (((TYPE_SIZE) + sizeof(__vaword)-1) & -(long)sizeof(__vaword))
! #if defined(__i386__) || defined(__m68k__) || defined(__mips__) && !defined(__mipsn32__) || (defined(__sparc__) && !defined(__sparc64__)) || defined(__alpha__) || defined(__arm__) || (defined(__rs6000__) && defined(_AIX)) || defined(__m88k__) || defined(__convex__)
  /* args grow up */
  /* small structures < 1 word are adjusted depending on compiler */
  #define __va_arg_leftadjusted(LIST,TYPE_SIZE,TYPE_ALIGN)  \
***************
*** 613,618 ****
--- 618,647 ----
  		  )							\
    )
  #endif
+ #if defined(__rs6000__) && !defined(_AIX)
+ /* args grow up */
+ /* small structures < 1 word are adjusted depending on compiler */
+ /* Also make sure we switch to the stack pointer after 8 args */
+ #define __va_arg_leftadjusted(LIST,TYPE_SIZE,TYPE_ALIGN)  \
+   ((LIST)->aptr = (((LIST)->onstack == 0                                \
+                     && (LIST)->aptr >= (long)&(LIST)->regarg[8])        \
+                    ? ((LIST)->onstack=1, (LIST)->saptr) : (LIST)->aptr  \
+                   ),                                                    \
+    (LIST)->aptr += __va_argsize(TYPE_SIZE),				\
+    (LIST)->aptr - __va_argsize(TYPE_SIZE)				\
+   )
+ #define __va_arg_rightadjusted(LIST,TYPE_SIZE,TYPE_ALIGN)  \
+   ((LIST)->aptr = (((LIST)->onstack == 0                                \
+                     && (LIST)->aptr >= (long)&(LIST)->regarg[8])        \
+                    ? ((LIST)->onstack=1, (LIST)->saptr) : (LIST)->aptr  \
+                   ),                                                    \
+    (LIST)->aptr += __va_argsize(TYPE_SIZE),				\
+    (LIST)->aptr - ((TYPE_SIZE) < sizeof(__vaword)			\
+ 		   ? (TYPE_SIZE)					\
+ 		   : __va_argsize(TYPE_SIZE)				\
+ 		  )							\
+   )
+ #endif
  #if defined(__mipsn32__) || defined(__mips64__) || defined(__sparc64__)
  /* args grow up */
  /* small structures < 1 word are adjusted depending on compiler */
***************
*** 872,884 ****
  #define __va_arg_float(LIST)  \
    ((LIST)->memfargptr < &(LIST)->farg[8]				\
     ? (float) *((LIST)->memfargptr++)					\
!    : ((LIST)->aptr += sizeof(float),					\
        *(float*)((LIST)->aptr - sizeof(float))				\
    ))
  #define va_arg_double(LIST)  \
    ((LIST)->memfargptr < &(LIST)->farg[8]				\
      ? *((LIST)->memfargptr++)						\
!     : (__va_align_double(LIST)						\
         (LIST)->aptr += sizeof(double),					\
         *(double*)((LIST)->aptr - sizeof(double))			\
    ))
--- 901,921 ----
  #define __va_arg_float(LIST)  \
    ((LIST)->memfargptr < &(LIST)->farg[8]				\
     ? (float) *((LIST)->memfargptr++)					\
!    : ((LIST)->aptr = ((LIST)->onstack == 0                              \
!                        ? ((LIST)->onstack=1, (LIST)->saptr)             \
!                        : (LIST)->aptr                                   \
!                       ),                                                \
!       (LIST)->aptr += sizeof(float),					\
        *(float*)((LIST)->aptr - sizeof(float))				\
    ))
  #define va_arg_double(LIST)  \
    ((LIST)->memfargptr < &(LIST)->farg[8]				\
      ? *((LIST)->memfargptr++)						\
!     : ((LIST)->aptr = ((LIST)->onstack == 0                             \
!                        ? ((LIST)->onstack=1, (LIST)->saptr)             \
!                        : (LIST)->aptr                                   \
!                       ),                                                \
!        __va_align_double(LIST)						\
         (LIST)->aptr += sizeof(double),					\
         *(double*)((LIST)->aptr - sizeof(double))			\
    ))
***************
*** 950,956 ****
        __va_arg_rightadjusted(LIST,TYPE_SIZE,TYPE_ALIGN)			\
    ))
  #endif
! #if defined(__rs6000__)
  /* small structures < 1 word are adjusted depending on compiler */
  #define __va_arg_struct(LIST,TYPE_SIZE,TYPE_ALIGN)  \
    (__va_align_struct(LIST,TYPE_SIZE,TYPE_ALIGN)				\
--- 987,993 ----
        __va_arg_rightadjusted(LIST,TYPE_SIZE,TYPE_ALIGN)			\
    ))
  #endif
! #if defined(__rs6000__) && defined(_AIX)
  /* small structures < 1 word are adjusted depending on compiler */
  #define __va_arg_struct(LIST,TYPE_SIZE,TYPE_ALIGN)  \
    (__va_align_struct(LIST,TYPE_SIZE,TYPE_ALIGN)				\
***************
*** 960,965 ****
--- 997,1007 ----
      : /* gcc passes small structures right-adjusted. */			\
        __va_arg_rightadjusted(LIST,TYPE_SIZE,TYPE_ALIGN)			\
    ))
+ #endif
+ #if defined(__rs6000__) && !defined(_AIX)
+ /* Structures are passed as pointers to caller-made local copies. */
+ #define __va_arg_struct(LIST,TYPE_SIZE,TYPE_ALIGN)  \
+   va_arg_ptr(LIST,void*)
  #endif
  #if defined(__sparc__) && !defined(__sparc64__)
  /* Structures are passed as pointers to caller-made local copies. */
Index: ffcall/vacall/Makefile.in
diff -c ffcall/vacall/Makefile.in:1.1.1.1 ffcall/vacall/Makefile.in:1.2
*** ffcall/vacall/Makefile.in:1.1.1.1	Wed Dec 20 10:31:39 2000
--- ffcall/vacall/Makefile.in	Fri Dec 22 14:23:52 2000
***************
*** 105,111 ****
  	$(CPP) $(ASPFLAGS) $(srcdir)/vacall-arm.S | grep -v '^ *#line' | grep -v '^#' | sed -e 's,% ,%,g' -e 's,//,@,g' -e 's,\$$,#,g' > vacall-arm.s
  
  vacall-rs6000.o : $(srcdir)/vacall-rs6000-aix.old.s $(srcdir)/vacall-rs6000-aix.new.s $(srcdir)/vacall-rs6000-sysv4.s
! 	case "$(OS)" in aix3*) syntax=aix.old;; aix*) syntax=aix.new;; *) syntax=sysv4;; esac; $(CC) @GCC_X_NONE@ -c $(srcdir)/vacall-rs6000-$${syntax}.s ; mv vacall-rs6000-$${syntax}.o vacall-rs6000.o
  
  vacall-m88k.o : $(srcdir)/vacall-m88k.s
  	$(CC) @GCC_X_NONE@ -c $(srcdir)/vacall-m88k.s
--- 105,118 ----
  	$(CPP) $(ASPFLAGS) $(srcdir)/vacall-arm.S | grep -v '^ *#line' | grep -v '^#' | sed -e 's,% ,%,g' -e 's,//,@,g' -e 's,\$$,#,g' > vacall-arm.s
  
  vacall-rs6000.o : $(srcdir)/vacall-rs6000-aix.old.s $(srcdir)/vacall-rs6000-aix.new.s $(srcdir)/vacall-rs6000-sysv4.s
! 	case "$(OS)" in \
! 	  aix3*) syntax=aix.old;; \
! 	  aix*) syntax=aix.new;; \
! 	  linux*) syntax=linux;; \
! 	  *) syntax=sysv4;; \
! 	esac; \
! 	$(CC) @GCC_X_NONE@ -c $(srcdir)/vacall-rs6000-$${syntax}.s ; \
! 	mv vacall-rs6000-$${syntax}.o vacall-rs6000.o
  
  vacall-m88k.o : $(srcdir)/vacall-m88k.s
  	$(CC) @GCC_X_NONE@ -c $(srcdir)/vacall-m88k.s
Index: ffcall/vacall/PLATFORMS
diff -c ffcall/vacall/PLATFORMS:1.1.1.1 ffcall/vacall/PLATFORMS:1.2
*** ffcall/vacall/PLATFORMS:1.1.1.1	Wed Dec 20 10:31:39 2000
--- ffcall/vacall/PLATFORMS	Fri Dec 22 14:23:52 2000
***************
*** 18,23 ****
--- 18,24 ----
                hppa1.1-hp-hpux10.01 (cc), hppa2.0-hp-hpux10.20 (cc +DA1.1)
       arm      -- untested
       rs6000   rs6000-ibm-aix3.2.5 (gcc, c89, xlc), powerpc-ibm-aix4.1.4.0 (cc)
+      	      powerpc-unknown-linuxlibc6
       m88k     -- untested
       convex   -- untested
  
Index: ffcall/vacall/vacall-rs6000-linux.s
diff -c /dev/null ffcall/vacall/vacall-rs6000-linux.s:1.1
*** /dev/null	Fri Dec 22 14:25:10 2000
--- ffcall/vacall/vacall-rs6000-linux.s	Fri Dec 22 14:23:52 2000
***************
*** 0 ****
--- 1,164 ----
+ 	.file	"vacall-rs6000.c"
+ gcc2_compiled.:
+ 	.section	".text"
+ 	.align 2
+ 	.globl vacall
+ 	.type	 vacall,@function
+ vacall:
+ 	stwu 1,-208(1)
+ 	mflr 0
+ 	stw 0,212(1)
+ 	stw 3,152(1)
+ 	stw 4,156(1)
+ 	stw 5,160(1)
+ 	stw 6,164(1)
+ 	stw 7,168(1)
+ 	stw 8,172(1)
+ 	stw 9,176(1)
+ 	stw 10,180(1)
+ 	stfd 1,48(1)
+ 	stfd 2,56(1)
+ 	stfd 3,64(1)
+ 	stfd 4,72(1)
+ 	stfd 5,80(1)
+ 	stfd 6,88(1)
+ 	stfd 7,96(1)
+ 	stfd 8,104(1)
+ 	stfd 9,112(1)
+ 	stfd 10,120(1)
+ 	stfd 11,128(1)
+ 	stfd 12,136(1)
+ 	stfd 13,144(1)
+ 	li 9,0
+ 	stw 9,8(1)
+ 	addi 0,1,152
+ 	stw 0,12(1)
+ 	addi 0,1,216
+ 	stw 0,184(1)
+ 	stw 9,188(1)
+ 	stw 9,16(1)
+ 	stw 9,20(1)
+ 	addi 0,1,48
+ 	stw 0,40(1)
+ 	lis 9,vacall_function@ha
+ 	lwz 0,vacall_function@l(9)
+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 	andi. 9,0,1
+ 	bc 12,2,.L32
+ 	lwz 3,16(1)
+ 	b .L4
+ .L32:
+ 	lwz 0,8(1)
+ 	andi. 9,0,1024
+ 	bc 12,2,.L4
+ 	lwz 0,24(1)
+ 	cmpwi 0,0,1
+ 	bc 4,2,.L35
+ 	lwz 9,16(1)
+ 	lbz 3,0(9)
+ 	b .L4
+ .L35:
+ 	lwz 0,24(1)
+ 	cmpwi 0,0,2
+ 	bc 4,2,.L37
+ 	lwz 9,16(1)
+ 	lhz 3,0(9)
+ 	b .L4
+ .L37:
+ 	lwz 0,24(1)
+ 	cmpwi 0,0,4
+ 	bc 4,2,.L39
+ 	lwz 9,16(1)
+ 	lwz 3,0(9)
+ 	b .L4
+ .L39:
+ 	lwz 0,24(1)
+ 	cmpwi 0,0,8
+ 	bc 4,2,.L4
+ 	lwz 9,16(1)
+ 	lwz 3,0(9)
+ 	lwz 4,4(9)
+ .L4:
+ 	lwz 0,212(1)
+ 	mtlr 0
+ 	la 1,208(1)
+ 	blr
+ .Lfe1:
+ 	.size	 vacall,.Lfe1-vacall
+ 	.ident	"GCC: (GNU) 2.95.2 19991024 (release/franzo)"
Index: ffcall/vacall/vacall-rs6000.c
diff -c ffcall/vacall/vacall-rs6000.c:1.1.1.1 ffcall/vacall/vacall-rs6000.c:1.2
*** ffcall/vacall/vacall-rs6000.c:1.1.1.1	Wed Dec 20 10:31:39 2000
--- ffcall/vacall/vacall-rs6000.c	Fri Dec 22 14:23:52 2000
***************
*** 10,18 ****
   */
  
  #ifndef REENTRANT
! #include "vacall.h.in"
  #else /* REENTRANT */
! #include "vacall_r.h.in"
  #endif
  
  #ifdef REENTRANT
--- 10,18 ----
   */
  
  #ifndef REENTRANT
! #include "vacall.h"
  #else /* REENTRANT */
! #include "vacall_r.h"
  #endif
  
  #ifdef REENTRANT
***************
*** 44,49 ****
--- 44,50 ----
          __vaword firstword)
  {
    __va_alist list;
+ #if defined(_AIX)
    /* gcc-2.6.3 source says: When a parameter is passed in a register,
     * stack space is still allocated for it.
     */
***************
*** 56,61 ****
--- 57,74 ----
    (&firstword)[-3] = word6;
    (&firstword)[-2] = word7;
    (&firstword)[-1] = word8;
+ #else
+   /* Move the arguments passed in registers to temp storage, since 
+      moving them to the stack would mess up the stack */
+   list.regarg[0] = word1;
+   list.regarg[1] = word2;
+   list.regarg[2] = word3;
+   list.regarg[3] = word4;
+   list.regarg[4] = word5;
+   list.regarg[5] = word6;
+   list.regarg[6] = word7;
+   list.regarg[7] = word8;
+ #endif
    list.farg[0] = farg1;
    list.farg[1] = farg2;
    list.farg[2] = farg3;
***************
*** 71,77 ****
--- 84,96 ----
    list.farg[12] = farg13;
    /* Prepare the va_alist. */
    list.flags = 0;
+ #if defined(_AIX)
    list.aptr = (long)(&firstword - 8);
+ #else
+   list.aptr = (long)(&list.regarg[0]);
+   list.saptr = (long)(&firstword);
+   list.onstack = 0;
+ #endif
    list.raddr = (void*)0;
    list.rtype = __VAvoid;
    list.memfargptr = &list.farg[0];
Index: ffcall/vacall/vacall.h.in
diff -c ffcall/vacall/vacall.h.in:1.1.1.1 ffcall/vacall/vacall.h.in:1.2
*** ffcall/vacall/vacall.h.in:1.1.1.1	Wed Dec 20 10:31:39 2000
--- ffcall/vacall/vacall.h.in	Fri Dec 22 14:23:52 2000
***************
*** 402,408 ****
--- 402,413 ----
  #if defined(__rs6000__)
    double*        memfargptr;
    double         farg[13];
+ #if !defined(_AIX)
+   __vaword       regarg[8];
+   unsigned long  saptr;
+   int            onstack;
  #endif
+ #endif
  } __va_alist;
  
  typedef __va_alist* va_alist;
***************
*** 598,604 ****
  /* Padding of non-struct arguments. */
  #define __va_argsize(TYPE_SIZE)  \
    (((TYPE_SIZE) + sizeof(__vaword)-1) & -(long)sizeof(__vaword))
! #if defined(__i386__) || defined(__m68k__) || defined(__mips__) && !defined(__mipsn32__) || (defined(__sparc__) && !defined(__sparc64__)) || defined(__alpha__) || defined(__arm__) || defined(__rs6000__) || defined(__m88k__) || defined(__convex__)
  /* args grow up */
  /* small structures < 1 word are adjusted depending on compiler */
  #define __va_arg_leftadjusted(LIST,TYPE_SIZE,TYPE_ALIGN)  \
--- 603,609 ----
  /* Padding of non-struct arguments. */
  #define __va_argsize(TYPE_SIZE)  \
    (((TYPE_SIZE) + sizeof(__vaword)-1) & -(long)sizeof(__vaword))
! #if defined(__i386__) || defined(__m68k__) || defined(__mips__) && !defined(__mipsn32__) || (defined(__sparc__) && !defined(__sparc64__)) || defined(__alpha__) || defined(__arm__) || (defined(__rs6000__) && defined(_AIX)) || defined(__m88k__) || defined(__convex__)
  /* args grow up */
  /* small structures < 1 word are adjusted depending on compiler */
  #define __va_arg_leftadjusted(LIST,TYPE_SIZE,TYPE_ALIGN)  \
***************
*** 613,618 ****
--- 618,647 ----
  		  )							\
    )
  #endif
+ #if defined(__rs6000__) && !defined(_AIX)
+ /* args grow up */
+ /* small structures < 1 word are adjusted depending on compiler */
+ /* Also make sure we switch to the stack pointer after 8 args */
+ #define __va_arg_leftadjusted(LIST,TYPE_SIZE,TYPE_ALIGN)  \
+   ((LIST)->aptr = (((LIST)->onstack == 0                                \
+                     && (LIST)->aptr >= (long)&(LIST)->regarg[8])        \
+                    ? ((LIST)->onstack=1, (LIST)->saptr) : (LIST)->aptr  \
+                   ),                                                    \
+    (LIST)->aptr += __va_argsize(TYPE_SIZE),				\
+    (LIST)->aptr - __va_argsize(TYPE_SIZE)				\
+   )
+ #define __va_arg_rightadjusted(LIST,TYPE_SIZE,TYPE_ALIGN)  \
+   ((LIST)->aptr = (((LIST)->onstack == 0                                \
+                     && (LIST)->aptr >= (long)&(LIST)->regarg[8])        \
+                    ? ((LIST)->onstack=1, (LIST)->saptr) : (LIST)->aptr  \
+                   ),                                                    \
+    (LIST)->aptr += __va_argsize(TYPE_SIZE),				\
+    (LIST)->aptr - ((TYPE_SIZE) < sizeof(__vaword)			\
+ 		   ? (TYPE_SIZE)					\
+ 		   : __va_argsize(TYPE_SIZE)				\
+ 		  )							\
+   )
+ #endif
  #if defined(__mipsn32__) || defined(__mips64__) || defined(__sparc64__)
  /* args grow up */
  /* small structures < 1 word are adjusted depending on compiler */
***************
*** 872,884 ****
  #define __va_arg_float(LIST)  \
    ((LIST)->memfargptr < &(LIST)->farg[8]				\
     ? (float) *((LIST)->memfargptr++)					\
!    : ((LIST)->aptr += sizeof(float),					\
        *(float*)((LIST)->aptr - sizeof(float))				\
    ))
  #define va_arg_double(LIST)  \
    ((LIST)->memfargptr < &(LIST)->farg[8]				\
      ? *((LIST)->memfargptr++)						\
!     : (__va_align_double(LIST)						\
         (LIST)->aptr += sizeof(double),					\
         *(double*)((LIST)->aptr - sizeof(double))			\
    ))
--- 901,921 ----
  #define __va_arg_float(LIST)  \
    ((LIST)->memfargptr < &(LIST)->farg[8]				\
     ? (float) *((LIST)->memfargptr++)					\
!    : ((LIST)->aptr = ((LIST)->onstack == 0                              \
!                        ? ((LIST)->onstack=1, (LIST)->saptr)             \
!                        : (LIST)->aptr                                   \
!                       ),                                                \
!       (LIST)->aptr += sizeof(float),					\
        *(float*)((LIST)->aptr - sizeof(float))				\
    ))
  #define va_arg_double(LIST)  \
    ((LIST)->memfargptr < &(LIST)->farg[8]				\
      ? *((LIST)->memfargptr++)						\
!     : ((LIST)->aptr = ((LIST)->onstack == 0                             \
!                        ? ((LIST)->onstack=1, (LIST)->saptr)             \
!                        : (LIST)->aptr                                   \
!                       ),                                                \
!        __va_align_double(LIST)						\
         (LIST)->aptr += sizeof(double),					\
         *(double*)((LIST)->aptr - sizeof(double))			\
    ))
***************
*** 950,956 ****
        __va_arg_rightadjusted(LIST,TYPE_SIZE,TYPE_ALIGN)			\
    ))
  #endif
! #if defined(__rs6000__)
  /* small structures < 1 word are adjusted depending on compiler */
  #define __va_arg_struct(LIST,TYPE_SIZE,TYPE_ALIGN)  \
    (__va_align_struct(LIST,TYPE_SIZE,TYPE_ALIGN)				\
--- 987,993 ----
        __va_arg_rightadjusted(LIST,TYPE_SIZE,TYPE_ALIGN)			\
    ))
  #endif
! #if defined(__rs6000__) && defined(_AIX)
  /* small structures < 1 word are adjusted depending on compiler */
  #define __va_arg_struct(LIST,TYPE_SIZE,TYPE_ALIGN)  \
    (__va_align_struct(LIST,TYPE_SIZE,TYPE_ALIGN)				\
***************
*** 960,965 ****
--- 997,1007 ----
      : /* gcc passes small structures right-adjusted. */			\
        __va_arg_rightadjusted(LIST,TYPE_SIZE,TYPE_ALIGN)			\
    ))
+ #endif
+ #if defined(__rs6000__) && !defined(_AIX)
+ /* Structures are passed as pointers to caller-made local copies. */
+ #define __va_arg_struct(LIST,TYPE_SIZE,TYPE_ALIGN)  \
+   va_arg_ptr(LIST,void*)
  #endif
  #if defined(__sparc__) && !defined(__sparc64__)
  /* Structures are passed as pointers to caller-made local copies. */
