diff options
Diffstat (limited to 'sys-devel/gcc/files/3.2.3/gcc-3.2.3-poisoned-malloc.patch')
-rw-r--r-- | sys-devel/gcc/files/3.2.3/gcc-3.2.3-poisoned-malloc.patch | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/sys-devel/gcc/files/3.2.3/gcc-3.2.3-poisoned-malloc.patch b/sys-devel/gcc/files/3.2.3/gcc-3.2.3-poisoned-malloc.patch new file mode 100644 index 0000000..2bdd26d --- /dev/null +++ b/sys-devel/gcc/files/3.2.3/gcc-3.2.3-poisoned-malloc.patch @@ -0,0 +1,41 @@ +fix building gcc-3.2.3 with newer versions of gcc + +http://bugs.gentoo.org/225743 +http://gcc.gnu.org/ml/gcc-help/2008-01/msg00040.html +http://www.archivum.info/gnu.gcc.help/2008-05/msg00093.html + +--- gcc-3.2.3/gcc/read-rtl.c ++++ gcc-3.2.3/gcc/read-rtl.c +@@ -659,7 +659,7 @@ + { + ungetc (c, infile); + list_counter++; +- obstack_ptr_grow (&vector_stack, (PTR) read_rtx (infile)); ++ obstack_ptr_grow (&vector_stack, read_rtx (infile)); + } + if (list_counter > 0) + { +--- gcc-3.2.3/gcc/system.h ++++ gcc-3.2.3/gcc/system.h +@@ -589,7 +589,9 @@ + #undef realloc + #undef calloc + #undef strdup ++#if ! (defined(FLEX_SCANNER) || defined(YYBISON) || defined(YYBYACC)) + #pragma GCC poison malloc realloc calloc strdup ++#endif + + /* Old target macros that have moved to the target hooks structure. */ + #pragma GCC poison ASM_OPEN_PAREN ASM_CLOSE_PAREN \ +@@ -628,4 +630,11 @@ + + #endif /* GCC >= 3.0 */ + ++#if defined(FLEX_SCANNER) || defined(YYBISON) || defined(YYBYACC) ++/* Flex and bison use malloc and realloc. Yuk. Note that this means ++ really_call_* cannot be used in a .l or .y file. */ ++#define malloc xmalloc ++#define realloc xrealloc ++#endif ++ + #endif /* ! GCC_SYSTEM_H */ |