Skip to contentSkip to conversation

package/gdb: ARC version has stringent dependencies on host gcc

PATCH New Yann E. MORIN 3 participants 10 messages Nov 2, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/gdb: ARC version has stringent dependencies on host gcc

The ARC gdb version requires a gcc >= 4.8 (because C++11).

Since the host variant uses the same sources as the target variant, we must ensure that we have a host gcc >= 4.8 as well.

Move the architecture dependencies to their own symbol, and also hide the comment when they are not met.

Fixes:

    http://autobuild.buildroot.net/results/43eae264991aa369490236c7bd59c0b6a67fcf25/
Cc Alexey Brodkin <[email protected]>
Cc Thomas Petazzoni <[email protected]>
---
 package/gdb/Config.in.host | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)
package/gdb/Config.in.host +14 -4
index c2cfc34284..797c07c3f9 100644
@@ -1,4 +1,17 @@
+config BR2_PACKAGE_HOST_GDB_ARCH_SUPPORTS
+	bool
+	default y
+	# The ARC version needs C++11, thus gcc >= 4.8, like gdb-8.0.x
+	depends on BR2_HOST_GCC_AT_LEAST_4_8 || !BR2_arc
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 || !BR2_arc
+	depends on !((BR2_arm || BR2_armeb) && BR2_BINFMT_FLAT)
+	depends on !BR2_microblaze
+	depends on !BR2_nios2
+	depends on !BR2_or1k
+
 comment "Host GDB Options"
+	depends on !BR2_TOOLCHAIN_EXTERNAL_GDB_SERVER_COPY
+	depends on BR2_PACKAGE_HOST_GDB_ARCH_SUPPORTS
 
 config BR2_PACKAGE_HOST_GDB
 	bool "Build cross gdb for the host"
@@ -6,10 +19,7 @@ config BR2_PACKAGE_HOST_GDB
 	# allow to build a cross-gdb, as the one of the external
 	# toolchain should be used.
 	depends on !BR2_TOOLCHAIN_EXTERNAL_GDB_SERVER_COPY
-	depends on !((BR2_arm || BR2_armeb) && BR2_BINFMT_FLAT)
-	depends on !BR2_microblaze
-	depends on !BR2_nios2
-	depends on !BR2_or1k
+	depends on BR2_PACKAGE_HOST_GDB_ARCH_SUPPORTS
 	help
 	  Build a cross gdb that runs on the host machine and debugs
 	  programs running on the target. It requires 'gdbserver'
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/1 package/gdb: ARC version has stringent dependencies on host gcc

Hello,

Thanks for looking into this issue!

package/gdb/Config.in.host line 6

Quoted 11 lines · Yann E. MORIN
package/gdb/Config.in.host +6 -0
index c2cfc34284..797c07c3f9 100644
@@ -1,4 +1,17 @@
+config BR2_PACKAGE_HOST_GDB_ARCH_SUPPORTS
+	bool
+	default y
+	# The ARC version needs C++11, thus gcc >= 4.8, like gdb-8.0.x
+	depends on BR2_HOST_GCC_AT_LEAST_4_8 || !BR2_arc
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 || !BR2_arc

Why do we have a dependency on the target compiler version for host-gdb ?

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#2 lore raw

PATCH 1/1 package/gdb: ARC version has stringent dependencies on host gcc

Thomas, All,

On 2017-11-02 22:12 +0100, Thomas Petazzoni spake thusly:

Quoted 7 lines · Yann E. MORIN
Quoted 6 lines
package/gdb/Config.in.host +1 -0
index c2cfc34284..797c07c3f9 100644
@@ -1,4 +1,17 @@
+config BR2_PACKAGE_HOST_GDB_ARCH_SUPPORTS
Quoted 8 lines

package/gdb/Config.in.host line 6

Quoted 5 lines
package/gdb/Config.in.host +5 -0
+	bool
+	default y
+	# The ARC version needs C++11, thus gcc >= 4.8, like gdb-8.0.x
+	depends on BR2_HOST_GCC_AT_LEAST_4_8 || !BR2_arc
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 || !BR2_arc

Why do we have a dependency on the target compiler version for host-gdb ?

For two reasons:

1. you said so in your analysis. OK, you could be wrong, so...
2. that is the case for gdb-8.0.x, later in that same file.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#3 lore raw

PATCH 1/1 package/gdb: ARC version has stringent dependencies on host gcc

Hello,

