mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH 1/2] gdb-menu: fix indentation
@ 2018-11-08 12:13 Roland Hieber
  2018-11-08 12:13 ` [ptxdist] [PATCH 2/2] gdb, gdbserver: prefer the source md5sum from the toolchain Roland Hieber
  0 siblings, 1 reply; 6+ messages in thread
From: Roland Hieber @ 2018-11-08 12:13 UTC (permalink / raw)
  To: ptxdist; +Cc: Roland Hieber

Signed-off-by: Roland Hieber <r.hieber@pengutronix.de>
---
 rules/gdb-menu.in | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/rules/gdb-menu.in b/rules/gdb-menu.in
index 907d23942..d8be3fef8 100644
--- a/rules/gdb-menu.in
+++ b/rules/gdb-menu.in
@@ -4,30 +4,30 @@ menu "gdb                           "
 
 # must be before GDB - used by gdb & gdbserver
 
 if GDB || GDBSERVER
 
 config GDB_TOOLCHAIN_VERSION
-       bool
-       default y if GDBSERVER
-       prompt "use toolchain gdb version"
-       help
+	bool
+	default y if GDBSERVER
+	prompt "use toolchain gdb version"
+	help
 	  Use the same version as the gdb in the toolchain to make sure that
 	  gdb and gdbserver work correctly.
 
 if !GDB_TOOLCHAIN_VERSION
 
 config GDB_VERSION
-       string "gdb version"
-       default "7.6.1"
+	string "gdb version"
+	default "7.6.1"
 endif
 
 config GDB_MD5
 	string "gdb source md5sum"
 	default "d42841167fd061d90fddf9a7212a1f9f" if !GDB_TOOLCHAIN_VERSION
-       help
+	help
 	  md5sum for the gdb source archive. If the version is provided by
 	  the toolchain and the toolchain is a OSELAS.Toolchain then this
 	  can be left empty and the md5sum from the toolchain ptxconfig is
 	  used.
 
 endif
-- 
2.19.1


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ptxdist] [PATCH 2/2] gdb, gdbserver: prefer the source md5sum from the toolchain
  2018-11-08 12:13 [ptxdist] [PATCH 1/2] gdb-menu: fix indentation Roland Hieber
@ 2018-11-08 12:13 ` Roland Hieber
  2018-11-08 15:04   ` Michael Olbrich
  0 siblings, 1 reply; 6+ messages in thread
From: Roland Hieber @ 2018-11-08 12:13 UTC (permalink / raw)
  To: ptxdist; +Cc: Roland Hieber

If the md5sum can be autodetected from the toolchain, we should use the
value from the toolchain and ignore the value specified in the menu.
This eases migration for BSPs that previously specified it in the menu
and didn't clear it when enabling GDB_TOOLCHAIN_VERSION (which defaults
to 'y' if GDBSERVER is used).

Some older OSELAS toolchains (and also non-OSELAS toolchains) don't set
PTXCONF_CROSS_GDB_MD5 in their ptxconfig (or they simply don't have a
ptxconfig). In those cases, the md5sum must be specified in the menu.

Signed-off-by: Roland Hieber <r.hieber@pengutronix.de>
---
 rules/gdb-menu.in  | 12 ++++++++----
 rules/pre/gdb.make |  5 +++--
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/rules/gdb-menu.in b/rules/gdb-menu.in
index d8be3fef8..af69aca56 100644
--- a/rules/gdb-menu.in
+++ b/rules/gdb-menu.in
@@ -22,16 +22,20 @@ config GDB_VERSION
 endif
 
 config GDB_MD5
 	string "gdb source md5sum"
 	default "d42841167fd061d90fddf9a7212a1f9f" if !GDB_TOOLCHAIN_VERSION
 	help
-	  md5sum for the gdb source archive. If the version is provided by
-	  the toolchain and the toolchain is a OSELAS.Toolchain then this
-	  can be left empty and the md5sum from the toolchain ptxconfig is
-	  used.
+	  md5sum for the gdb source archive.
+	  
+	  If the version is provided by the toolchain and its md5sum can be
+	  autodetected (e.g. with newer OSELAS.Toolchains), then the md5sum
+	  from the toolchain is used instead and the value specified here is
+	  ignored.
+	  
+	  Otherwise, specify the md5sum of the tar.xz archive.
 
 endif
 
 source "generated/debug_tools_gdb.in"
 
 endmenu
diff --git a/rules/pre/gdb.make b/rules/pre/gdb.make
index 31b1975d6..11f48381d 100644
--- a/rules/pre/gdb.make
+++ b/rules/pre/gdb.make
@@ -11,14 +11,15 @@
 SHARED_GDB_MD5		:= $(call remove_quotes,$(PTXCONF_GDB_MD5))
 
 ifdef PTXCONF_GDB_TOOLCHAIN_VERSION
 TOOLCHAIN_CONFIG	:= $(PTXDIST_PLATFORMDIR)/selected_toolchain/ptxconfig
 ifneq ($(wildcard $(TOOLCHAIN_CONFIG)),)
 SHARED_GDB_VERSION	:= $(call remove_quotes,$(shell ptxd_get_kconfig $(TOOLCHAIN_CONFIG) PTXCONF_CROSS_GDB_VERSION))
-ifeq ($(SHARED_GDB_MD5),)
-SHARED_GDB_MD5		:= $(call remove_quotes,$(shell ptxd_get_kconfig $(TOOLCHAIN_CONFIG) PTXCONF_CROSS_GDB_MD5))
+TOOLCHAIN_GDB_MD5	:= $(call remove_quotes,$(shell ptxd_get_kconfig $(TOOLCHAIN_CONFIG) PTXCONF_CROSS_GDB_MD5))
+ifneq ($(TOOLCHAIN_GDB_MD5),)
+SHARED_GDB_MD5		:= $(TOOLCHAIN_GDB_MD5)
 endif
 else
 SHARED_GDB_VERSION	:= $(shell $(PTXCONF_COMPILER_PREFIX)gdb -v | sed -e 's/.* //;q')
 endif
 else
 SHARED_GDB_VERSION	:= $(call remove_quotes,$(PTXCONF_GDB_VERSION))
-- 
2.19.1


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ptxdist] [PATCH 2/2] gdb, gdbserver: prefer the source md5sum from the toolchain
  2018-11-08 12:13 ` [ptxdist] [PATCH 2/2] gdb, gdbserver: prefer the source md5sum from the toolchain Roland Hieber
