Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2 3/4] gdb: enable simulator support for host build
@ 2016-05-13 12:16 Waldemar Brodkorb
  2016-05-28 13:49 ` Thomas Petazzoni
  0 siblings, 1 reply; 6+ messages in thread
From: Waldemar Brodkorb @ 2016-05-13 12:16 UTC (permalink / raw)
  To: buildroot

Add an option to enable simulator support, so
it can be used to test some no-MMU systems.

Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
---
v1 -> v2:
  - no changes
---
 package/gdb/Config.in.host | 5 +++++
 package/gdb/gdb.mk         | 9 +++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/package/gdb/Config.in.host b/package/gdb/Config.in.host
index b213901..1748ab0 100644
--- a/package/gdb/Config.in.host
+++ b/package/gdb/Config.in.host
@@ -23,6 +23,11 @@ config BR2_PACKAGE_HOST_GDB_PYTHON
 	help
 	  This option enables the Python support in the cross gdb.
 
+config BR2_PACKAGE_HOST_GDB_SIM
+	bool "Simulator support"
+	help
+	  This option enables the simulator support in the cross gdb.
+
 choice
 	prompt "GDB debugger Version"
 	depends on !BR2_arc
diff --git a/package/gdb/gdb.mk b/package/gdb/gdb.mk
index 0a7af1e..3c64f1d 100644
--- a/package/gdb/gdb.mk
+++ b/package/gdb/gdb.mk
@@ -163,8 +163,7 @@ HOST_GDB_CONF_OPTS = \
 	--enable-threads \
 	--disable-werror \
 	--without-included-gettext \
-	$(GDB_DISABLE_BINUTILS_CONF_OPTS) \
-	--disable-sim
+	$(GDB_DISABLE_BINUTILS_CONF_OPTS)
 
 ifeq ($(BR2_PACKAGE_HOST_GDB_TUI),y)
 HOST_GDB_CONF_OPTS += --enable-tui
@@ -179,6 +178,12 @@ else
 HOST_GDB_CONF_OPTS += --without-python
 endif
 
+ifeq ($(BR2_PACKAGE_HOST_GDB_SIM),y)
+HOST_GDB_CONF_OPTS += --enable-sim
+else
+HOST_GDB_CONF_OPTS += --disable-sim
+endif
+
 # legacy $arch-linux-gdb symlink
 define HOST_GDB_ADD_SYMLINK
 	cd $(HOST_DIR)/usr/bin && \
-- 
2.1.4

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

* [Buildroot] [PATCH v2 3/4] gdb: enable simulator support for host build
  2016-05-13 12:16 [Buildroot] [PATCH v2 3/4] gdb: enable simulator support for host build Waldemar Brodkorb
@ 2016-05-28 13:49 ` Thomas Petazzoni
  2016-05-28 15:48   ` Waldemar Brodkorb
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Petazzoni @ 2016-05-28 13:49 UTC (permalink / raw)
  To: buildroot

Hello,

On Fri, 13 May 2016 14:16:51 +0200, Waldemar Brodkorb wrote:
> Add an option to enable simulator support, so
> it can be used to test some no-MMU systems.
> 
> Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>

It doesn't seem to build on Blackfin for me. I'm not using the internal
toolchain support that you've added in PATCH 2/4, I'm using the
defconfig from your PATCH 4/4 with the Blackfin external toolchain. But
host-gdb is a host package, so the cross-compilation toolchain used
doesn't matter. And what I get is:

./../common/sim-model.c: In function ?model_set?:
./../common/sim-model.c:108:3: warning: implicit declaration of function ?CPU_MACH? [-Wimplicit-function-declaration]
   CPU_MACH (cpu) = MODEL_MACH (model);
   ^
./../common/sim-model.c:108:18: error: lvalue required as left operand of assignment
   CPU_MACH (cpu) = MODEL_MACH (model);
                  ^
./../common/sim-model.c:109:3: warning: implicit declaration of function ?CPU_MODEL? [-Wimplicit-function-declaration]
   CPU_MODEL (cpu) = model;
   ^
./../common/sim-model.c:109:19: error: lvalue required as left operand of assignment
   CPU_MODEL (cpu) = model;
                   ^
In file included from /usr/include/string.h:630:0,
                 from ../common/sim-arange.c:32,
                 from ../common/sim-arange.h:82,
                 from ../common/sim-basics.h:141,
                 from ./sim-main.h:24,
                 from ./../common/sim-model.c:20:
./../common/sim-model.c: In function ?sim_model_init?:
./../common/sim-model.h:80:30: error: invalid type argument of ?->? (have ?int?)
 #define MACH_BFD_NAME(m) ((m)->bfd_name)
                              ^
./../common/sim-model.c:215:5: note: in expansion of macro ?MACH_BFD_NAME?
     MACH_BFD_NAME (CPU_MACH (cpu))) != 0)
     ^
./../common/sim-model.h:80:30: error: invalid type argument of ?->? (have ?int?)
 #define MACH_BFD_NAME(m) ((m)->bfd_name)
                              ^
./../common/sim-model.c:215:5: note: in expansion of macro ?MACH_BFD_NAME?
     MACH_BFD_NAME (CPU_MACH (cpu))) != 0)
     ^
./../common/sim-model.h:80:30: error: invalid type argument of ?->? (have ?int?)
 #define MACH_BFD_NAME(m) ((m)->bfd_name)
                              ^
./../common/sim-model.c:215:5: note: in expansion of macro ?MACH_BFD_NAME?
     MACH_BFD_NAME (CPU_MACH (cpu))) != 0)
     ^
./../common/sim-model.h:80:30: error: invalid type argument of ?->? (have ?int?)
 #define MACH_BFD_NAME(m) ((m)->bfd_name)
                              ^
./../common/sim-model.c:215:5: note: in expansion of macro ?MACH_BFD_NAME?
     MACH_BFD_NAME (CPU_MACH (cpu))) != 0)
     ^
./../common/sim-model.h:80:30: error: invalid type argument of ?->? (have ?int?)
 #define MACH_BFD_NAME(m) ((m)->bfd_name)
                              ^
./../common/sim-model.c:215:5: note: in expansion of macro ?MACH_BFD_NAME?
     MACH_BFD_NAME (CPU_MACH (cpu))) != 0)
     ^
./../common/sim-model.h:80:30: error: invalid type argument of ?->? (have ?int?)
 #define MACH_BFD_NAME(m) ((m)->bfd_name)
                              ^
./../common/sim-model.c:215:5: note: in expansion of macro ?MACH_BFD_NAME?
     MACH_BFD_NAME (CPU_MACH (cpu))) != 0)
     ^
./../common/sim-model.h:80:30: error: invalid type argument of ?->? (have ?int?)
 #define MACH_BFD_NAME(m) ((m)->bfd_name)
                              ^
./../common/sim-model.c:215:5: note: in expansion of macro ?MACH_BFD_NAME?
     MACH_BFD_NAME (CPU_MACH (cpu))) != 0)
     ^
./../common/sim-model.h:80:30: error: invalid type argument of ?->? (have ?int?)
 #define MACH_BFD_NAME(m) ((m)->bfd_name)
                              ^
./../common/sim-model.c:215:5: note: in expansion of macro ?MACH_BFD_NAME?
     MACH_BFD_NAME (CPU_MACH (cpu))) != 0)
     ^
./../common/sim-model.h:80:30: error: invalid type argument of ?->? (have ?int?)
 #define MACH_BFD_NAME(m) ((m)->bfd_name)
                              ^
./../common/sim-model.c:215:5: note: in expansion of macro ?MACH_BFD_NAME?
     MACH_BFD_NAME (CPU_MACH (cpu))) != 0)
     ^
./../common/sim-model.h:80:30: error: invalid type argument of ?->? (have ?int?)
 #define MACH_BFD_NAME(m) ((m)->bfd_name)
                              ^
./../common/sim-model.c:215:5: note: in expansion of macro ?MACH_BFD_NAME?
     MACH_BFD_NAME (CPU_MACH (cpu))) != 0)
     ^
./../common/sim-model.h:80:30: error: invalid type argument of ?->? (have ?int?)
 #define MACH_BFD_NAME(m) ((m)->bfd_name)
                              ^
./../common/sim-model.c:215:5: note: in expansion of macro ?MACH_BFD_NAME?
     MACH_BFD_NAME (CPU_MACH (cpu))) != 0)
     ^
./../common/sim-model.h:80:30: error: invalid type argument of ?->? (have ?int?)
 #define MACH_BFD_NAME(m) ((m)->bfd_name)
                              ^
./../common/sim-model.c:215:5: note: in expansion of macro ?MACH_BFD_NAME?
     MACH_BFD_NAME (CPU_MACH (cpu))) != 0)
     ^
./../common/sim-model.h:80:30: error: invalid type argument of ?->? (have ?int?)
 #define MACH_BFD_NAME(m) ((m)->bfd_name)
                              ^
./../common/sim-model.c:215:5: note: in expansion of macro ?MACH_BFD_NAME?
     MACH_BFD_NAME (CPU_MACH (cpu))) != 0)
     ^
./../common/sim-model.h:80:30: error: invalid type argument of ?->? (have ?int?)
 #define MACH_BFD_NAME(m) ((m)->bfd_name)
                              ^
./../common/sim-model.c:215:5: note: in expansion of macro ?MACH_BFD_NAME?
     MACH_BFD_NAME (CPU_MACH (cpu))) != 0)
     ^
./../common/sim-model.h:80:30: error: invalid type argument of ?->? (have ?int?)
 #define MACH_BFD_NAME(m) ((m)->bfd_name)
                              ^
./../common/sim-model.c:215:5: note: in expansion of macro ?MACH_BFD_NAME?
     MACH_BFD_NAME (CPU_MACH (cpu))) != 0)
     ^
./../common/sim-model.h:80:30: error: invalid type argument of ?->? (have ?int?)
 #define MACH_BFD_NAME(m) ((m)->bfd_name)
                              ^
./../common/sim-model.c:215:5: note: in expansion of macro ?MACH_BFD_NAME?
     MACH_BFD_NAME (CPU_MACH (cpu))) != 0)
     ^
./../common/sim-model.h:80:30: error: invalid type argument of ?->? (have ?int?)
 #define MACH_BFD_NAME(m) ((m)->bfd_name)
                              ^
./../common/sim-model.c:215:5: note: in expansion of macro ?MACH_BFD_NAME?
     MACH_BFD_NAME (CPU_MACH (cpu))) != 0)
     ^
./../common/sim-model.h:80:30: error: invalid type argument of ?->? (have ?int?)
 #define MACH_BFD_NAME(m) ((m)->bfd_name)
                              ^
./../common/sim-model.c:215:5: note: in expansion of macro ?MACH_BFD_NAME?
     MACH_BFD_NAME (CPU_MACH (cpu))) != 0)
     ^
./../common/sim-model.h:80:30: error: invalid type argument of ?->? (have ?int?)
 #define MACH_BFD_NAME(m) ((m)->bfd_name)
                              ^
./../common/sim-model.c:215:5: note: in expansion of macro ?MACH_BFD_NAME?
     MACH_BFD_NAME (CPU_MACH (cpu))) != 0)
     ^
./../common/sim-model.h:80:30: error: invalid type argument of ?->? (have ?int?)
 #define MACH_BFD_NAME(m) ((m)->bfd_name)
                              ^
./../common/sim-model.c:215:5: note: in expansion of macro ?MACH_BFD_NAME?
     MACH_BFD_NAME (CPU_MACH (cpu))) != 0)
     ^
In file included from ./../common/sim-model.c:21:0:
./../common/sim-model.h:112:27: error: invalid type argument of ?->? (have ?int?)
 #define MODEL_NAME(m) ((m)->name)
                           ^
./../common/sim-model.c:218:6: note: in expansion of macro ?MODEL_NAME?
      MODEL_NAME (CPU_MODEL (cpu)),
      ^
./../common/sim-model.h:80:30: error: invalid type argument of ?->? (have ?int?)
 #define MACH_BFD_NAME(m) ((m)->bfd_name)
                              ^
./../common/sim-model.c:239:48: note: in expansion of macro ?MACH_BFD_NAME?
       STATE_ARCHITECTURE (sd) = bfd_scan_arch (MACH_BFD_NAME (CPU_MACH (cpu)));
                                                ^
Makefile:542: recipe for target 'sim-model.o' failed
make[5]: *** [sim-model.o] Error 1
make[5]: *** Waiting for unfinished jobs....
Makefile:129: recipe for target 'all' failed
make[4]: *** [all] Error 1
Makefile:8201: recipe for target 'all-sim' failed
make[3]: *** [all-sim] Error 2
Makefile:845: recipe for target 'all' failed
make[2]: *** [all] Error 2
package/pkg-generic.mk:195: recipe for target '/home/thomas/projets/buildroot/output/build/host-gdb-7.10.1/.stamp_built' failed
make[1]: *** [/home/thomas/projets/buildroot/output/build/host-gdb-7.10.1/.stamp_built] Error 2
Makefile:36: recipe for target '_all' failed
make: *** [_all] Error 2

Could you have a look?

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH v2 3/4] gdb: enable simulator support for host build
  2016-05-28 13:49 ` Thomas Petazzoni
