summaryrefslogtreecommitdiff
path: root/addr2line.c
diff options
context:
space:
mode:
Diffstat (limited to 'addr2line.c')
-rw-r--r--addr2line.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/addr2line.c b/addr2line.c
index 9528a8fa43..e102abba4f 100644
--- a/addr2line.c
+++ b/addr2line.c
@@ -32,9 +32,26 @@
#include <sys/stat.h>
#include <unistd.h>
-#if defined(HAVE_ALLOCA_H)
-#include <alloca.h>
-#endif
+/* Make alloca work the best possible way. */
+#ifdef __GNUC__
+# ifndef atarist
+# ifndef alloca
+# define alloca __builtin_alloca
+# endif
+# endif /* atarist */
+#else
+# ifdef HAVE_ALLOCA_H
+# include <alloca.h>
+# else
+# ifdef _AIX
+#pragma alloca
+# else
+# ifndef alloca /* predefined by HP cc +Olibcalls */
+void *alloca();
+# endif
+# endif /* AIX */
+# endif /* HAVE_ALLOCA_H */
+#endif /* __GNUC__ */
#ifdef HAVE_DL_ITERATE_PHDR
# ifndef _GNU_SOURCE