Warn if add-symbol-file does not provide any symbols
[external/binutils.git] / gdb / gnulib / patches / 0001-Fix-PR-gdb-23558-Use-system-s-getcwd-when-cross-comp.patch
1 From a7447215cdc492a077732420a3f0db6d48b34d51 Mon Sep 17 00:00:00 2001
2 From: Sergio Durigan Junior <sergiodj@redhat.com>
3 Date: Mon, 10 Sep 2018 12:52:04 -0400
4 Subject: [PATCH] Fix PR gdb/23558: Use system's 'getcwd' when cross-compiling
5  GDB
6
7 This is a backport of a gnulib fix for the following bug:
8
9   https://sourceware.org/bugzilla/show_bug.cgi?id=23558
10
11 The problem reported there is about the replacement of 'getcwd' when
12 cross-compiling GDB.  With our current gnulib copy, the mechanism for
13 deciding whether to use the system's 'getcwd' or gnulib's version is
14 too simplistic and pessimistic, so when cross-compiling we always end
15 up using gnulib's version, which has a limitation: it cannot handle
16 the situation when the parent directory doesn't have read permissions.
17
18 The solution is to backport the following gnulib commit:
19
20   commit a96d2e67052c879b1bcc5bc461722beac75fc372
21   Author: Bruno Haible <bruno@clisp.org>
22   Date:   Thu Aug 23 21:13:19 2018 +0200
23
24       getcwd: Add cross-compilation guesses.
25
26 gdb/ChangeLog:
27 2018-09-10  Sergio Durigan Junior  <sergiodj@redhat.com>
28
29         PR gdb/23555
30         PR gdb/23558
31         * gnulib/import/m4/getcwd-path-max.m4: Add cross-compilation
32         guesses.
33 ---
34  gdb/gnulib/import/m4/getcwd-path-max.m4 | 20 ++++++++++++++++----
35  1 file changed, 16 insertions(+), 4 deletions(-)
36
37 diff --git a/gdb/gnulib/import/m4/getcwd-path-max.m4 b/gdb/gnulib/import/m4/getcwd-path-max.m4
38 index 2531ccff65c..90bbc77dea1 100644
39 --- a/gdb/gnulib/import/m4/getcwd-path-max.m4
40 +++ b/gdb/gnulib/import/m4/getcwd-path-max.m4
41 @@ -209,9 +209,21 @@ main ()
42       32) gl_cv_func_getcwd_path_max='yes, but with shorter paths';;
43       *) gl_cv_func_getcwd_path_max=no;;
44       esac],
45 -    [case "$host_os" in
46 -       aix*) gl_cv_func_getcwd_path_max='no, it has the AIX bug';;
47 -       *) gl_cv_func_getcwd_path_max=no;;
48 -     esac])
49 +    [# Cross-compilation guesses:
50 +     case "$host_os" in
51 +       aix*) # On AIX, it has the AIX bug.
52 +         gl_cv_func_getcwd_path_max='no, it has the AIX bug' ;;
53 +       gnu*) # On Hurd, it is 'yes'.
54 +         gl_cv_func_getcwd_path_max=yes ;;
55 +       linux* | kfreebsd*)
56 +         # On older Linux+glibc it's 'no, but it is partly working',
57 +         # on newer Linux+glibc it's 'yes'.
58 +         # On Linux+musl libc, it's 'no, but it is partly working'.
59 +         # On kFreeBSD+glibc, it's 'no, but it is partly working'.
60 +         gl_cv_func_getcwd_path_max='no, but it is partly working' ;;
61 +       *) # If we don't know, assume the worst.
62 +         gl_cv_func_getcwd_path_max=no ;;
63 +     esac
64 +    ])
65    ])
66  ])
67 -- 
68 2.19.0
69