@ 2016-05-28 15:48   ` Waldemar Brodkorb
  2016-05-28 16:35     ` Thomas Petazzoni
  0 siblings, 1 reply; 6+ messages in thread
From: Waldemar Brodkorb @ 2016-05-28 15:48 UTC (permalink / raw)
  To: buildroot

Hi Thomas,
Thomas Petazzoni wrote,

> Hello,
> 
> On Fri, 13 May 2016 14:16:51 +0200, Waldemar Brodkorb wrote:
> > Add an option to enable simulator support, so
> > it can be used to test some no-MMU systems.
> > 
> > Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
> 
> It doesn't seem to build on Blackfin for me. I'm not using the internal
> toolchain support that you've added in PATCH 2/4, I'm using the
> defconfig from your PATCH 4/4 with the Blackfin external toolchain. But
> host-gdb is a host package, so the cross-compilation toolchain used
> doesn't matter. And what I get is:
> 
> ./../common/sim-model.c: In function ?model_set?:
> ./../common/sim-model.c:108:3: warning: implicit declaration of function ?CPU_MACH? [-Wimplicit-function-declaration]
>    CPU_MACH (cpu) = MODEL_MACH (model);
>       MODEL_NAME (CPU_MODEL (cpu)),
> make[1]: *** [/home/thomas/projets/buildroot/output/build/host-gdb-7.10.1/.stamp_built] Error 2
> Makefile:36: recipe for target '_all' failed
> make: *** [_all] Error 2
> 
> Could you have a look?

