* [Buildroot] [PATCH] package/gdb: really fix build with GCC 15.x by using external readline
@ 2025-08-17 21:22 Thomas Petazzoni via buildroot
2025-08-24 13:38 ` Romain Naour via buildroot
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni via buildroot @ 2025-08-17 21:22 UTC (permalink / raw)
To: buildroot; +Cc: Thomas Petazzoni
The copy of readline bundled with gdb versions earlier than 16.x does
not build with GCC 15.x, despite our
0010-readline-tcap.h-Update-definitions-for-C23.patch. In GDB 16.x,
readline has been updated to 8.2, which fixes the issue, but
backporting this to older GDB versions results in a ~450 KB.
So let's take the approach we should have probably taken from the
ground up: use an external readline, instead of the bundled one. This
is exactly what this patch does. Instead of having gdb depend on
ncurses and host-gdb depend on host-ncurses, we make it depend on
readline/host-readline (which in turn already has a dependency on
ncurses). In fact, gdb does not need ncurses itself, it really needs
only readline.
Fixes:
https://autobuild.buildroot.net/results/3b0ce5cfac81e150816027fc1259600ee02f0f1f/ (host gdb 14.x)
https://autobuild.buildroot.net/results/e64e3cd7aa5e7315464e380982f7febaff5df908/ (host gdb 15.x)
https://autobuild.buildroot.net/results/2f2616a4ac7d9cbc06ba7775eb57bdd2a0419cb5/ (host arc gdb)
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
...ne-tcap.h-Update-definitions-for-C23.patch | 52 -------------------
...ne-tcap.h-Update-definitions-for-C23.patch | 52 -------------------
...ne-tcap.h-Update-definitions-for-C23.patch | 52 -------------------
package/gdb/Config.in | 2 +-
...ne-tcap.h-Update-definitions-for-C23.patch | 52 -------------------
package/gdb/gdb.mk | 6 ++-
6 files changed, 5 insertions(+), 211 deletions(-)
delete mode 100644 package/gdb/14.2/0010-readline-tcap.h-Update-definitions-for-C23.patch
delete mode 100644 package/gdb/15.2/0010-readline-tcap.h-Update-definitions-for-C23.patch
delete mode 100644 package/gdb/16.3/0010-readline-tcap.h-Update-definitions-for-C23.patch
delete mode 100644 package/gdb/arc-2024.12-release-gdb/0001-readline-tcap.h-Update-definitions-for-C23.patch
diff --git a/package/gdb/14.2/0010-readline-tcap.h-Update-definitions-for-C23.patch b/package/gdb/14.2/0010-readline-tcap.h-Update-definitions-for-C23.patch
deleted file mode 100644
index 50100d8bfc..0000000000
--- a/package/gdb/14.2/0010-readline-tcap.h-Update-definitions-for-C23.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From 0f81e47dff4bddc6ba9c45402821f857251f2b0f Mon Sep 17 00:00:00 2001
-From: Chris Packham <judge.packham@gmail.com>
-Date: Wed, 30 Apr 2025 16:49:44 +1200
-Subject: [PATCH] readline/tcap.h: Update definitions for C23
-
-C23 changes how function definitions like int `int tputs ()` are
-interpreted. In older standards this meant that the function arguments
-are unknown. In C23 this is interpreted as `int tputs (void)` so now
-when we compile with GCC15 (which defaults to -std=gnu23) we get an
-error such as
-
- readline/display.c:2839:17: error: too many arguments to function 'tputs'; expected 0, have 3
-
-Add the function arguments for tgetent(), tgetflag(), tgetnum(),
-tgetstr(), tputs() and tgoto().
-
-Signed-off-by: Chris Packham <judge.packham@gmail.com>
-Approved-By: Tom Tromey <tom@tromey.com>
-Upstream: 5c87b330e910f8be1443c881fd16a70e685f1f2f
-Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
----
- readline/readline/tcap.h | 12 ++++++------
- 1 file changed, 6 insertions(+), 6 deletions(-)
-
-diff --git a/readline/readline/tcap.h b/readline/readline/tcap.h
-index 859e6eed5aa..9e2ed124e49 100644
---- a/readline/readline/tcap.h
-+++ b/readline/readline/tcap.h
-@@ -46,14 +46,14 @@ extern char *UP, *BC;
-
- extern short ospeed;
-
--extern int tgetent ();
--extern int tgetflag ();
--extern int tgetnum ();
--extern char *tgetstr ();
-+extern int tgetent (char *bp, const char *name);
-+extern int tgetflag (char *id);
-+extern int tgetnum (char *id);
-+extern char *tgetstr (char *id, char **area);
-
--extern int tputs ();
-+extern int tputs (const char *str, int affcnt, int (*putc)(int));
-
--extern char *tgoto ();
-+extern char *tgoto (const char *cap, int col, int row);
-
- #endif /* HAVE_TERMCAP_H */
-
---
-2.49.0
-
diff --git a/package/gdb/15.2/0010-readline-tcap.h-Update-definitions-for-C23.patch b/package/gdb/15.2/0010-readline-tcap.h-Update-definitions-for-C23.patch
deleted file mode 100644
index 64f741fe75..0000000000
--- a/package/gdb/15.2/0010-readline-tcap.h-Update-definitions-for-C23.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From 130750cf9607fc1c4bcbead820a27bee6ee60f04 Mon Sep 17 00:00:00 2001
-From: Chris Packham <judge.packham@gmail.com>
-Date: Wed, 30 Apr 2025 16:49:44 +1200
-Subject: [PATCH] readline/tcap.h: Update definitions for C23
-
-C23 changes how function definitions like int `int tputs ()` are
-interpreted. In older standards this meant that the function arguments
-are unknown. In C23 this is interpreted as `int tputs (void)` so now
-when we compile with GCC15 (which defaults to -std=gnu23) we get an
-error such as
-
- readline/display.c:2839:17: error: too many arguments to function 'tputs'; expected 0, have 3
-
-Add the function arguments for tgetent(), tgetflag(), tgetnum(),
-tgetstr(), tputs() and tgoto().
-
-Signed-off-by: Chris Packham <judge.packham@gmail.com>
-Approved-By: Tom Tromey <tom@tromey.com>
-Upstream: 5c87b330e910f8be1443c881fd16a70e685f1f2f
-Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
----
- readline/readline/tcap.h | 12 ++++++------
- 1 file changed, 6 insertions(+), 6 deletions(-)
-
-diff --git a/readline/readline/tcap.h b/readline/readline/tcap.h
-index 859e6eed5aa..9e2ed124e49 100644
---- a/readline/readline/tcap.h
-+++ b/readline/readline/tcap.h
-@@ -46,14 +46,14 @@ extern char *UP, *BC;
-
- extern short ospeed;
-
--extern int tgetent ();
--extern int tgetflag ();
--extern int tgetnum ();
--extern char *tgetstr ();
-+extern int tgetent (char *bp, const char *name);
-+extern int tgetflag (char *id);
-+extern int tgetnum (char *id);
-+extern char *tgetstr (char *id, char **area);
-
--extern int tputs ();
-+extern int tputs (const char *str, int affcnt, int (*putc)(int));
-
--extern char *tgoto ();
-+extern char *tgoto (const char *cap, int col, int row);
-
- #endif /* HAVE_TERMCAP_H */
-
---
-2.49.0
-
diff --git a/package/gdb/16.3/0010-readline-tcap.h-Update-definitions-for-C23.patch b/package/gdb/16.3/0010-readline-tcap.h-Update-definitions-for-C23.patch
deleted file mode 100644
index c9a34e9a89..0000000000
--- a/package/gdb/16.3/0010-readline-tcap.h-Update-definitions-for-C23.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From f37d1bbe334c751b9bd77fa3a9d9accd93614677 Mon Sep 17 00:00:00 2001
-From: Chris Packham <judge.packham@gmail.com>
-Date: Wed, 30 Apr 2025 16:49:44 +1200
-Subject: [PATCH] readline/tcap.h: Update definitions for C23
-
-C23 changes how function definitions like int `int tputs ()` are
-interpreted. In older standards this meant that the function arguments
-are unknown. In C23 this is interpreted as `int tputs (void)` so now
-when we compile with GCC15 (which defaults to -std=gnu23) we get an
-error such as
-
- readline/display.c:2839:17: error: too many arguments to function 'tputs'; expected 0, have 3
-
-Add the function arguments for tgetent(), tgetflag(), tgetnum(),
-tgetstr(), tputs() and tgoto().
-
-Signed-off-by: Chris Packham <judge.packham@gmail.com>
-Approved-By: Tom Tromey <tom@tromey.com>
-Upstream: 5c87b330e910f8be1443c881fd16a70e685f1f2f
-Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
----
- readline/readline/tcap.h | 12 ++++++------
- 1 file changed, 6 insertions(+), 6 deletions(-)
-
-diff --git a/readline/readline/tcap.h b/readline/readline/tcap.h
-index 859e6eed5aa..9e2ed124e49 100644
---- a/readline/readline/tcap.h
-+++ b/readline/readline/tcap.h
-@@ -46,14 +46,14 @@ extern char *UP, *BC;
-
- extern short ospeed;
-
--extern int tgetent ();
--extern int tgetflag ();
--extern int tgetnum ();
--extern char *tgetstr ();
-+extern int tgetent (char *bp, const char *name);
-+extern int tgetflag (char *id);
-+extern int tgetnum (char *id);
-+extern char *tgetstr (char *id, char **area);
-
--extern int tputs ();
-+extern int tputs (const char *str, int affcnt, int (*putc)(int));
-
--extern char *tgoto ();
-+extern char *tgoto (const char *cap, int col, int row);
-
- #endif /* HAVE_TERMCAP_H */
-
---
-2.49.0
-
diff --git a/package/gdb/Config.in b/package/gdb/Config.in
index b1678e0d63..03f5e2596b 100644
--- a/package/gdb/Config.in
+++ b/package/gdb/Config.in
@@ -60,7 +60,7 @@ config BR2_PACKAGE_GDB_DEBUGGER
depends on !BR2_sh
select BR2_PACKAGE_GMP
select BR2_PACKAGE_MPFR
- select BR2_PACKAGE_NCURSES
+ select BR2_PACKAGE_READLINE
select BR2_PACKAGE_ZLIB
comment "full gdb on target needs a toolchain w/ wchar"
diff --git a/package/gdb/arc-2024.12-release-gdb/0001-readline-tcap.h-Update-definitions-for-C23.patch b/package/gdb/arc-2024.12-release-gdb/0001-readline-tcap.h-Update-definitions-for-C23.patch
deleted file mode 100644
index 64f741fe75..0000000000
--- a/package/gdb/arc-2024.12-release-gdb/0001-readline-tcap.h-Update-definitions-for-C23.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From 130750cf9607fc1c4bcbead820a27bee6ee60f04 Mon Sep 17 00:00:00 2001
-From: Chris Packham <judge.packham@gmail.com>
-Date: Wed, 30 Apr 2025 16:49:44 +1200
-Subject: [PATCH] readline/tcap.h: Update definitions for C23
-
-C23 changes how function definitions like int `int tputs ()` are
-interpreted. In older standards this meant that the function arguments
-are unknown. In C23 this is interpreted as `int tputs (void)` so now
-when we compile with GCC15 (which defaults to -std=gnu23) we get an
-error such as
-
- readline/display.c:2839:17: error: too many arguments to function 'tputs'; expected 0, have 3
-
-Add the function arguments for tgetent(), tgetflag(), tgetnum(),
-tgetstr(), tputs() and tgoto().
-
-Signed-off-by: Chris Packham <judge.packham@gmail.com>
-Approved-By: Tom Tromey <tom@tromey.com>
-Upstream: 5c87b330e910f8be1443c881fd16a70e685f1f2f
-Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
----
- readline/readline/tcap.h | 12 ++++++------
- 1 file changed, 6 insertions(+), 6 deletions(-)
-
-diff --git a/readline/readline/tcap.h b/readline/readline/tcap.h
-index 859e6eed5aa..9e2ed124e49 100644
---- a/readline/readline/tcap.h
-+++ b/readline/readline/tcap.h
-@@ -46,14 +46,14 @@ extern char *UP, *BC;
-
- extern short ospeed;
-
--extern int tgetent ();
--extern int tgetflag ();
--extern int tgetnum ();
--extern char *tgetstr ();
-+extern int tgetent (char *bp, const char *name);
-+extern int tgetflag (char *id);
-+extern int tgetnum (char *id);
-+extern char *tgetstr (char *id, char **area);
-
--extern int tputs ();
-+extern int tputs (const char *str, int affcnt, int (*putc)(int));
-
--extern char *tgoto ();
-+extern char *tgoto (const char *cap, int col, int row);
-
- #endif /* HAVE_TERMCAP_H */
-
---
-2.49.0
-
diff --git a/package/gdb/gdb.mk b/package/gdb/gdb.mk
index ca9c6d74d5..c835b0646b 100644
--- a/package/gdb/gdb.mk
+++ b/package/gdb/gdb.mk
@@ -30,7 +30,7 @@ GDB_PRE_CONFIGURE_HOOKS += GDB_CONFIGURE_SYMLINK
# For the host variant, we really want to build with XML support,
# which is needed to read XML descriptions of target architectures. We
# also need ncurses.
-HOST_GDB_DEPENDENCIES = host-expat host-ncurses host-zlib
+HOST_GDB_DEPENDENCIES = host-expat host-readline host-zlib
# Disable building documentation
GDB_MAKE_OPTS += MAKEINFO=true
@@ -136,9 +136,10 @@ ifeq ($(BR2_PACKAGE_GDB_DEBUGGER),y)
GDB_DEPENDENCIES += zlib
GDB_CONF_OPTS += \
--enable-gdb \
+ --with-system-readline \
--with-curses \
--with-system-zlib
-GDB_DEPENDENCIES += ncurses \
+GDB_DEPENDENCIES += readline \
$(if $(BR2_PACKAGE_LIBICONV),libiconv)
else
# When only building gdbserver, we don't need zlib. But we have no way to
@@ -262,6 +263,7 @@ HOST_GDB_CONF_OPTS = \
--with-system-zlib \
--with-curses \
--disable-source-highlight \
+ --with-system-readline \
$(GDB_DISABLE_BINUTILS_CONF_OPTS) \
--with-mpfr=$(HOST_DIR)
--
2.50.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Buildroot] [PATCH] package/gdb: really fix build with GCC 15.x by using external readline
2025-08-17 21:22 [Buildroot] [PATCH] package/gdb: really fix build with GCC 15.x by using external readline Thomas Petazzoni via buildroot
@ 2025-08-24 13:38 ` Romain Naour via buildroot
2025-08-24 13:41 ` Thomas Petazzoni via buildroot
0 siblings, 1 reply; 3+ messages in thread
From: Romain Naour via buildroot @ 2025-08-24 13:38 UTC (permalink / raw)
To: Thomas Petazzoni, buildroot
Hello Thomas, All,
Le 17/08/2025 à 23:22, Thomas Petazzoni via buildroot a écrit :
> The copy of readline bundled with gdb versions earlier than 16.x does
> not build with GCC 15.x, despite our
> 0010-readline-tcap.h-Update-definitions-for-C23.patch. In GDB 16.x,
> readline has been updated to 8.2, which fixes the issue, but
> backporting this to older GDB versions results in a ~450 KB.
>
> So let's take the approach we should have probably taken from the
> ground up: use an external readline, instead of the bundled one. This
> is exactly what this patch does. Instead of having gdb depend on
> ncurses and host-gdb depend on host-ncurses, we make it depend on
> readline/host-readline (which in turn already has a dependency on
> ncurses). In fact, gdb does not need ncurses itself, it really needs
> only readline.
I'm agree on the principle but what about gdb TUI option (BR2_PACKAGE_GDB_TUI)?
gdb TUI seems really requires ncurses [1].
ncurses package should be selected by gdb TUI.
[1]
https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=gdb/configure.ac;h=52924106bca436a810dc502c3a98e3b60a653d57;hb=356fff4944574b40d58146b3d09fa0c980aa0a70#l629
Best regards,
Romain
>
> Fixes:
>
> https://autobuild.buildroot.net/results/3b0ce5cfac81e150816027fc1259600ee02f0f1f/ (host gdb 14.x)
> https://autobuild.buildroot.net/results/e64e3cd7aa5e7315464e380982f7febaff5df908/ (host gdb 15.x)
> https://autobuild.buildroot.net/results/2f2616a4ac7d9cbc06ba7775eb57bdd2a0419cb5/ (host arc gdb)
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> ---
> ...ne-tcap.h-Update-definitions-for-C23.patch | 52 -------------------
> ...ne-tcap.h-Update-definitions-for-C23.patch | 52 -------------------
> ...ne-tcap.h-Update-definitions-for-C23.patch | 52 -------------------
> package/gdb/Config.in | 2 +-
> ...ne-tcap.h-Update-definitions-for-C23.patch | 52 -------------------
> package/gdb/gdb.mk | 6 ++-
> 6 files changed, 5 insertions(+), 211 deletions(-)
> delete mode 100644 package/gdb/14.2/0010-readline-tcap.h-Update-definitions-for-C23.patch
> delete mode 100644 package/gdb/15.2/0010-readline-tcap.h-Update-definitions-for-C23.patch
> delete mode 100644 package/gdb/16.3/0010-readline-tcap.h-Update-definitions-for-C23.patch
> delete mode 100644 package/gdb/arc-2024.12-release-gdb/0001-readline-tcap.h-Update-definitions-for-C23.patch
>
> diff --git a/package/gdb/14.2/0010-readline-tcap.h-Update-definitions-for-C23.patch b/package/gdb/14.2/0010-readline-tcap.h-Update-definitions-for-C23.patch
> deleted file mode 100644
> index 50100d8bfc..0000000000
> --- a/package/gdb/14.2/0010-readline-tcap.h-Update-definitions-for-C23.patch
> +++ /dev/null
> @@ -1,52 +0,0 @@
> -From 0f81e47dff4bddc6ba9c45402821f857251f2b0f Mon Sep 17 00:00:00 2001
> -From: Chris Packham <judge.packham@gmail.com>
> -Date: Wed, 30 Apr 2025 16:49:44 +1200
> -Subject: [PATCH] readline/tcap.h: Update definitions for C23
> -
> -C23 changes how function definitions like int `int tputs ()` are
> -interpreted. In older standards this meant that the function arguments
> -are unknown. In C23 this is interpreted as `int tputs (void)` so now
> -when we compile with GCC15 (which defaults to -std=gnu23) we get an
> -error such as
> -
> - readline/display.c:2839:17: error: too many arguments to function 'tputs'; expected 0, have 3
> -
> -Add the function arguments for tgetent(), tgetflag(), tgetnum(),
> -tgetstr(), tputs() and tgoto().
> -
> -Signed-off-by: Chris Packham <judge.packham@gmail.com>
> -Approved-By: Tom Tromey <tom@tromey.com>
> -Upstream: 5c87b330e910f8be1443c881fd16a70e685f1f2f
> -Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> ----
> - readline/readline/tcap.h | 12 ++++++------
> - 1 file changed, 6 insertions(+), 6 deletions(-)
> -
> -diff --git a/readline/readline/tcap.h b/readline/readline/tcap.h
> -index 859e6eed5aa..9e2ed124e49 100644
> ---- a/readline/readline/tcap.h
> -+++ b/readline/readline/tcap.h
> -@@ -46,14 +46,14 @@ extern char *UP, *BC;
> -
> - extern short ospeed;
> -
> --extern int tgetent ();
> --extern int tgetflag ();
> --extern int tgetnum ();
> --extern char *tgetstr ();
> -+extern int tgetent (char *bp, const char *name);
> -+extern int tgetflag (char *id);
> -+extern int tgetnum (char *id);
> -+extern char *tgetstr (char *id, char **area);
> -
> --extern int tputs ();
> -+extern int tputs (const char *str, int affcnt, int (*putc)(int));
> -
> --extern char *tgoto ();
> -+extern char *tgoto (const char *cap, int col, int row);
> -
> - #endif /* HAVE_TERMCAP_H */
> -
> ---
> -2.49.0
> -
> diff --git a/package/gdb/15.2/0010-readline-tcap.h-Update-definitions-for-C23.patch b/package/gdb/15.2/0010-readline-tcap.h-Update-definitions-for-C23.patch
> deleted file mode 100644
> index 64f741fe75..0000000000
> --- a/package/gdb/15.2/0010-readline-tcap.h-Update-definitions-for-C23.patch
> +++ /dev/null
> @@ -1,52 +0,0 @@
> -From 130750cf9607fc1c4bcbead820a27bee6ee60f04 Mon Sep 17 00:00:00 2001
> -From: Chris Packham <judge.packham@gmail.com>
> -Date: Wed, 30 Apr 2025 16:49:44 +1200
> -Subject: [PATCH] readline/tcap.h: Update definitions for C23
> -
> -C23 changes how function definitions like int `int tputs ()` are
> -interpreted. In older standards this meant that the function arguments
> -are unknown. In C23 this is interpreted as `int tputs (void)` so now
> -when we compile with GCC15 (which defaults to -std=gnu23) we get an
> -error such as
> -
> - readline/display.c:2839:17: error: too many arguments to function 'tputs'; expected 0, have 3
> -
> -Add the function arguments for tgetent(), tgetflag(), tgetnum(),
> -tgetstr(), tputs() and tgoto().
> -
> -Signed-off-by: Chris Packham <judge.packham@gmail.com>
> -Approved-By: Tom Tromey <tom@tromey.com>
> -Upstream: 5c87b330e910f8be1443c881fd16a70e685f1f2f
> -Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> ----
> - readline/readline/tcap.h | 12 ++++++------
> - 1 file changed, 6 insertions(+), 6 deletions(-)
> -
> -diff --git a/readline/readline/tcap.h b/readline/readline/tcap.h
> -index 859e6eed5aa..9e2ed124e49 100644
> ---- a/readline/readline/tcap.h
> -+++ b/readline/readline/tcap.h
> -@@ -46,14 +46,14 @@ extern char *UP, *BC;
> -
> - extern short ospeed;
> -
> --extern int tgetent ();
> --extern int tgetflag ();
> --extern int tgetnum ();
> --extern char *tgetstr ();
> -+extern int tgetent (char *bp, const char *name);
> -+extern int tgetflag (char *id);
> -+extern int tgetnum (char *id);
> -+extern char *tgetstr (char *id, char **area);
> -
> --extern int tputs ();
> -+extern int tputs (const char *str, int affcnt, int (*putc)(int));
> -
> --extern char *tgoto ();
> -+extern char *tgoto (const char *cap, int col, int row);
> -
> - #endif /* HAVE_TERMCAP_H */
> -
> ---
> -2.49.0
> -
> diff --git a/package/gdb/16.3/0010-readline-tcap.h-Update-definitions-for-C23.patch b/package/gdb/16.3/0010-readline-tcap.h-Update-definitions-for-C23.patch
> deleted file mode 100644
> index c9a34e9a89..0000000000
> --- a/package/gdb/16.3/0010-readline-tcap.h-Update-definitions-for-C23.patch
> +++ /dev/null
> @@ -1,52 +0,0 @@
> -From f37d1bbe334c751b9bd77fa3a9d9accd93614677 Mon Sep 17 00:00:00 2001
> -From: Chris Packham <judge.packham@gmail.com>
> -Date: Wed, 30 Apr 2025 16:49:44 +1200
> -Subject: [PATCH] readline/tcap.h: Update definitions for C23
> -
> -C23 changes how function definitions like int `int tputs ()` are
> -interpreted. In older standards this meant that the function arguments
> -are unknown. In C23 this is interpreted as `int tputs (void)` so now
> -when we compile with GCC15 (which defaults to -std=gnu23) we get an
> -error such as
> -
> - readline/display.c:2839:17: error: too many arguments to function 'tputs'; expected 0, have 3
> -
> -Add the function arguments for tgetent(), tgetflag(), tgetnum(),
> -tgetstr(), tputs() and tgoto().
> -
> -Signed-off-by: Chris Packham <judge.packham@gmail.com>
> -Approved-By: Tom Tromey <tom@tromey.com>
> -Upstream: 5c87b330e910f8be1443c881fd16a70e685f1f2f
> -Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> ----
> - readline/readline/tcap.h | 12 ++++++------
> - 1 file changed, 6 insertions(+), 6 deletions(-)
> -
> -diff --git a/readline/readline/tcap.h b/readline/readline/tcap.h
> -index 859e6eed5aa..9e2ed124e49 100644
> ---- a/readline/readline/tcap.h
> -+++ b/readline/readline/tcap.h
> -@@ -46,14 +46,14 @@ extern char *UP, *BC;
> -
> - extern short ospeed;
> -
> --extern int tgetent ();
> --extern int tgetflag ();
> --extern int tgetnum ();
> --extern char *tgetstr ();
> -+extern int tgetent (char *bp, const char *name);
> -+extern int tgetflag (char *id);
> -+extern int tgetnum (char *id);
> -+extern char *tgetstr (char *id, char **area);
> -
> --extern int tputs ();
> -+extern int tputs (const char *str, int affcnt, int (*putc)(int));
> -
> --extern char *tgoto ();
> -+extern char *tgoto (const char *cap, int col, int row);
> -
> - #endif /* HAVE_TERMCAP_H */
> -
> ---
> -2.49.0
> -
> diff --git a/package/gdb/Config.in b/package/gdb/Config.in
> index b1678e0d63..03f5e2596b 100644
> --- a/package/gdb/Config.in
> +++ b/package/gdb/Config.in
> @@ -60,7 +60,7 @@ config BR2_PACKAGE_GDB_DEBUGGER
> depends on !BR2_sh
> select BR2_PACKAGE_GMP
> select BR2_PACKAGE_MPFR
> - select BR2_PACKAGE_NCURSES
> + select BR2_PACKAGE_READLINE
> select BR2_PACKAGE_ZLIB
>
> comment "full gdb on target needs a toolchain w/ wchar"
> diff --git a/package/gdb/arc-2024.12-release-gdb/0001-readline-tcap.h-Update-definitions-for-C23.patch b/package/gdb/arc-2024.12-release-gdb/0001-readline-tcap.h-Update-definitions-for-C23.patch
> deleted file mode 100644
> index 64f741fe75..0000000000
> --- a/package/gdb/arc-2024.12-release-gdb/0001-readline-tcap.h-Update-definitions-for-C23.patch
> +++ /dev/null
> @@ -1,52 +0,0 @@
> -From 130750cf9607fc1c4bcbead820a27bee6ee60f04 Mon Sep 17 00:00:00 2001
> -From: Chris Packham <judge.packham@gmail.com>
> -Date: Wed, 30 Apr 2025 16:49:44 +1200
> -Subject: [PATCH] readline/tcap.h: Update definitions for C23
> -
> -C23 changes how function definitions like int `int tputs ()` are
> -interpreted. In older standards this meant that the function arguments
> -are unknown. In C23 this is interpreted as `int tputs (void)` so now
> -when we compile with GCC15 (which defaults to -std=gnu23) we get an
> -error such as
> -
> - readline/display.c:2839:17: error: too many arguments to function 'tputs'; expected 0, have 3
> -
> -Add the function arguments for tgetent(), tgetflag(), tgetnum(),
> -tgetstr(), tputs() and tgoto().
> -
> -Signed-off-by: Chris Packham <judge.packham@gmail.com>
> -Approved-By: Tom Tromey <tom@tromey.com>
> -Upstream: 5c87b330e910f8be1443c881fd16a70e685f1f2f
> -Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> ----
> - readline/readline/tcap.h | 12 ++++++------
> - 1 file changed, 6 insertions(+), 6 deletions(-)
> -
> -diff --git a/readline/readline/tcap.h b/readline/readline/tcap.h
> -index 859e6eed5aa..9e2ed124e49 100644
> ---- a/readline/readline/tcap.h
> -+++ b/readline/readline/tcap.h
> -@@ -46,14 +46,14 @@ extern char *UP, *BC;
> -
> - extern short ospeed;
> -
> --extern int tgetent ();
> --extern int tgetflag ();
> --extern int tgetnum ();
> --extern char *tgetstr ();
> -+extern int tgetent (char *bp, const char *name);
> -+extern int tgetflag (char *id);
> -+extern int tgetnum (char *id);
> -+extern char *tgetstr (char *id, char **area);
> -
> --extern int tputs ();
> -+extern int tputs (const char *str, int affcnt, int (*putc)(int));
> -
> --extern char *tgoto ();
> -+extern char *tgoto (const char *cap, int col, int row);
> -
> - #endif /* HAVE_TERMCAP_H */
> -
> ---
> -2.49.0
> -
> diff --git a/package/gdb/gdb.mk b/package/gdb/gdb.mk
> index ca9c6d74d5..c835b0646b 100644
> --- a/package/gdb/gdb.mk
> +++ b/package/gdb/gdb.mk
> @@ -30,7 +30,7 @@ GDB_PRE_CONFIGURE_HOOKS += GDB_CONFIGURE_SYMLINK
> # For the host variant, we really want to build with XML support,
> # which is needed to read XML descriptions of target architectures. We
> # also need ncurses.
> -HOST_GDB_DEPENDENCIES = host-expat host-ncurses host-zlib
> +HOST_GDB_DEPENDENCIES = host-expat host-readline host-zlib
>
> # Disable building documentation
> GDB_MAKE_OPTS += MAKEINFO=true
> @@ -136,9 +136,10 @@ ifeq ($(BR2_PACKAGE_GDB_DEBUGGER),y)
> GDB_DEPENDENCIES += zlib
> GDB_CONF_OPTS += \
> --enable-gdb \
> + --with-system-readline \
> --with-curses \
> --with-system-zlib
> -GDB_DEPENDENCIES += ncurses \
> +GDB_DEPENDENCIES += readline \
> $(if $(BR2_PACKAGE_LIBICONV),libiconv)
> else
> # When only building gdbserver, we don't need zlib. But we have no way to
> @@ -262,6 +263,7 @@ HOST_GDB_CONF_OPTS = \
> --with-system-zlib \
> --with-curses \
> --disable-source-highlight \
> + --with-system-readline \
> $(GDB_DISABLE_BINUTILS_CONF_OPTS) \
> --with-mpfr=$(HOST_DIR)
>
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Buildroot] [PATCH] package/gdb: really fix build with GCC 15.x by using external readline
2025-08-24 13:38 ` Romain Naour via buildroot
@ 2025-08-24 13:41 ` Thomas Petazzoni via buildroot
0 siblings, 0 replies; 3+ messages in thread
From: Thomas Petazzoni via buildroot @ 2025-08-24 13:41 UTC (permalink / raw)
To: Romain Naour; +Cc: buildroot
On Sun, 24 Aug 2025 15:38:01 +0200
Romain Naour <romain.naour@smile.fr> wrote:
> I'm agree on the principle but what about gdb TUI option (BR2_PACKAGE_GDB_TUI)?
> gdb TUI seems really requires ncurses [1].
>
> ncurses package should be selected by gdb TUI.
Note that our readline package does select ncurses. However, if GDB's
tui uses ncurses directly, then we should also have a "select
BR2_PACKAGE_NCURSES" for this option.
Indeed, readline can potentially *not* use ncurses: it can use the
termcap library instead of ncurses. This is not the choice we've made
in Buildroot, but it's a possible option.
I'll rework the patch accordingly.
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-08-24 13:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-17 21:22 [Buildroot] [PATCH] package/gdb: really fix build with GCC 15.x by using external readline Thomas Petazzoni via buildroot
2025-08-24 13:38 ` Romain Naour via buildroot
2025-08-24 13:41 ` Thomas Petazzoni via buildroot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox