This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] AIX malloc.h fixincludes


Some early releases of AIX 6 include a malloc.h header with an
incorrect use of "builtin" keyword:

#ifdef __cplusplus
extern "C" {
   extern "builtin" char *__alloca (size_t);
#  define alloca __alloca
}
#endif /* def __cplusplus */

GCC is not too happy about this.  Now that GCC mainline and 4.7 use
C++ for bootstrap, this breaks bootstrap on a narrow range of AIX 6
systems.  The following patch applies the same fix to the header file
that IBM applied in its own update.

Okay for trunk, 4.7 and 4.6?

Thanks, David


        * inclhack.def (aix_malloc): New.
        * fixincl.x: Regenerate.
        * tests/base/malloc.h [AIX_MALLOC_CHECK]: New.

Index: inclhack.def
===================================================================
--- inclhack.def	(revision 185739)
+++ inclhack.def	(working copy)
@@ -370,6 +370,19 @@
 };

 /*
+ *  malloc.h on AIX6 uses XLC++ specific builtin syntax
+ */
+fix = {
+    hackname  = aix_malloc;
+    mach      = "*-*-aix*";
+    files     = "malloc.h";
+    select    = "#ifdef __cplusplus";
+    c_fix     = format;
+    c_fix_arg = "#if (defined(__cplusplus) && defined(__IBMCPP__))";
+    test_text = "#ifdef __cplusplus";
+};
+
+/*
  * net/if_arp.h defines a variable fc_softc instead of adding a
  * typedef for the struct on AIX 5.2, 5.3, 6.1 and 7.1
  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]