I totally forgot about it. See here:
https://www.sourceware.org/ml/gdb/2015-12/msg00029.html

For newer GDB (7.10.1/7.11) we need to use out-of-tree builds. I
only tested with 7.9, I think it was the default by the time I
tested it or I changed it.

How would we change package/gdb to use out-of-tree building?

best regards
 Waldemar

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

* [Buildroot] [PATCH v2 3/4] gdb: enable simulator support for host build
  2016-05-28 15:48   ` Waldemar Brodkorb
@ 2016-05-28 16:35     ` Thomas Petazzoni
  2016-05-28 16:40       ` Waldemar Brodkorb
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Petazzoni @ 2016-05-28 16:35 UTC (permalink / raw)
  To: buildroot

Hello,

On Sat, 28 May 2016 17:48:11 +0200, Waldemar Brodkorb wrote:

> I totally forgot about it. See here:
> https://www.sourceware.org/ml/gdb/2015-12/msg00029.html
> 
> For newer GDB (7.10.1/7.11) we need to use out-of-tree builds. I
> only tested with 7.9, I think it was the default by the time I
> tested it or I changed it.
> 
> How would we change package/gdb to use out-of-tree building?

The fact that it doesn't work with in-tree build is really a bug, so
I'm not sure we should switch to out of tree build just for this
reason. We should probably instead backport the patches needed to fix
the in-tree build, or use the workaround proposed by Mike, at least for
the affected gdb versions. I've tested with gdb 7.10 only, not sure if
7.11 is affected or not.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH v2 3/4] gdb: enable simulator support for host build
  2016-05-28 16:35     ` Thomas Petazzoni
