summaryrefslogtreecommitdiff
path: root/fixincludes
diff options
context:
space:
mode:
authorClément Chigot <clement.chigot@atos.net>2020-09-25 09:48:22 +0200
committerDavid Edelsohn <dje.gcc@gmail.com>2020-10-03 23:48:40 +0000
commit5af2a2d30d7f3a472d77af4540ab38169d307e83 (patch)
tree4ecae142e2e33586b329fa378caa081d3f4a53d7 /fixincludes
parentce531b14126bf5f1dcd70224a1131198ddf58875 (diff)
downloadgcc-5af2a2d30d7f3a472d77af4540ab38169d307e83.tar.gz
aix: apply aix_malloc more narrowly.
In recent Technology Levels of AIX 7.2, new "#ifdef __cplusplus" have been added. Thus, the aix_malloc fix was applied in wrong locations. This patch increases the context to avoid this. fixincludes/ChangeLog: 2020-10-03 Clément Chigot <clement.chigot@atos.net> * inclhack.def (aix_malloc): Add more context to select. * fixincl.x: Regenerate. * tests/base/malloc.h: Update expected results.
Diffstat (limited to 'fixincludes')
-rw-r--r--fixincludes/fixincl.x12
-rw-r--r--fixincludes/inclhack.def12
-rw-r--r--fixincludes/tests/base/malloc.h2
3 files changed, 19 insertions, 7 deletions
diff --git a/fixincludes/fixincl.x b/fixincludes/fixincl.x
index cb966829ba3..758d5620641 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 September 17, 2020 at 03:10:47 PM by AutoGen 5.18
+ * It has been AutoGen-ed October 3, 2020 at 11:40:52 PM by AutoGen 5.18
* From the definitions inclhack.def
* and the template file fixincl
*/
-/* DO NOT SVN-MERGE THIS FILE, EITHER Thu Sep 17 15:10:47 UTC 2020
+/* DO NOT SVN-MERGE THIS FILE, EITHER Sat Oct 3 23:40:52 UTC 2020
*
* You must regenerate it. Use the ./genfixes script.
*
@@ -943,7 +943,9 @@ tSCC* apzAix_MallocMachs[] = {
* content selection pattern - do fix if pattern found
*/
tSCC zAix_MallocSelect0[] =
- "#ifdef __cplusplus";
+ "#ifdef __cplusplus\n\
+extern \"C\" \\{\n\
+[ \t]extern \"builtin\" char \\*__alloca \\(size_t\\);";
#define AIX_MALLOC_TEST_CT 1
static tTestDesc aAix_MallocTests[] = {
@@ -954,7 +956,9 @@ static tTestDesc aAix_MallocTests[] = {
*/
static const char* apzAix_MallocPatch[] = {
"format",
- "#if (defined(__cplusplus) && defined(__IBMCPP__))",
+ "#if (defined(__cplusplus) && defined(__IBMCPP__))\n\
+extern \"C\" {\n\
+\textern \"builtin\" char *__alloca (size_t);",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def
index 6e59be981d6..47eb236586c 100644
--- a/fixincludes/inclhack.def
+++ b/fixincludes/inclhack.def
@@ -597,10 +597,16 @@ fix = {
hackname = aix_malloc;
mach = "*-*-aix*";
files = "malloc.h";
- select = "#ifdef __cplusplus";
+ select = "#ifdef __cplusplus\n"
+ "extern \"C\" \\{\n"
+ "[ \t]extern \"builtin\" char \\*__alloca \\(size_t\\);";
c_fix = format;
- c_fix_arg = "#if (defined(__cplusplus) && defined(__IBMCPP__))";
- test_text = "#ifdef __cplusplus";
+ c_fix_arg = "#if (defined(__cplusplus) && defined(__IBMCPP__))\n"
+ "extern \"C\" {\n"
+ "\textern \"builtin\" char *__alloca (size_t);";
+ test_text = "#ifdef __cplusplus\n"
+ "extern \"C\" {\n"
+ "\textern \"builtin\" char *__alloca (size_t);";
};
/*
diff --git a/fixincludes/tests/base/malloc.h b/fixincludes/tests/base/malloc.h
index 15be8b02b88..b5d0e6e31c9 100644
--- a/fixincludes/tests/base/malloc.h
+++ b/fixincludes/tests/base/malloc.h
@@ -11,6 +11,8 @@
#if defined( AIX_MALLOC_CHECK )
#if (defined(__cplusplus) && defined(__IBMCPP__))
+extern "C" {
+ extern "builtin" char *__alloca (size_t);
#endif /* AIX_MALLOC_CHECK */