Quoted 7 lines · Yann E. MORIN
Quoted 2 lines

Why do we have a dependency on the target compiler version for host-gdb ?

For two reasons:

1. you said so in your analysis. OK, you could be wrong, so...
2. that is the case for gdb-8.0.x, later in that same file.

I think I know the logic for gdb 8.x. The logic is that:

* If you chose only target gdb (and not host gdb), you don't have a version choice, and we currently use gdb 7.11, which doesn't have a compiler version requirement.

* If you chose to build both host gdb and target gdb, then the selection of the gdb version for the host gdb affects the version used to build target gdb. I.e, you select gdb 8.0 as the host-gdb, and gdb 8.0 will also be built as the target gdb. Therefore we need to ensure that the host gdb 8.0 option can only be selected if both the host *and* the target compiler are >= 4.8.

That is a bit tricky, and would warrant a comment in the Config.in file I guess.

But anyway, this means your patch is correct! :)

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#4 lore raw

PATCH 1/1 package/gdb: ARC version has stringent dependencies on host gcc

In reply to Yann E. MORIN

Hi Yann,

Quoted 25 lines · Yann E. MORIN

The ARC gdb version requires a gcc >= 4.8 (because C++11).

Since the host variant uses the same sources as the target variant, we must ensure that we have a host gcc >= 4.8 as well.

Move the architecture dependencies to their own symbol, and also hide the comment when they are not met.

Fixes:
????https://urldefense.proofpoint.com/v2/url?u=http-3A__autobuild.buildroot.net_results_43eae264991aa369490236c7bd59c0b6a67fcf25_&d=DwIBAg&c=DPL6_X_ 6JkXFx7AXWqB0tg&r=lqdeeSSEes0GFDDl656eViXO7breS55ytWkhpk5R81I&m=b-eGjVYMXoKYiImFRBhs00VOY_pLPUoEpAcAm77- fbo&s=SxA_U3jSTkTx7D0f8Am0c_uZWHh4B6AFeUeYz9ZKe9c&e=

Cc Alexey Brodkin <[email protected]>
Cc Thomas Petazzoni <[email protected]>

---
?package/gdb/Config.in.host | 18 ++++++++++++++---- ?1 file changed, 14 insertions(+), 4 deletions(-)

package/gdb/Config.in.host +0 -0
index c2cfc34284..797c07c3f9 100644

package/gdb/Config.in.host line 4

Quoted 4 lines
package/gdb/Config.in.host +4 -0
@@ -1,4 +1,17 @@
+config BR2_PACKAGE_HOST_GDB_ARCH_SUPPORTS
+	bool
+	default y
+	# The ARC version needs C++11, thus gcc >= 4.8, like gdb-8.0.x

Indeed our GDB is based on very up to date upstream sources so all limitations for GDB 8.x are valid for ARC's one.

That said it has nothing to do with ARCH but only GDB version makes sense. So why don't we just introduce BR2_GDB_VERSION_ARC which will be the only option for ARC and will have the same set of "depends" as BR2_GDB_VERSION_8_0?

-Alexey

#5 lore raw

PATCH 1/1 package/gdb: ARC version has stringent dependencies on host gcc

Hello,

Quoted 6 lines · Alexey Brodkin

Indeed our GDB is based on very up to date upstream sources so all limitations for GDB 8.x are valid for ARC's one.

That said it has nothing to do with ARCH but only GDB version makes sense. So why don't we just introduce BR2_GDB_VERSION_ARC which will be the only option for ARC and will have the same set of "depends" as BR2_GDB_VERSION_8_0?

If we do that, then we would end up with gdb being available, but no version selectable on ARC if the host has a compiler older than gcc 4.8. We prefer to hide gdb entirely in such a situation.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#6 lore raw

PATCH 1/1 package/gdb: ARC version has stringent dependencies on host gcc

In reply to Alexey Brodkin

Alexey, All,

On 2017-11-02 21:31 +0000, Alexey Brodkin spake thusly:

Quoted 34 lines · Yann E. MORIN
Quoted 25 lines

The ARC gdb version requires a gcc >= 4.8 (because C++11).

Since the host variant uses the same sources as the target variant, we must ensure that we have a host gcc >= 4.8 as well.

Move the architecture dependencies to their own symbol, and also hide the comment when they are not met.

