aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2020-11-18 10:33:30 -0800
committerNathan Sidwell <nathan@acm.org>2020-11-18 10:33:30 -0800
commit92648faa1cb2b28685f3b3dccfdfc4b1ed2c5a7b (patch)
tree50a52e925439420ec31cd6a9220abf97042000db
parentc9c3d5f28a589cd00be5748010783657189e9855 (diff)
downloadgcc-92648faa1cb2b28685f3b3dccfdfc4b1ed2c5a7b.zip
gcc-92648faa1cb2b28685f3b3dccfdfc4b1ed2c5a7b.tar.gz
gcc-92648faa1cb2b28685f3b3dccfdfc4b1ed2c5a7b.tar.bz2
aix: Fixinclude
This fixes an ODR violation in the AIX headers that is detected by C++ modules. While unnamed structs with typedef names for linkage purposes are accepted, this case is an anonymous struct without such a typedef name -- the typedef is attached to the pointer-to-struct type. Fixed by naming the struct. fixincludes/ * inclhack.def (aix_physaddr_t): New. * fixincl.x: Regenerated.
-rw-r--r--fixincludes/fixincl.x53
-rw-r--r--fixincludes/inclhack.def14
2 files changed, 62 insertions, 5 deletions
diff --git a/fixincludes/fixincl.x b/fixincludes/fixincl.x
index 758d562..2143965 100644
--- a/fixincludes/fixincl.x
+++ b/fixincludes/fixincl.x
@@ -2,11 +2,11 @@
*
* DO NOT EDIT THIS FILE (fixincl.x)
*
- * It has been AutoGen-ed October 3, 2020 at 11:40:52 PM by AutoGen 5.18
+ * It has been AutoGen-ed October 21, 2020 at 10:43:22 AM by AutoGen 5.18.16
* From the definitions inclhack.def
* and the template file fixincl
*/
-/* DO NOT SVN-MERGE THIS FILE, EITHER Sat Oct 3 23:40:52 UTC 2020
+/* DO NOT SVN-MERGE THIS FILE, EITHER Wed Oct 21 10:43:22 EDT 2020
*
* You must regenerate it. Use the ./genfixes script.
*
@@ -15,7 +15,7 @@
* certain ANSI-incompatible system header files which are fixed to work
* correctly with ANSI C and placed in a directory that GNU C will search.
*
- * This file contains 259 fixup descriptions.
+ * This file contains 260 fixup descriptions.
*
* See README for more information.
*
@@ -1249,6 +1249,43 @@ static const char* apzAix_Rwlock_Initializer_1Patch[] = {
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
+ * Description of Aix_Physadr_T fix
+ */
+tSCC zAix_Physadr_TName[] =
+ "aix_physadr_t";
+
+/*
+ * File name selection pattern
+ */
+tSCC zAix_Physadr_TList[] =
+ "sys/types.h\0";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzAix_Physadr_TMachs[] = {
+ "*-*-aix*",
+ (const char*)NULL };
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zAix_Physadr_TSelect0[] =
+ "typedef[ \t]*struct[ \t]*([{][^}]*[}][ \t]*\\*[ \t]*physadr_t;)";
+
+#define AIX_PHYSADR_T_TEST_CT 1
+static tTestDesc aAix_Physadr_TTests[] = {
+ { TT_EGREP, zAix_Physadr_TSelect0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Aix_Physadr_T
+ */
+static const char* apzAix_Physadr_TPatch[] = {
+ "format",
+ "typedef struct __physadr_s %1",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
* Description of Aix_Pthread fix
*/
tSCC zAix_PthreadName[] =
@@ -10521,9 +10558,9 @@ static const char* apzX11_SprintfPatch[] = {
*
* List of all fixes
*/
-#define REGEX_COUNT 297
+#define REGEX_COUNT 298
#define MACH_LIST_SIZE_LIMIT 187
-#define FIX_COUNT 259
+#define FIX_COUNT 260
/*
* Enumerate the fixes
@@ -10555,6 +10592,7 @@ typedef enum {
AIX_MUTEX_INITIALIZER_1_FIXIDX,
AIX_COND_INITIALIZER_1_FIXIDX,
AIX_RWLOCK_INITIALIZER_1_FIXIDX,
+ AIX_PHYSADR_T_FIXIDX,
AIX_PTHREAD_FIXIDX,
AIX_STDINT_1_FIXIDX,
AIX_STDINT_2_FIXIDX,
@@ -10921,6 +10959,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
AIX_RWLOCK_INITIALIZER_1_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aAix_Rwlock_Initializer_1Tests, apzAix_Rwlock_Initializer_1Patch, 0 },
+ { zAix_Physadr_TName, zAix_Physadr_TList,
+ apzAix_Physadr_TMachs,
+ AIX_PHYSADR_T_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aAix_Physadr_TTests, apzAix_Physadr_TPatch, 0 },
+
{ zAix_PthreadName, zAix_PthreadList,
apzAix_PthreadMachs,
AIX_PTHREAD_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def
index 47eb236..80c9adf 100644
--- a/fixincludes/inclhack.def
+++ b/fixincludes/inclhack.def
@@ -720,6 +720,20 @@ fix = {
"{ \\\\\n";
};
+
+/* On AIX 'typedef struct {<stuff>} * physadr_t;' needs to give the struct a
+ name for linkage purposes. Fortunately it is on exactly one
+ line. */
+fix = {
+ hackname = aix_physadr_t;
+ mach = "*-*-aix*";
+ files = sys/types.h;
+ select = "typedef[ \t]*struct[ \t]*([{][^}]*[}][ \t]*\\*[ \t]*physadr_t;)";
+ c_fix = format;
+ c_fix_arg = "typedef struct __physadr_s %1";
+ test_text = "typedef struct __physadr_s {";
+};
+
/*
* pthread.h on AIX 4.3.3 tries to define a macro without whitspace
* which violates a requirement of ISO C.