From 00f9883e5841c296b196574e35c4649ed0a28157 Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Thu, 1 Feb 2018 22:01:54 +0100 Subject: [PATCH] gdb: Update from 8.0.1 to 8.1 --- packages/gdb/build.sh | 11 +++++--- packages/gdb/fork_child_bin_sh.patch | 11 -------- packages/gdb/gdb-common-job-control.c.patch | 15 ++++++++++ .../gdb-common-signals-state-save-restore.c.patch | 32 +++++++++++----------- packages/gdb/gdb-inflow.c.patch | 18 ------------ packages/gdb/gdb-nat-fork-inferior.c.patch | 12 ++++++++ packages/gdb/gdb-ser-pipe.c.patch | 12 ++++++++ 7 files changed, 62 insertions(+), 49 deletions(-) delete mode 100644 packages/gdb/fork_child_bin_sh.patch create mode 100644 packages/gdb/gdb-common-job-control.c.patch delete mode 100644 packages/gdb/gdb-inflow.c.patch create mode 100644 packages/gdb/gdb-nat-fork-inferior.c.patch create mode 100644 packages/gdb/gdb-ser-pipe.c.patch diff --git a/packages/gdb/build.sh b/packages/gdb/build.sh index 17034fdf..e59d16e0 100755 --- a/packages/gdb/build.sh +++ b/packages/gdb/build.sh @@ -1,10 +1,10 @@ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/gdb/ TERMUX_PKG_DESCRIPTION="The standard GNU Debugger that runs on many Unix-like systems and works for many programming languages" -TERMUX_PKG_DEPENDS="liblzma, libexpat, readline, ncurses" -TERMUX_PKG_VERSION=8.0.1 -TERMUX_PKG_REVISION=1 +TERMUX_PKG_DEPENDS="liblzma, libexpat, readline, ncurses, libmpfr" +TERMUX_PKG_VERSION=8.1 +TERMUX_PKG_SHA256=af61a0263858e69c5dce51eab26662ff3d2ad9aa68da9583e8143b5426be4b34 TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/gdb/gdb-${TERMUX_PKG_VERSION}.tar.xz -TERMUX_PKG_SHA256=3dbd5f93e36ba2815ad0efab030dcd0c7b211d7b353a40a53f4c02d7d56295e3 +TERMUX_PKG_API_LEVEL=23 # gdb can not build with our normal --disable-static: https://sourceware.org/bugzilla/show_bug.cgi?id=15916 TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --with-system-readline @@ -26,4 +26,7 @@ termux_step_pre_configure() { export gl_cv_func_memchr_works=yes export gl_cv_func_stat_file_slash=yes export gl_cv_func_frexp_no_libm=no + export gl_cv_func_strerror_0_works=yes + export gl_cv_func_working_strerror=yes + export gl_cv_func_getcwd_path_max=yes } diff --git a/packages/gdb/fork_child_bin_sh.patch b/packages/gdb/fork_child_bin_sh.patch deleted file mode 100644 index f891677b..00000000 --- a/packages/gdb/fork_child_bin_sh.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -u -r ../gdb-7.6.2/gdb/fork-child.c ./gdb/fork-child.c ---- ../gdb-7.6.2/gdb/fork-child.c 2013-12-08 05:33:13.000000000 +0100 -+++ ./gdb/fork-child.c 2014-01-07 16:43:01.862311352 +0100 -@@ -36,7 +36,7 @@ - #include - - /* This just gets used as a default if we can't find SHELL. */ --#define SHELL_FILE "/bin/sh" -+#define SHELL_FILE "@TERMUX_PREFIX@/bin/sh" - - extern char **environ; diff --git a/packages/gdb/gdb-common-job-control.c.patch b/packages/gdb/gdb-common-job-control.c.patch new file mode 100644 index 00000000..30a712ab --- /dev/null +++ b/packages/gdb/gdb-common-job-control.c.patch @@ -0,0 +1,15 @@ +diff -u -r ../gdb-8.1/gdb/common/job-control.c ./gdb/common/job-control.c +--- ../gdb-8.1/gdb/common/job-control.c 2018-01-05 05:07:23.000000000 +0100 ++++ ./gdb/common/job-control.c 2018-02-01 21:19:44.732858138 +0100 +@@ -45,10 +45,7 @@ + if (job_control) + { + #ifdef HAVE_SETPGID +- /* The call setpgid (0, 0) is supposed to work and mean the same +- thing as this, but on Ultrix 4.2A it fails with EPERM (and +- setpgid (getpid (), getpid ()) succeeds). */ +- retval = setpgid (getpid (), getpid ()); ++ retval = setpgid (0, 0); + #else + #ifdef HAVE_SETPGRP + #ifdef SETPGRP_VOID diff --git a/packages/gdb/gdb-common-signals-state-save-restore.c.patch b/packages/gdb/gdb-common-signals-state-save-restore.c.patch index f1a8a8bd..f6f12044 100644 --- a/packages/gdb/gdb-common-signals-state-save-restore.c.patch +++ b/packages/gdb/gdb-common-signals-state-save-restore.c.patch @@ -1,19 +1,19 @@ -On Android signal handlers are setup by the linker (through debuggerd_client): -https://github.com/android/platform_system_core/blob/6fff551728f75e35b69bd59f2bc722a72d5c6d61/debuggerd/client/debuggerd_client.cpp#L290 - -diff -u -r ../gdb-7.12/gdb/common/signals-state-save-restore.c ./gdb/common/signals-state-save-restore.c ---- ../gdb-7.12/gdb/common/signals-state-save-restore.c 2016-10-07 13:04:17.000000000 -0400 -+++ ./gdb/common/signals-state-save-restore.c 2016-10-09 18:39:27.866619885 -0400 -@@ -58,10 +58,12 @@ - else if (res == -1) - perror_with_name (("sigaction")); - +diff -u -r ../gdb-8.1/gdb/common/signals-state-save-restore.c ./gdb/common/signals-state-save-restore.c +--- ../gdb-8.1/gdb/common/signals-state-save-restore.c 2018-01-31 03:58:50.000000000 +0100 ++++ ./gdb/common/signals-state-save-restore.c 2018-02-01 21:38:47.791540495 +0100 +@@ -69,6 +69,7 @@ + && oldact->sa_handler != SIG_DFL + && oldact->sa_handler != SIG_IGN) + { +#ifndef __ANDROID__ - /* If we find a custom signal handler already installed, then - this function was called too late. */ - if (oldact->sa_handler != SIG_DFL && oldact->sa_handler != SIG_IGN) - internal_error (__FILE__, __LINE__, _("unexpected signal handler")); + found_preinstalled = true; + + /* Use raw fprintf here because we're being called in early +@@ -78,6 +79,7 @@ + _("warning: Found custom handler for signal " + "%d (%s) preinstalled.\n"), i, + strsignal (i)); +#endif + } } - #endif - } + diff --git a/packages/gdb/gdb-inflow.c.patch b/packages/gdb/gdb-inflow.c.patch deleted file mode 100644 index 4d9d8eba..00000000 --- a/packages/gdb/gdb-inflow.c.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff -u -r ../gdb-7.10.1/gdb/inflow.c ./gdb/inflow.c ---- ../gdb-7.10.1/gdb/inflow.c 2015-12-05 10:16:45.000000000 -0500 -+++ ./gdb/inflow.c 2016-02-07 19:28:38.979181296 -0500 -@@ -862,10 +862,10 @@ - { - #if defined (HAVE_TERMIOS) || defined (TIOCGPGRP) - #ifdef HAVE_SETPGID -- /* The call setpgid (0, 0) is supposed to work and mean the same -- thing as this, but on Ultrix 4.2A it fails with EPERM (and -- setpgid (getpid (), getpid ()) succeeds). */ -- retval = setpgid (getpid (), getpid ()); -+ /* Termux change: setpgid(getpid(), getpid()), which is used upstream -+ for working around Ultrix 4.2A issue, does not work on Android but -+ fails with ESRCH. So revert back to simple setpgid(0,0). */ -+ retval = setpgid (0, 0); - #else - #ifdef HAVE_SETPGRP - #ifdef SETPGRP_VOID diff --git a/packages/gdb/gdb-nat-fork-inferior.c.patch b/packages/gdb/gdb-nat-fork-inferior.c.patch new file mode 100644 index 00000000..37aeef48 --- /dev/null +++ b/packages/gdb/gdb-nat-fork-inferior.c.patch @@ -0,0 +1,12 @@ +diff -u -r ../gdb-8.1/gdb/nat/fork-inferior.c ./gdb/nat/fork-inferior.c +--- ../gdb-8.1/gdb/nat/fork-inferior.c 2018-01-05 05:07:23.000000000 +0100 ++++ ./gdb/nat/fork-inferior.c 2018-02-01 21:49:06.148349274 +0100 +@@ -32,7 +32,7 @@ + + /* Default shell file to be used if 'startup-with-shell' is set but + $SHELL is not. */ +-#define SHELL_FILE "/bin/sh" ++#define SHELL_FILE "@TERMUX_PREFIX@/bin/sh" + + /* Build the argument vector for execv(3). */ + diff --git a/packages/gdb/gdb-ser-pipe.c.patch b/packages/gdb/gdb-ser-pipe.c.patch new file mode 100644 index 00000000..2a17f2f0 --- /dev/null +++ b/packages/gdb/gdb-ser-pipe.c.patch @@ -0,0 +1,12 @@ +diff -u -r ../gdb-8.1/gdb/ser-pipe.c ./gdb/ser-pipe.c +--- ../gdb-8.1/gdb/ser-pipe.c 2018-01-05 04:07:23.000000000 +0000 ++++ ./gdb/ser-pipe.c 2018-01-31 22:21:26.902931647 +0000 +@@ -122,7 +122,7 @@ + } + + close_most_fds (); +- execl ("/bin/sh", "sh", "-c", name, (char *) 0); ++ execl ("@TERMUX_PREFIX@/bin/sh", "sh", "-c", name, (char *) 0); + _exit (127); + } + -- 2.11.0