Fixes:
????https://urldefense.proofpoint.com/v2/url?u=http-3A__autobuild.buildroot.net_results_43eae264991aa369490236c7bd59c0b6a67fcf25_&d=DwIBAg&c=DPL6_X_ 6JkXFx7AXWqB0tg&r=lqdeeSSEes0GFDDl656eViXO7breS55ytWkhpk5R81I&m=b-eGjVYMXoKYiImFRBhs00VOY_pLPUoEpAcAm77- fbo&s=SxA_U3jSTkTx7D0f8Am0c_uZWHh4B6AFeUeYz9ZKe9c&e=

Cc Alexey Brodkin <[email protected]>
Cc Thomas Petazzoni <[email protected]>

---
?package/gdb/Config.in.host | 18 ++++++++++++++---- ?1 file changed, 14 insertions(+), 4 deletions(-)

package/gdb/Config.in.host +0 -0
index c2cfc34284..797c07c3f9 100644

package/gdb/Config.in.host line 4

Quoted 4 lines
package/gdb/Config.in.host +4 -0
@@ -1,4 +1,17 @@
+config BR2_PACKAGE_HOST_GDB_ARCH_SUPPORTS
+	bool
+	default y
+	# The ARC version needs C++11, thus gcc >= 4.8, like gdb-8.0.x

Indeed our GDB is based on very up to date upstream sources so all limitations for GDB 8.x are valid for ARC's one.

Quoted 3 lines

That said it has nothing to do with ARCH but only GDB version makes sense. So why don't we just introduce BR2_GDB_VERSION_ARC which will be the only option for ARC and will have the same set of "depends" as BR2_GDB_VERSION_8_0?

If you do that, then you could still select BR2_PACKAGE_HOST_GDB, and end up with a choice where there is no entry...

We can do that in the !ARC case, because there are versions that do not require anything, so 8.0 is just hidden and 7.xx are still visible, which is not the case for ARC.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#7 lore raw

PATCH 1/1 package/gdb: ARC version has stringent dependencies on host gcc

Hi Thomas, Yann,

Quoted 44 lines · Yann E. MORIN

Alexey, All,

On 2017-11-02 21:31 +0000, Alexey Brodkin spake thusly:

Quoted 37 lines · Yann E. MORIN
Quoted 27 lines

The ARC gdb version requires a gcc >= 4.8 (because C++11).

Since the host variant uses the same sources as the target variant, we must ensure that we have a host gcc >= 4.8 as well.

Move the architecture dependencies to their own symbol, and also hide the comment when they are not met.

Fixes:
????https://urldefense.proofpoint.com/v2/url?u=http-3A__autobuild.buildroot.net_results_43eae264991aa369490236c7bd59c0b6a67fcf25_&d=DwIBAg&c=DPL 6_X_
6JkXFx7AXWqB0tg&r=lqdeeSSEes0GFDDl656eViXO7breS55ytWkhpk5R81I&m=b-eGjVYMXoKYiImFRBhs00VOY_pLPUoEpAcAm77- fbo&s=SxA_U3jSTkTx7D0f8Am0c_uZWHh4B6AFeUeYz9ZKe9c&e=

Cc Alexey Brodkin <[email protected]>
Cc Thomas Petazzoni <[email protected]>

---
?package/gdb/Config.in.host | 18 ++++++++++++++---- ?1 file changed, 14 insertions(+), 4 deletions(-)

package/gdb/Config.in.host +0 -0
index c2cfc34284..797c07c3f9 100644

package/gdb/Config.in.host line 4

Quoted 4 lines
package/gdb/Config.in.host +4 -0
@@ -1,4 +1,17 @@
+config BR2_PACKAGE_HOST_GDB_ARCH_SUPPORTS
+	bool
+	default y
+	# The ARC version needs C++11, thus gcc >= 4.8, like gdb-8.0.x

Indeed our GDB is based on very up to date upstream sources so all limitations for GDB 8.x are valid for ARC's one.

Quoted 3 lines

That said it has nothing to do with ARCH but only GDB version makes sense. So why don't we just introduce BR2_GDB_VERSION_ARC which will be the only option for ARC and will have the same set of "depends" as BR2_GDB_VERSION_8_0?

Quoted 6 lines

If you do that, then you could still select BR2_PACKAGE_HOST_GDB, and end up with a choice where there is no entry...

We can do that in the !ARC case, because there are versions that do not require anything, so 8.0 is just hidden and 7.xx are still visible, which is not the case for ARC.

Live and learn! :)

