aboutsummaryrefslogtreecommitdiff
path: root/gnulib/patches
diff options
context:
space:
mode:
Diffstat (limited to 'gnulib/patches')
-rw-r--r--gnulib/patches/0001-Fix-PR-gdb-23558-Use-system-s-getcwd-when-cross-comp.patch69
-rw-r--r--gnulib/patches/0002-mkostemp-mkostemps-Fix-compilation-error-in-C-mode-o.patch38
2 files changed, 107 insertions, 0 deletions
diff --git a/gnulib/patches/0001-Fix-PR-gdb-23558-Use-system-s-getcwd-when-cross-comp.patch b/gnulib/patches/0001-Fix-PR-gdb-23558-Use-system-s-getcwd-when-cross-comp.patch
new file mode 100644
index 0000000..1d8cdf6
--- /dev/null
+++ b/gnulib/patches/0001-Fix-PR-gdb-23558-Use-system-s-getcwd-when-cross-comp.patch
@@ -0,0 +1,69 @@
+From a7447215cdc492a077732420a3f0db6d48b34d51 Mon Sep 17 00:00:00 2001
+From: Sergio Durigan Junior <sergiodj@redhat.com>
+Date: Mon, 10 Sep 2018 12:52:04 -0400
+Subject: [PATCH] Fix PR gdb/23558: Use system's 'getcwd' when cross-compiling
+ GDB
+
+This is a backport of a gnulib fix for the following bug:
+
+ https://sourceware.org/bugzilla/show_bug.cgi?id=23558
+
+The problem reported there is about the replacement of 'getcwd' when
+cross-compiling GDB. With our current gnulib copy, the mechanism for
+deciding whether to use the system's 'getcwd' or gnulib's version is
+too simplistic and pessimistic, so when cross-compiling we always end
+up using gnulib's version, which has a limitation: it cannot handle
+the situation when the parent directory doesn't have read permissions.
+
+The solution is to backport the following gnulib commit:
+
+ commit a96d2e67052c879b1bcc5bc461722beac75fc372
+ Author: Bruno Haible <bruno@clisp.org>
+ Date: Thu Aug 23 21:13:19 2018 +0200
+
+ getcwd: Add cross-compilation guesses.
+
+gdb/ChangeLog:
+2018-09-10 Sergio Durigan Junior <sergiodj@redhat.com>
+
+ PR gdb/23555
+ PR gdb/23558
+ * gnulib/import/m4/getcwd-path-max.m4: Add cross-compilation
+ guesses.
+---
+ gdb/gnulib/import/m4/getcwd-path-max.m4 | 20 ++++++++++++++++----
+ 1 file changed, 16 insertions(+), 4 deletions(-)
+
+diff --git a/gdb/gnulib/import/m4/getcwd-path-max.m4 b/gdb/gnulib/import/m4/getcwd-path-max.m4
+index 2531ccff65c..90bbc77dea1 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
++ ])
+ ])
+ ])
+--
+2.19.0
+
diff --git a/gnulib/patches/0002-mkostemp-mkostemps-Fix-compilation-error-in-C-mode-o.patch b/gnulib/patches/0002-mkostemp-mkostemps-Fix-compilation-error-in-C-mode-o.patch
new file mode 100644
index 0000000..35f917f
--- /dev/null
+++ b/gnulib/patches/0002-mkostemp-mkostemps-Fix-compilation-error-in-C-mode-o.patch
@@ -0,0 +1,38 @@
+From 6954995dd32ea98a1973df31f411f3996bb47dfb Mon Sep 17 00:00:00 2001
+From: Tom Tromey <tom@tromey.com>
+Date: Mon, 1 Oct 2018 14:57:45 -0600
+Subject: [PATCH] mkostemp, mkostemps: Fix compilation error in C++ mode on Mac
+ OS X.
+
+Attempting to use the mkostemp module in gdb caused a build failure
+when using the C++ namespace feature, because mkostemp was not
+declared. On OS X, mkostemp is declared in unistd.h, so this patch
+extends the existing special case in stdlib.in.h to cover mkostemp and
+mkostemps.
+
+* lib/stdlib.in.h: Include <unistd.h> for mkostemp and mkostemps
+on OS X.
+---
+ ChangeLog | 6 ++++++
+ lib/stdlib.in.h | 3 ++-
+ 2 files changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/gdb/gnulib/import/stdlib.in.h b/gdb/gnulib/import/stdlib.in.h
+index db3253bd97..8f803a2ea3 100644
+--- a/gdb/gnulib/import/stdlib.in.h
++++ b/gdb/gnulib/import/stdlib.in.h
+@@ -87,9 +87,10 @@ struct random_data
+ # endif
+ #endif
+
+-#if (@GNULIB_MKSTEMP@ || @GNULIB_MKSTEMPS@ || @GNULIB_GETSUBOPT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
++#if (@GNULIB_MKSTEMP@ || @GNULIB_MKSTEMPS@ || @GNULIB_MKOSTEMP@ || @GNULIB_MKOSTEMPS@ || @GNULIB_GETSUBOPT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
+ /* On Mac OS X 10.3, only <unistd.h> declares mkstemp. */
+ /* On Mac OS X 10.5, only <unistd.h> declares mkstemps. */
++/* On Mac OS X 10.13, only <unistd.h> declares mkostemp and mkostemps. */
+ /* On Cygwin 1.7.1, only <unistd.h> declares getsubopt. */
+ /* But avoid namespace pollution on glibc systems and native Windows. */
+ # include <unistd.h>
+--
+2.19.0
+