@ 2016-05-28 16:40       ` Waldemar Brodkorb
  2016-05-28 17:24         ` Thomas Petazzoni
  0 siblings, 1 reply; 6+ messages in thread
From: Waldemar Brodkorb @ 2016-05-28 16:40 UTC (permalink / raw)
  To: buildroot

Hi,
Thomas Petazzoni wrote,

> Hello,
> 
> On Sat, 28 May 2016 17:48:11 +0200, Waldemar Brodkorb wrote:
> 
> > I totally forgot about it. See here:
> > https://www.sourceware.org/ml/gdb/2015-12/msg00029.html
> > 
> > For newer GDB (7.10.1/7.11) we need to use out-of-tree builds. I
> > only tested with 7.9, I think it was the default by the time I
> > tested it or I changed it.
> > 
> > How would we change package/gdb to use out-of-tree building?
> 
> The fact that it doesn't work with in-tree build is really a bug, so
> I'm not sure we should switch to out of tree build just for this
> reason. We should probably instead backport the patches needed to fix
> the in-tree build, or use the workaround proposed by Mike, at least for
> the affected gdb versions. I've tested with gdb 7.10 only, not sure if
> 7.11 is affected or not.

7.11 is affected.
How do you understand his workaround? 
I never used it, I changed OpenADK to use out-of-tree builds for
GDB.