@ 2018-11-08 15:04   ` Michael Olbrich
  2018-11-09 14:05     ` Roland Hieber
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Olbrich @ 2018-11-08 15:04 UTC (permalink / raw)
  To: ptxdist

On Thu, Nov 08, 2018 at 01:13:42PM +0100, Roland Hieber wrote:
> If the md5sum can be autodetected from the toolchain, we should use the
> value from the toolchain and ignore the value specified in the menu.
> This eases migration for BSPs that previously specified it in the menu
> and didn't clear it when enabling GDB_TOOLCHAIN_VERSION (which defaults
> to 'y' if GDBSERVER is used).
> 
> Some older OSELAS toolchains (and also non-OSELAS toolchains) don't set
> PTXCONF_CROSS_GDB_MD5 in their ptxconfig (or they simply don't have a
> ptxconfig). In those cases, the md5sum must be specified in the menu.

I used the current order deliberately: It allows overwriting the md5sum if
necessary.

Michael

> Signed-off-by: Roland Hieber <r.hieber@pengutronix.de>
> ---
>  rules/gdb-menu.in  | 12 ++++++++----
>  rules/pre/gdb.make |  5 +++--
>  2 files changed, 11 insertions(+), 6 deletions(-)
> 
> diff --git a/rules/gdb-menu.in b/rules/gdb-menu.in
> index d8be3fef8..af69aca56 100644
> --- a/rules/gdb-menu.in
> +++ b/rules/gdb-menu.in
> @@ -22,16 +22,20 @@ config GDB_VERSION
>  endif
>  
>  config GDB_MD5
>  	string "gdb source md5sum"
>  	default "d42841167fd061d90fddf9a7212a1f9f" if !GDB_TOOLCHAIN_VERSION
>  	help
> -	  md5sum for the gdb source archive. If the version is provided by
> -	  the toolchain and the toolchain is a OSELAS.Toolchain then this
> -	  can be left empty and the md5sum from the toolchain ptxconfig is
> -	  used.
> +	  md5sum for the gdb source archive.
> +	  
> +	  If the version is provided by the toolchain and its md5sum can be
> +	  autodetected (e.g. with newer OSELAS.Toolchains), then the md5sum
> +	  from the toolchain is used instead and the value specified here is
> +	  ignored.
> +	  
> +	  Otherwise, specify the md5sum of the tar.xz archive.
>  
>  endif
>  
>  source "generated/debug_tools_gdb.in"
>  
>  endmenu
> diff --git a/rules/pre/gdb.make b/rules/pre/gdb.make
> index 31b1975d6..11f48381d 100644
> --- a/rules/pre/gdb.make
> +++ b/rules/pre/gdb.make
> @@ -11,14 +11,15 @@
>  SHARED_GDB_MD5		:= $(call remove_quotes,$(PTXCONF_GDB_MD5))
>  
>  ifdef PTXCONF_GDB_TOOLCHAIN_VERSION
>  TOOLCHAIN_CONFIG	:= $(PTXDIST_PLATFORMDIR)/selected_toolchain/ptxconfig
>  ifneq ($(wildcard $(TOOLCHAIN_CONFIG)),)
>  SHARED_GDB_VERSION	:= $(call remove_quotes,$(shell ptxd_get_kconfig $(TOOLCHAIN_CONFIG) PTXCONF_CROSS_GDB_VERSION))
> -ifeq ($(SHARED_GDB_MD5),)
> -SHARED_GDB_MD5		:= $(call remove_quotes,$(shell ptxd_get_kconfig $(TOOLCHAIN_CONFIG) PTXCONF_CROSS_GDB_MD5))
> +TOOLCHAIN_GDB_MD5	:= $(call remove_quotes,$(shell ptxd_get_kconfig $(TOOLCHAIN_CONFIG) PTXCONF_CROSS_GDB_MD5))
> +ifneq ($(TOOLCHAIN_GDB_MD5),)
> +SHARED_GDB_MD5		:= $(TOOLCHAIN_GDB_MD5)
>  endif
>  else
>  SHARED_GDB_VERSION	:= $(shell $(PTXCONF_COMPILER_PREFIX)gdb -v | sed -e 's/.* //;q')
>  endif
>  else
>  SHARED_GDB_VERSION	:= $(call remove_quotes,$(PTXCONF_GDB_VERSION))
> -- 
> 2.19.1
> 
> 
> _______________________________________________
> ptxdist mailing list
> ptxdist@pengutronix.de

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ptxdist] [PATCH 2/2] gdb, gdbserver: prefer the source md5sum from the toolchain
  2018-11-08 15:04   ` Michael Olbrich
@ 2018-11-09 14:05     ` Roland Hieber
  2018-11-09 14:09       ` Roland Hieber
  0 siblings, 1 reply; 6+ messages in thread
From: Roland Hieber @ 2018-11-09 14:05 UTC (permalink / raw)
  To: ptxdist

On Thu, Nov 08, 2018 at 04:04:04PM +0100, Michael Olbrich wrote:
> On Thu, Nov 08, 2018 at 01:13:42PM +0100, Roland Hieber wrote:
> > If the md5sum can be autodetected from the toolchain, we should use the
> > value from the toolchain and ignore the value specified in the menu.
> > This eases migration for BSPs that previously specified it in the menu
> > and didn't clear it when enabling GDB_TOOLCHAIN_VERSION (which defaults
> > to 'y' if GDBSERVER is used).
> > 
> > Some older OSELAS toolchains (and also non-OSELAS toolchains) don't set
> > PTXCONF_CROSS_GDB_MD5 in their ptxconfig (or they simply don't have a
> > ptxconfig). In those cases, the md5sum must be specified in the menu.
> 
> I used the current order deliberately: It allows overwriting the md5sum if
> necessary.

Hmm, in which cases would that be necessary? I can only think of using a
OSELAS toolchain that contains a wrong md5sum in its ptxconfig, and that
would probably be reason to make a new toolchain release. In all other
cases, the ptxconfig is either nonexistent or the doesn't contain an
md5sum, resulting in an empty value, therefore the md5sum from the menu
would be needed as described above.

 - Roland

-- 
Roland Hieber                     | r.hieber@pengutronix.de     |
Pengutronix e.K.                  | https://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim | Phone: +49-5121-206917-5086 |
Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ptxdist] [PATCH 2/2] gdb, gdbserver: prefer the source md5sum from the toolchain
  2018-11-09 14:05     ` Roland Hieber
