Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
To: Buildroot List <buildroot@buildroot.org>
Cc: Romain Naour <romain.naour@gmail.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: [Buildroot] [PATCH 3/4] package/gdb: switch to GDB 11.x as the default version
Date: Sat, 13 Aug 2022 10:35:19 +0200	[thread overview]
Message-ID: <20220813083521.1382565-3-thomas.petazzoni@bootlin.com> (raw)
In-Reply-To: <20220813083521.1382565-1-thomas.petazzoni@bootlin.com>

Now that GDB 12.x has been added, and GDB 9.x removed, we can make GDB
11.x the default version.

The handling of the GMP dependency needs a bit of change. Until now,
the GMP dependency was needed when building full GDB (host or target)
in version 11.x or 12.x, so we were explicitly checking whether those
versions were enabled.

Now that only GDB 10.x and the ARC-specific version of GDB are the
only remaining ones not needing GDB, we invert the logic: only those
two versions do not trigger the addition of the GMP dependency.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 package/gdb/Config.in      |  3 +--
 package/gdb/Config.in.host |  6 +++---
 package/gdb/gdb.mk         | 14 +++++++-------
 3 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/package/gdb/Config.in b/package/gdb/Config.in
index c50c3d517a..273b3072ae 100644
--- a/package/gdb/Config.in
+++ b/package/gdb/Config.in
@@ -51,8 +51,7 @@ config BR2_PACKAGE_GDB_DEBUGGER
 	bool "full debugger"
 	depends on BR2_USE_WCHAR
 	depends on !BR2_sh
-	select BR2_PACKAGE_GMP if BR2_GDB_VERSION_11
-	select BR2_PACKAGE_GMP if BR2_GDB_VERSION_12
+	select BR2_PACKAGE_GMP if !BR2_GDB_VERSION_10 && !BR2_arc
 	select BR2_PACKAGE_NCURSES
 
 comment "full gdb on target needs a toolchain w/ wchar"
diff --git a/package/gdb/Config.in.host b/package/gdb/Config.in.host
index 9876c4e8bc..33ffc632ee 100644
--- a/package/gdb/Config.in.host
+++ b/package/gdb/Config.in.host
@@ -41,7 +41,7 @@ config BR2_PACKAGE_HOST_GDB_SIM
 
 choice
 	prompt "GDB debugger Version"
-	default BR2_GDB_VERSION_10
+	default BR2_GDB_VERSION_11
 	depends on !BR2_arc
 	help
 	  Select the version of gdb you wish to use.
@@ -63,8 +63,8 @@ endif
 config BR2_GDB_VERSION
 	string
 	default "arc-2020.09-release-gdb" if BR2_arc
-	default "10.2"	   if BR2_GDB_VERSION_10 || !BR2_PACKAGE_HOST_GDB
-	default "11.2"     if BR2_GDB_VERSION_11
+	default "10.2"	   if BR2_GDB_VERSION_10
+	default "11.2"     if BR2_GDB_VERSION_11 || !BR2_PACKAGE_HOST_GDB
 	default "12.1"     if BR2_GDB_VERSION_12
 	depends on BR2_PACKAGE_GDB || BR2_PACKAGE_HOST_GDB
 
diff --git a/package/gdb/gdb.mk b/package/gdb/gdb.mk
index dd126b42ce..d2bbfcb290 100644
--- a/package/gdb/gdb.mk
+++ b/package/gdb/gdb.mk
@@ -65,8 +65,9 @@ GDB_DEPENDENCIES += host-flex host-bison
 HOST_GDB_DEPENDENCIES += host-flex host-bison
 endif
 
-# Add the necessary host-gmp dependency for the newer releases of GDB
-ifeq ($(BR2_GDB_VERSION_11)$(BR2_GDB_VERSION_12),y)
+# All newer versions of GDB need host-gmp, so it's only for older
+# versions that the dependency can be avoided.
+ifeq ($(BR2_GDB_VERSION_10)$(BR2_arc),)
 HOST_GDB_DEPENDENCIES += host-gmp
 endif
 
@@ -154,11 +155,10 @@ GDB_CONF_OPTS += \
 	--without-curses
 endif
 
-# When GDB >= 11.x (because it's enabled for the host) and we're
-# building the full gdb for the target, we need gmp as a
-# dependency. For now the default gdb version in Buildroot doesn't
-# require gmp.
-ifeq ($(BR2_GDB_VERSION_11)$(BR2_GDB_VERSION_12):$(BR2_PACKAGE_GDB_DEBUGGER),y:y)
+# Starting from GDB 11.x, gmp is needed as a dependency to build full
+# gdb. So we avoid the dependency only for GDB 10.x and the special
+# version used on ARC.
+ifeq ($(BR2_GDB_VERSION_10)$(BR2_arc):$(BR2_PACKAGE_GDB_DEBUGGER),:y)
 GDB_CONF_OPTS += \
 	--with-libgmp-prefix=$(STAGING_DIR)/usr
 GDB_DEPENDENCIES += gmp
-- 
2.37.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  parent reply	other threads:[~2022-08-13  8:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-13  8:35 [Buildroot] [PATCH 1/4] package/gdb: add support for version 12.1 Thomas Petazzoni via buildroot
2022-08-13  8:35 ` [Buildroot] [PATCH 2/4] package/gdb: remove support for 9.2 Thomas Petazzoni via buildroot
2022-08-14 15:59   ` Yann E. MORIN
2022-08-13  8:35 ` Thomas Petazzoni via buildroot [this message]
2022-08-14 15:58   ` [Buildroot] [PATCH 3/4] package/gdb: switch to GDB 11.x as the default version Yann E. MORIN
2022-08-13  8:35 ` [Buildroot] [PATCH 4/4] package/gdb: remove BR2_PACKAGE_GDB_TOPLEVEL Thomas Petazzoni via buildroot
2022-08-14 16:08   ` Yann E. MORIN
2022-08-14 15:59 ` [Buildroot] [PATCH 1/4] package/gdb: add support for version 12.1 Yann E. MORIN

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=20220813083521.1382565-3-thomas.petazzoni@bootlin.com \
    --to=buildroot@buildroot.org \
    --cc=romain.naour@gmail.com \
    --cc=thomas.petazzoni@bootlin.com \
    /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