I think there are a lot of developers out there would saying
out-of-tree builds are good and in-tree might fail and we don't
care. (.. OpenBSD'ler.. )

best regards
 Waldemar

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

* [Buildroot] [PATCH v2 3/4] gdb: enable simulator support for host build
  2016-05-28 16:40       ` Waldemar Brodkorb
@ 2016-05-28 17:24         ` Thomas Petazzoni
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2016-05-28 17:24 UTC (permalink / raw)
  To: buildroot

Hello,

On Sat, 28 May 2016 18:40:33 +0200, Waldemar Brodkorb wrote:

> 7.11 is affected.
> How do you understand his workaround? 

Apparently, Mike said that removing one file was enough. Maybe we could
try this?

> I think there are a lot of developers out there would saying
> out-of-tree builds are good and in-tree might fail and we don't
> care. (.. OpenBSD'ler.. )

out-of-tree builds are good, but it's not a reason to use them as a
workaround for a bug causing in-tree builds to fail.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

end of thread, other threads:[~2016-05-28 17:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-13 12:16 [Buildroot] [PATCH v2 3/4] gdb: enable simulator support for host build Waldemar Brodkorb
2016-05-28 13:49 ` Thomas Petazzoni
2016-05-28 15:48   ` Waldemar Brodkorb
2016-05-28 16:35     ` Thomas Petazzoni
2016-05-28 16:40       ` Waldemar Brodkorb
2016-05-28 17:24         ` Thomas Petazzoni

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