This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH 2.95.4] Fix VxWorks varargs [was [RFD/PATCH 2.95.4] vxworks-varargs.patch]
- To: "gcc-patches" <gcc-patches at gcc dot gnu dot org>
- Subject: [PATCH 2.95.4] Fix VxWorks varargs [was [RFD/PATCH 2.95.4] vxworks-varargs.patch]
- From: "Dave Korn" <davek-ml at ntlworld dot com>
- Date: Sun, 1 Apr 2001 23:52:45 +0100
This supersedes http://gcc.gnu.org/ml/gcc-patches/2001-03/msg01625.html
I'm resending this as an attachment because the line wrapping got mangled
last time. I've also fixed the missing copyright year update.
DaveK
=========================================================
2001-04-01 Dave Korn <davek-ml@ntlworld.com>
* fixinc/inclhack.def: Add two new entries to fix vxworks varargs
header problems.
* config/rs6000/vxppc.h: (CPP_PREDEFINES) Add feature select macros
to enable fixes in fixincluded vxworks headers.
diff -c3pr /gcc.orig/gcc/gcc/config/rs6000/vxppc.h /gcc.dev/gcc/gcc/config/rs6000/vxppc.h
*** /gcc.orig/gcc/gcc/config/rs6000/vxppc.h Mon May 17 02:30:56 1999
--- /gcc.dev/gcc/gcc/config/rs6000/vxppc.h Thu Mar 29 22:01:26 2001
***************
*** 1,5 ****
/* Definitions of target machine for GNU compiler. Vxworks PowerPC version.
! Copyright (C) 1996 Free Software Foundation, Inc.
This file is part of GNU CC.
--- 1,5 ----
/* Definitions of target machine for GNU compiler. Vxworks PowerPC version.
! Copyright (C) 1996, 2001 Free Software Foundation, Inc.
This file is part of GNU CC.
*************** Boston, MA 02111-1307, USA. */
*** 47,53 ****
#undef CPP_PREDEFINES
#define CPP_PREDEFINES "\
-D__vxworks -Asystem(vxworks) -Asystem(embedded) \
! -Acpu(powerpc) -Amachine(powerpc)"
/* VxWorks does all the library stuff itself. */
--- 47,53 ----
#undef CPP_PREDEFINES
#define CPP_PREDEFINES "\
-D__vxworks -Asystem(vxworks) -Asystem(embedded) \
! -Acpu(powerpc) -Amachine(powerpc) -D__PPC__ -D__VXVARGS__"
/* VxWorks does all the library stuff itself. */
diff -c3pr /gcc.orig/gcc/gcc/fixinc/inclhack.def /gcc.dev/gcc/gcc/fixinc/inclhack.def
*** /gcc.orig/gcc/gcc/fixinc/inclhack.def Fri Aug 13 09:44:06 1999
--- /gcc.dev/gcc/gcc/fixinc/inclhack.def Wed Mar 28 00:12:20 2001
*************** fix = {
*** 2234,2239 ****
--- 2234,2267 ----
"#endif\n";
};
+ /*
+ * Fix VxWorks varargs header
+ */
+ fix = {
+ hackname = vxworks_varargs_problem;
+ files = arch/ppc/toolPpc.h;
+ select = "GNU C varargs support for the PowerPC with V.4 calling sequence";
+
+ sed = "/\\/\\* GNU C varargs support for the PowerPC with V.4 calling sequence \\*\\//a\\\n"
+ "#ifdef __VXVARGS__\\\n"
+ "#include <va-ppc.h>\\\n"
+ "#else /* !defined(__VXVARGS__) */\\\n";
+
+ sed = "/\\/\\* END CYGNUS LOCAL Waiting for 2.7.1 to unfreeze \\*\\//i\\\n"
+ "#endif /* !defined(__VXVARGS__) */\\\n";
+ };
+
+ /*
+ * That last fix won't even work unless we make archPpc.h use the default
+ * search path when it includes toolPpc.h
+ *
+ */
+ fix = {
+ hackname = vxworks_arch_includepath;
+ files = arch/ppc/archPpc.h;
+ select = 'include.*"toolPpc.h"';
+ sed = "s,\"toolPpc.h\",<arch/ppc/toolPpc.h>,";
+ };
/*
* Fix VxWorks <time.h> to not require including <vxTypes.h>.
vxworks-varargs.diff