@ 2018-11-09 14:09       ` Roland Hieber
  2018-11-12 11:47         ` Michael Olbrich
  0 siblings, 1 reply; 6+ messages in thread
From: Roland Hieber @ 2018-11-09 14:09 UTC (permalink / raw)
  To: ptxdist

On Fri, Nov 09, 2018 at 03:05:56PM +0100, Roland Hieber wrote:
> On Thu, Nov 08, 2018 at 04:04:04PM +0100, Michael Olbrich wrote:
> > On Thu, Nov 08, 2018 at 01:13:42PM +0100, Roland Hieber wrote:
> > > If the md5sum can be autodetected from the toolchain, we should use the
> > > value from the toolchain and ignore the value specified in the menu.
> > > This eases migration for BSPs that previously specified it in the menu
> > > and didn't clear it when enabling GDB_TOOLCHAIN_VERSION (which defaults
> > > to 'y' if GDBSERVER is used).
> > > 
> > > Some older OSELAS toolchains (and also non-OSELAS toolchains) don't set
> > > PTXCONF_CROSS_GDB_MD5 in their ptxconfig (or they simply don't have a
> > > ptxconfig). In those cases, the md5sum must be specified in the menu.
> > 
> > I used the current order deliberately: It allows overwriting the md5sum if
> > necessary.
> 
> Hmm, in which cases would that be necessary? I can only think of using a
> OSELAS toolchain that contains a wrong md5sum in its ptxconfig, and that
> would probably be reason to make a new toolchain release. In all other
> cases, the ptxconfig is either nonexistent or the doesn't contain an
> md5sum, resulting in an empty value, therefore the md5sum from the menu
> would be needed as described above.

