mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Ian Abbott <abbotti@mev.co.uk>
To: ptxdist@pengutronix.de
Cc: Ian Abbott <abbotti@mev.co.uk>
Subject: [ptxdist] [PATCH] gdb: Add option to configure lzma support
Date: Wed,  8 May 2024 11:14:04 +0100	[thread overview]
Message-ID: <20240508101404.272507-1-abbotti@mev.co.uk> (raw)

GDB's '--with-lzma=auto/yes/no' option defaults to 'auto' but it would
be better to configure it to 'yes' or 'no' explicitly.  GDB's lzma
support is required to read the .gnu_debuginfo sections in binaries (if
they have been built to include those sections), so call the
configuration option GDB_DEBUGINFO_SUPPORT.

The '--with-lzma' option was added in GDB 7.6, but that is quite old, so
assume it is supported.

While we are at it, change the test `ifneq ($(filter
1%,$(GDBSERVER_VERSION)),)` to use `$(GDB_VERSION)` instead, and add the
'--without-python' configure command line option.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
---
 rules/gdb.in   | 12 ++++++++++++
 rules/gdb.make |  9 ++++++---
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/rules/gdb.in b/rules/gdb.in
index 3014271de..9e76307e3 100644
--- a/rules/gdb.in
+++ b/rules/gdb.in
@@ -8,6 +8,7 @@ menuconfig GDB
 	select GCCLIBS_GCC_S
 	select NCURSES
 	select LIBGMP		if GDB_11_1
+	select XZ		if GDB_DEBUGINFO_SUPPORT
 	help
 	  The GNU Debugger
 
@@ -26,6 +27,17 @@ config GDB_SHARED
 	  If not set, the build option
 	  LDFLAGS=-static will be activated.
 
+config GDB_DEBUGINFO_SUPPORT
+	bool
+	prompt "support reading .gnu_debuginfo sections"
+	help
+	  Configures whether to link with liblzma to support reading the
+	  .gnu_debuginfo sections in binaries.
+
+	  Note: This is useful if TARGET_MINI_DEBUGINFO has been enabled
+	  in the platform configuration to add .gnu_debuginfo sections
+	  to all the binaries.
+
 config GDB_11_1
 	bool
 	prompt "gdb-11.1 or later"
diff --git a/rules/gdb.make b/rules/gdb.make
index 6c9f05fab..c1337427b 100644
--- a/rules/gdb.make
+++ b/rules/gdb.make
@@ -40,10 +40,12 @@ endif
 GDB_CONF_OPT_HOST	:= \
 	--disable-tui \
 	--disable-rpath \
+	--with-lzma=$(call ptx/yesno, PTXCONF_GDB_DEBUGINFO_SUPPORT) \
 	--without-expat \
-	--without-mpfr
+	--without-mpfr \
+	--without-python
 
-ifneq ($(filter 1%,$(GDBSERVER_VERSION)),)
+ifneq ($(filter 1%,$(GDB_VERSION)),)
 # version >= 10
 GDB_CONF_OPT_HOST	+= \
 	--without-xxhash
@@ -72,7 +74,8 @@ GDB_BUILD_OOT := YES
 
 # for gdb subdir configure
 GDB_MAKE_ENV		:= \
-	with_libgmp_prefix=no
+	with_libgmp_prefix=no \
+	with_liblzma_prefix=no
 
 # ----------------------------------------------------------------------------
 # Install
-- 
2.43.0




             reply	other threads:[~2024-05-08 10:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-08 10:14 Ian Abbott [this message]
2024-05-12 13:16 ` [ptxdist] [APPLIED] " Michael Olbrich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240508101404.272507-1-abbotti@mev.co.uk \
    --to=abbotti@mev.co.uk \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox