Subject: re: gcc3 status?
To: Jason Thorpe <thorpej@wasabisystems.com>
From: matthew green <mrg@eterna.com.au>
List: tech-toolchain
Date: 06/23/2003 16:13:20
   
   	powerpc-netbsd		almost-yes (there is an ABI mismatch with
   				our in-tree 2.95.3 that needs
   				to be addressed in the 3.3 code
   				base)


did anyone ever explain what the problem is?   to me, it always
manifested itself in programs passing va_list arguments failing
to compile.  the following patch appears to let this work...i'm
not entirely sure it's correct, but i appear to be able to build
general software with this change.  all it does it make the
va_list typedef not be a one-member structure in the gcc3 case,
but just the plain member.  this matches the GCC defintion...



.mrg.


Index: ansi.h
===================================================================
RCS file: /cvsroot/src/sys/arch/powerpc/include/ansi.h,v
retrieving revision 1.19
diff -p -r1.19 ansi.h
*** ansi.h	2 Mar 2003 22:18:20 -0000	1.19
--- ansi.h	23 Jun 2003 06:10:00 -0000
***************
*** 70,83 ****
  #define	_BSD_VA_LIST_		__builtin_va_list /* GCC builtin type */
  #else
  #define	_BSD_VA_LIST_		__va_list	/* va_list */
! typedef struct {
  #if __GNUC_PREREQ__(3, 0)
! 	__builtin_va_list __va;
  #else
  	char __gpr, __fpr, __pad[2];
  	char *__stack, *__base;
  #endif
! } __va_list;
  #endif
  
  /*
--- 70,85 ----
  #define	_BSD_VA_LIST_		__builtin_va_list /* GCC builtin type */
  #else
  #define	_BSD_VA_LIST_		__va_list	/* va_list */
! typedef
  #if __GNUC_PREREQ__(3, 0)
! 	__builtin_va_list
  #else
+ struct {
  	char __gpr, __fpr, __pad[2];
  	char *__stack, *__base;
+ }
  #endif
! __va_list;
  #endif
  
  /*