Ah okay yes, another case would be when gdb decides to repackage its
existing tarball and publish it under the same file name. Then the
published toolchain cannot know about it and the md5sum needs to be
overwritten in the BSP. I see why having that menu option is better,
even when upgrading existing BSPs from older PTXdist versions is not as
smooth.

  - Roland

-- 
Roland Hieber                     | r.hieber@pengutronix.de     |
Pengutronix e.K.                  | https://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim | Phone: +49-5121-206917-5086 |
Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ptxdist] [PATCH 2/2] gdb, gdbserver: prefer the source md5sum from the toolchain
  2018-11-09 14:09       ` Roland Hieber
@ 2018-11-12 11:47         ` Michael Olbrich
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Olbrich @ 2018-11-12 11:47 UTC (permalink / raw)
  To: ptxdist

On Fri, Nov 09, 2018 at 03:09:42PM +0100, Roland Hieber wrote:
> On Fri, Nov 09, 2018 at 03:05:56PM +0100, Roland Hieber wrote:
> > On Thu, Nov 08, 2018 at 04:04:04PM +0100, Michael Olbrich wrote:
> > > On Thu, Nov 08, 2018 at 01:13:42PM +0100, Roland Hieber wrote:
> > > > If the md5sum can be autodetected from the toolchain, we should use the
> > > > value from the toolchain and ignore the value specified in the menu.
> > > > This eases migration for BSPs that previously specified it in the menu
> > > > and didn't clear it when enabling GDB_TOOLCHAIN_VERSION (which defaults
> > > > to 'y' if GDBSERVER is used).
> > > > 
> > > > Some older OSELAS toolchains (and also non-OSELAS toolchains) don't set
> > > > PTXCONF_CROSS_GDB_MD5 in their ptxconfig (or they simply don't have a
> > > > ptxconfig). In those cases, the md5sum must be specified in the menu.
> > > 
> > > I used the current order deliberately: It allows overwriting the md5sum if
> > > necessary.
> > 
> > Hmm, in which cases would that be necessary? I can only think of using a
> > OSELAS toolchain that contains a wrong md5sum in its ptxconfig, and that
> > would probably be reason to make a new toolchain release. In all other
> > cases, the ptxconfig is either nonexistent or the doesn't contain an
> > md5sum, resulting in an empty value, therefore the md5sum from the menu
> > would be needed as described above.
> 
> Ah okay yes, another case would be when gdb decides to repackage its
> existing tarball and publish it under the same file name.

And this is a real concern for me. Some time ago gnu.org replaced a lot of
tarballs with new versions. I think there was a license compliance issue or
something like that.

> Then the
> published toolchain cannot know about it and the md5sum needs to be
> overwritten in the BSP. I see why having that menu option is better,
> even when upgrading existing BSPs from older PTXdist versions is not as
> smooth.

Any BSP needs to do this just once and it won't be a problem for new BSP.

Michael

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-11-12 11:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-08 12:13 [ptxdist] [PATCH 1/2] gdb-menu: fix indentation Roland Hieber
2018-11-08 12:13 ` [ptxdist] [PATCH 2/2] gdb, gdbserver: prefer the source md5sum from the toolchain Roland Hieber
2018-11-08 15:04   ` Michael Olbrich
2018-11-09 14:05     ` Roland Hieber
2018-11-09 14:09       ` Roland Hieber
2018-11-12 11:47         ` Michael Olbrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox