This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb/gdb-8.2-branch] fix incorrect gnulib getcwd replacement when cross-compiling GDB
- From: Joel Brobecker <brobecke at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 4 Sep 2018 18:01:26 -0000
- Subject: [binutils-gdb/gdb-8.2-branch] fix incorrect gnulib getcwd replacement when cross-compiling GDB
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=f30171bf98082846a725c1d116650d0c8998564c
commit f30171bf98082846a725c1d116650d0c8998564c
Author: Sergio Durigan Junior <sergiodj@redhat.com>
Date: Tue Sep 4 19:51:46 2018 +0200
fix incorrect gnulib getcwd replacement when cross-compiling GDB
This fixes a GDB crash observed on Android 8.0 when GDB was
cross-compiled. This patch is a backport of a patch pushed
upstream in gnulib.
gdb/ChangeLog (Sergio Durigan Junior <sergiodj@redhat.com>):
PR gdb/23558
* gnulib/import/m4/getcwd-path-max.m4: Add handling of Hurd,
Linux and kFreeBSD platforms.
* gnulib/configure: Regenerate.
Diff:
---
gdb/ChangeLog | 7 +++++++
gdb/gnulib/configure | 18 +++++++++++++++---
gdb/gnulib/import/m4/getcwd-path-max.m4 | 20 ++++++++++++++++----
3 files changed, 38 insertions(+), 7 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index cf3171d..7bf4edf 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2018-09-04 Sergio Durigan Junior <sergiodj@redhat.com>
+
+ PR gdb/23558
+ * gnulib/import/m4/getcwd-path-max.m4: Add handling of Hurd,
+ Linux and kFreeBSD platforms.
+ * gnulib/configure: Regenerate.
+
2018-08-31 Tom Tromey <tom@tromey.com>
* dwarf2read.c (dwarf2_add_field): Set the TYPE_LENGTH of the
diff --git a/gdb/gnulib/configure b/gdb/gnulib/configure
index 55a59b9..a152abc 100644
--- a/gdb/gnulib/configure
+++ b/gdb/gnulib/configure
@@ -16389,10 +16389,22 @@ else
# Arrange for deletion of the temporary directory this test creates.
ac_clean_files="$ac_clean_files confdir3"
if test "$cross_compiling" = yes; then :
- case "$host_os" in
- aix*) gl_cv_func_getcwd_path_max='no, it has the AIX bug';;
- *) gl_cv_func_getcwd_path_max=no;;
+ # Cross-compilation guesses:
+ case "$host_os" in
+ aix*) # On AIX, it has the AIX bug.
+ gl_cv_func_getcwd_path_max='no, it has the AIX bug' ;;
+ gnu*) # On Hurd, it is 'yes'.
+ gl_cv_func_getcwd_path_max=yes ;;
+ linux* | kfreebsd*)
+ # On older Linux+glibc it's 'no, but it is partly working',
+ # on newer Linux+glibc it's 'yes'.
+ # On Linux+musl libc, it's 'no, but it is partly working'.
+ # On kFreeBSD+glibc, it's 'no, but it is partly working'.
+ gl_cv_func_getcwd_path_max='no, but it is partly working' ;;
+ *) # If we don't know, assume the worst.
+ gl_cv_func_getcwd_path_max=no ;;
esac
+
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
diff --git a/gdb/gnulib/import/m4/getcwd-path-max.m4 b/gdb/gnulib/import/m4/getcwd-path-max.m4
index 2531ccf..90bbc77 100644
--- a/gdb/gnulib/import/m4/getcwd-path-max.m4
+++ b/gdb/gnulib/import/m4/getcwd-path-max.m4
@@ -209,9 +209,21 @@ main ()
32) gl_cv_func_getcwd_path_max='yes, but with shorter paths';;
*) gl_cv_func_getcwd_path_max=no;;
esac],
- [case "$host_os" in
- aix*) gl_cv_func_getcwd_path_max='no, it has the AIX bug';;
- *) gl_cv_func_getcwd_path_max=no;;
- esac])
+ [# Cross-compilation guesses:
+ case "$host_os" in
+ aix*) # On AIX, it has the AIX bug.
+ gl_cv_func_getcwd_path_max='no, it has the AIX bug' ;;
+ gnu*) # On Hurd, it is 'yes'.
+ gl_cv_func_getcwd_path_max=yes ;;
+ linux* | kfreebsd*)
+ # On older Linux+glibc it's 'no, but it is partly working',
+ # on newer Linux+glibc it's 'yes'.
+ # On Linux+musl libc, it's 'no, but it is partly working'.
+ # On kFreeBSD+glibc, it's 'no, but it is partly working'.
+ gl_cv_func_getcwd_path_max='no, but it is partly working' ;;
+ *) # If we don't know, assume the worst.
+ gl_cv_func_getcwd_path_max=no ;;
+ esac
+ ])
])
])