summaryrefslogtreecommitdiffstats
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
parentoptions: Fix up opts_set saving/restoring for underlying vars of Mask/Inverse... (diff)
downloadgcc-5af2a2d30d7f3a472d77af4540ab38169d307e83.tar.gz
gcc-5af2a2d30d7f3a472d77af4540ab38169d307e83.tar.bz2
gcc-5af2a2d30d7f3a472d77af4540ab38169d307e83.tar.xz
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 @@
2 * 2 *
3 * DO NOT EDIT THIS FILE (fixincl.x) 3 * DO NOT EDIT THIS FILE (fixincl.x)
4 * 4 *
5 * It has been AutoGen-ed September 17, 2020 at 03:10:47 PM by AutoGen 5.18 5 * It has been AutoGen-ed October 3, 2020 at 11:40:52 PM by AutoGen 5.18
6 * From the definitions inclhack.def 6 * From the definitions inclhack.def
7 * and the template file fixincl 7 * and the template file fixincl
8 */ 8 */
9/* DO NOT SVN-MERGE THIS FILE, EITHER Thu Sep 17 15:10:47 UTC 2020 9/* DO NOT SVN-MERGE THIS FILE, EITHER Sat Oct 3 23:40:52 UTC 2020
10 * 10 *
11 * You must regenerate it. Use the ./genfixes script. 11 * You must regenerate it. Use the ./genfixes script.
12 * 12 *
@@ -943,7 +943,9 @@ tSCC* apzAix_MallocMachs[] = {
943 * content selection pattern - do fix if pattern found 943 * content selection pattern - do fix if pattern found
944 */ 944 */
945tSCC zAix_MallocSelect0[] = 945tSCC zAix_MallocSelect0[] =
946 "#ifdef __cplusplus"; 946 "#ifdef __cplusplus\n\
947extern \"C\" \\{\n\
948[ \t]extern \"builtin\" char \\*__alloca \\(size_t\\);";
947 949
948#define AIX_MALLOC_TEST_CT 1 950#define AIX_MALLOC_TEST_CT 1
949static tTestDesc aAix_MallocTests[] = { 951static tTestDesc aAix_MallocTests[] = {
@@ -954,7 +956,9 @@ static tTestDesc aAix_MallocTests[] = {
954 */ 956 */
955static const char* apzAix_MallocPatch[] = { 957static const char* apzAix_MallocPatch[] = {
956 "format", 958 "format",
957 "#if (defined(__cplusplus) && defined(__IBMCPP__))", 959 "#if (defined(__cplusplus) && defined(__IBMCPP__))\n\
960extern \"C\" {\n\
961\textern \"builtin\" char *__alloca (size_t);",
958 (char*)NULL }; 962 (char*)NULL };
959 963
960/* * * * * * * * * * * * * * * * * * * * * * * * * * 964/* * * * * * * * * * * * * * * * * * * * * * * * * *
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 = {
597 hackname = aix_malloc; 597 hackname = aix_malloc;
598 mach = "*-*-aix*"; 598 mach = "*-*-aix*";
599 files = "malloc.h"; 599 files = "malloc.h";
600 select = "#ifdef __cplusplus"; 600 select = "#ifdef __cplusplus\n"
601 "extern \"C\" \\{\n"
602 "[ \t]extern \"builtin\" char \\*__alloca \\(size_t\\);";
601 c_fix = format; 603 c_fix = format;
602 c_fix_arg = "#if (defined(__cplusplus) && defined(__IBMCPP__))"; 604 c_fix_arg = "#if (defined(__cplusplus) && defined(__IBMCPP__))\n"
603 test_text = "#ifdef __cplusplus"; 605 "extern \"C\" {\n"
606 "\textern \"builtin\" char *__alloca (size_t);";
607 test_text = "#ifdef __cplusplus\n"
608 "extern \"C\" {\n"
609 "\textern \"builtin\" char *__alloca (size_t);";
604}; 610};
605 611
606/* 612/*
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 @@
11 11
12#if defined( AIX_MALLOC_CHECK ) 12#if defined( AIX_MALLOC_CHECK )
13#if (defined(__cplusplus) && defined(__IBMCPP__)) 13#if (defined(__cplusplus) && defined(__IBMCPP__))
14extern "C" {
15 extern "builtin" char *__alloca (size_t);
14#endif /* AIX_MALLOC_CHECK */ 16#endif /* AIX_MALLOC_CHECK */
15 17
16 18