Thanks for the explanation.
Indeed GDB situation in BR is not as simple as it looks like from the first sight.

-Alexey

#8 lore raw

PATCH 1/1 package/gdb: ARC version has stringent dependencies on host gcc

In reply to Yann E. MORIN

Hello,

Quoted 9 lines · Yann E. MORIN

The ARC gdb version requires a gcc >= 4.8 (because C++11).

Since the host variant uses the same sources as the target variant, we must ensure that we have a host gcc >= 4.8 as well.

Move the architecture dependencies to their own symbol, and also hide the comment when they are not met.

Fixes:

Quoted 8 lines
    http://autobuild.buildroot.net/results/43eae264991aa369490236c7bd59c0b6a67fcf25/
Cc Alexey Brodkin <[email protected]>
Cc Thomas Petazzoni <[email protected]>
---
 package/gdb/Config.in.host | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

Applied to master, thanks.

However, there are still a few cases that are not taken into account:

* We need C++ support in the toolchain to build the target gdb for ARC. This is already handled for !ARC, because BR2_GDB_VERSION_8_0 can only be selected if BR2_INSTALL_LIBSTDCPP=y.

Note: I'm not sure if we need C++ to build just gdbserver, it would be worth checking. Currently, for gdb 8.x, we require C++, even if the user only wants gdbserver on the target.

* We need a 4.8 target compiler to build the target gdb for ARC. Indeed, a user might enable BR2_PACKAGE_GDB on ARC to build the target gdb. And that would fail if the compiler isn't gcc >= 4.8. I'm not even sure ARC ever had a toolchain using gcc 4.8, but in theory this dependency is missing.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#9 lore raw

PATCH 1/1 package/gdb: ARC version has stringent dependencies on host gcc

Hi Thomas,

Quoted 28 lines · Thomas Petazzoni

Hello,

Quoted 14 lines · Yann E. MORIN

The ARC gdb version requires a gcc >= 4.8 (because C++11).

Since the host variant uses the same sources as the target variant, we must ensure that we have a host gcc >= 4.8 as well.

Move the architecture dependencies to their own symbol, and also hide the comment when they are not met.

Fixes:
????https://urldefense.proofpoint.com/v2/url?u=http-3A__autobuild.buildroot.net_results_43eae264991aa369490236c7bd59c0b6a67fcf25_&d=DwICAg&c=DPL6_ X_6JkXFx7AXWqB0tg&r=lqdeeSSEes0GFDDl656eViXO7breS55ytWkhpk5R81I&m=ET-RDZJb29- XWo2Ni05GPO6BH2GHBPDl7jX0OObbhtI&s=Lha759WlCLxxQvKx4XnlEtxFsfcU_c1UmAu-cpJyWRU&e=

Quoted 6 lines
Cc Alexey Brodkin <[email protected]>
Cc Thomas Petazzoni <[email protected]>

---
?package/gdb/Config.in.host | 18 ++++++++++++++---- ?1 file changed, 14 insertions(+), 4 deletions(-)

Applied to master, thanks.

However, there are still a few cases that are not taken into account:

Quoted 7 lines

?* We need C++ support in the toolchain to build the target gdb for ???ARC. This is already handled for !ARC, because BR2_GDB_VERSION_8_0 ???can only be selected if BR2_INSTALL_LIBSTDCPP=y.

???Note: I'm not sure if we need C++ to build just gdbserver, it would ???be worth checking. Currently, for gdb 8.x, we require C++, even if ???the user only wants gdbserver on the target.

From this?https://sourceware.org/ml/gdb-patches/2016-10/msg00775.html I'd say gdbserver is also affected, i.e. we need C++-enabled cross-toolchain for building gdbserver from GDB v8+.

Also refer to GDB's article on that regard:?https://sourceware.org/gdb/wiki/cxx-conversion

Quoted 5 lines

?* We need a 4.8 target compiler to build the target gdb for ARC. ???Indeed, a user might enable BR2_PACKAGE_GDB on ARC to build the ???target gdb. And that would fail if the compiler isn't gcc >= 4.8. ???I'm not even sure ARC ever had a toolchain using gcc 4.8, but in ???theory this dependency is missing.

FWIW I remember those days when we used GCC 4.2, then switched to 4.4 and then to 4.8 not that long ago. So in theory pre 4.8 toolchains for ARC exist but hopefully are not really used [a lot] so before we get any complaint on that I'd just not think about it and would assume ARC tools are always >= 4.8.

-Alexey