summaryrefslogtreecommitdiff
path: root/gdbsupport/common.m4
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2021-05-12 12:39:22 -0600
committerTom Tromey <tromey@adacore.com>2021-11-09 08:21:18 -0700
commit0b03c6f03d51f441d999e0cee92f81af543d9373 (patch)
treef23e058934e5ab2f3da8a79c47ce66bd65c3aea2 /gdbsupport/common.m4
parent469ca94170aa4f14cc3b3dc9e7d8c02bb17f8c91 (diff)
downloadbinutils-gdb-0b03c6f03d51f441d999e0cee92f81af543d9373.tar.gz
Fix build on rhES5
The rhES5 build failed due to an upstream import a while back. The bug here is that, while the 'personality' function exists, ADDR_NO_RANDOMIZE is only defined in <linux/personality.h>, not <sys/personality.h>. However, <linux/personality.h> does not declare the 'personality' function, and <sys/personality.h> and <linux/personality.h> cannot both be included. This patch restores one of the removed configure checks and updates the code to check it. We had this as a local patch at AdaCore, because it seemed like there was no interest upstream. However, now it turns out that this fixes PR build/28555, so I'm sending it now.
Diffstat (limited to 'gdbsupport/common.m4')
-rw-r--r--gdbsupport/common.m45
1 files changed, 5 insertions, 0 deletions
diff --git a/gdbsupport/common.m4 b/gdbsupport/common.m4
index 07c7b2a9bec..81e7c75f51d 100644
--- a/gdbsupport/common.m4
+++ b/gdbsupport/common.m4
@@ -55,6 +55,11 @@ AC_DEFUN([GDB_AC_COMMON], [
ptrace64 sbrk setns sigaltstack sigprocmask \
setpgid setpgrp getrusage getauxval sigtimedwait])
+ # This is needed for RHEL 5 and uclibc-ng < 1.0.39.
+ # These did not define ADDR_NO_RANDOMIZE in sys/personality.h,
+ # only in linux/personality.h.
+ AC_CHECK_DECLS([ADDR_NO_RANDOMIZE],,, [#include <sys/personality.h>])
+
AC_CHECK_DECLS([strstr])
# ----------------------- #