[2/2] gdb: Patch for building with readline-8.2

Message ID 20221119144035.382952-2-adolf.belka@ipfire.org
State Accepted
Commit f86ae7d1a6fd6436aa3d285f0a1c2fdc9ce364f6
Headers
Series [1/2] readline: Update to version 8.2 plus patch 1 |

Commit Message

Adolf Belka Nov. 19, 2022, 2:40 p.m. UTC
  - Patch required for successful building with readline-8.2
   In readline 8.2 the type of rl_completer_word_break_characters changed to
   include const.

Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
---
 lfs/gdb                           |  1 +
 src/patches/gdb-readline8.2.patch | 35 +++++++++++++++++++++++++++++++
 2 files changed, 36 insertions(+)
 create mode 100644 src/patches/gdb-readline8.2.patch
  

Comments

Michael Tremer Nov. 21, 2022, 9:50 a.m. UTC | #1
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>

> On 19 Nov 2022, at 14:40, Adolf Belka <adolf.belka@ipfire.org> wrote:
> 
> - Patch required for successful building with readline-8.2
>   In readline 8.2 the type of rl_completer_word_break_characters changed to
>   include const.
> 
> Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
> ---
> lfs/gdb                           |  1 +
> src/patches/gdb-readline8.2.patch | 35 +++++++++++++++++++++++++++++++
> 2 files changed, 36 insertions(+)
> create mode 100644 src/patches/gdb-readline8.2.patch
> 
> diff --git a/lfs/gdb b/lfs/gdb
> index f36e52c8c..bd5a57f29 100644
> --- a/lfs/gdb
> +++ b/lfs/gdb
> @@ -70,6 +70,7 @@ $(subst %,%_BLAKE2,$(objects)) :
> $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
> @$(PREBUILD)
> @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
> + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/gdb-readline8.2.patch
> cd $(DIR_APP) && mkdir -pv build
> cd $(DIR_APP)/build && \
> ../configure \
> diff --git a/src/patches/gdb-readline8.2.patch b/src/patches/gdb-readline8.2.patch
> new file mode 100644
> index 000000000..93724b109
> --- /dev/null
> +++ b/src/patches/gdb-readline8.2.patch
> @@ -0,0 +1,35 @@
> +From 1add37b567a7dee39d99f37b37802034c3fce9c4 Mon Sep 17 00:00:00 2001
> +From: Andreas Schwab <schwab@linux-m68k.org>
> +Date: Sun, 20 Mar 2022 14:01:54 +0100
> +Subject: [PATCH] Add support for readline 8.2
> +
> +In readline 8.2 the type of rl_completer_word_break_characters changed to
> +include const.
> +---
> + gdb/completer.c | 4 ++--
> + 1 file changed, 2 insertions(+), 2 deletions(-)
> +
> +diff --git a/gdb/completer.c b/gdb/completer.c
> +index d3900ae2014..a51c16ac7f8 100644
> +--- a/gdb/completer.c
> ++++ b/gdb/completer.c
> +@@ -36,7 +36,7 @@
> +    calling a hook instead so we eliminate the CLI dependency.  */
> + #include "gdbcmd.h"
> + 
> +-/* Needed for rl_completer_word_break_characters() and for
> ++/* Needed for rl_completer_word_break_characters and for
> +    rl_filename_completion_function.  */
> + #include "readline/readline.h"
> + 
> +@@ -2011,7 +2011,7 @@ gdb_completion_word_break_characters_throw ()
> +       rl_basic_quote_characters = NULL;
> +     }
> + 
> +-  return rl_completer_word_break_characters;
> ++  return (char *) rl_completer_word_break_characters;
> + }
> + 
> + char *
> +-- 
> +2.31.1
> -- 
> 2.38.1
>
  

Patch

diff --git a/lfs/gdb b/lfs/gdb
index f36e52c8c..bd5a57f29 100644
--- a/lfs/gdb
+++ b/lfs/gdb
@@ -70,6 +70,7 @@  $(subst %,%_BLAKE2,$(objects)) :
 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
 	@$(PREBUILD)
 	@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
+	cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/gdb-readline8.2.patch
 	cd $(DIR_APP) && mkdir -pv build
 	cd $(DIR_APP)/build && \
 		../configure \
diff --git a/src/patches/gdb-readline8.2.patch b/src/patches/gdb-readline8.2.patch
new file mode 100644
index 000000000..93724b109
--- /dev/null
+++ b/src/patches/gdb-readline8.2.patch
@@ -0,0 +1,35 @@ 
+From 1add37b567a7dee39d99f37b37802034c3fce9c4 Mon Sep 17 00:00:00 2001
+From: Andreas Schwab <schwab@linux-m68k.org>
+Date: Sun, 20 Mar 2022 14:01:54 +0100
+Subject: [PATCH] Add support for readline 8.2
+
+In readline 8.2 the type of rl_completer_word_break_characters changed to
+include const.
+---
+ gdb/completer.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/gdb/completer.c b/gdb/completer.c
+index d3900ae2014..a51c16ac7f8 100644
+--- a/gdb/completer.c
++++ b/gdb/completer.c
+@@ -36,7 +36,7 @@
+    calling a hook instead so we eliminate the CLI dependency.  */
+ #include "gdbcmd.h"
+ 
+-/* Needed for rl_completer_word_break_characters() and for
++/* Needed for rl_completer_word_break_characters and for
+    rl_filename_completion_function.  */
+ #include "readline/readline.h"
+ 
+@@ -2011,7 +2011,7 @@ gdb_completion_word_break_characters_throw ()
+       rl_basic_quote_characters = NULL;
+     }
+ 
+-  return rl_completer_word_break_characters;
++  return (char *) rl_completer_word_break_characters;
+ }
+ 
+ char *
+-- 
+2.31.1