All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v3] gdb: enable simulator support for host build
@ 2016-05-28 20:57 Waldemar Brodkorb
  2016-05-31 19:23 ` Thomas Petazzoni
  0 siblings, 1 reply; 2+ messages in thread
From: Waldemar Brodkorb @ 2016-05-28 20:57 UTC (permalink / raw)
  To: buildroot

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

Newer GDB need a workaround for in-tree compile.

Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
---
v2 -> v3:
  - add workaround for GDB bug when in-tree compile is used,
    problem reported by Thomas Petazzoni
  - tested with GDB 7.9, 7.10.1, 7.11
v1 -> v2:
  - no changes
---
 package/gdb/Config.in.host |  5 +++++
 package/gdb/gdb.mk         | 15 +++++++++++++--
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/package/gdb/Config.in.host b/package/gdb/Config.in.host
index 257d68a..dc149b6 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..83b1701 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,18 @@ else
 HOST_GDB_CONF_OPTS += --without-python
 endif
 
+# workaround a bug if in-tree build is used
+define GDB_SIM_WORKAROUND
+	$(RM) $(@D)/sim/common/tconfig.h
+endef
+
+ifeq ($(BR2_PACKAGE_HOST_GDB_SIM),y)
+HOST_GDB_CONF_OPTS += --enable-sim
+HOST_GDB_PRE_CONFIGURE_HOOKS += GDB_SIM_WORKAROUND
+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] 2+ messages in thread

* [Buildroot] [PATCH v3] gdb: enable simulator support for host build
  2016-05-28 20:57 [Buildroot] [PATCH v3] gdb: enable simulator support for host build Waldemar Brodkorb
@ 2016-05-31 19:23 ` Thomas Petazzoni
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2016-05-31 19:23 UTC (permalink / raw)
  To: buildroot

Hello,

On Sat, 28 May 2016 22:57:25 +0200, Waldemar Brodkorb wrote:
> Add an option to enable simulator support, so
> it can be used to test some no-MMU systems.
> 
> Newer GDB need a workaround for in-tree compile.
> 
> Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>

This new version still doesn't build with gdb 7.10 (i.e the default).
It fails with:

In file included from ./../common/callback.c:24:0:
./../common/cconfig.h:212:21: fatal error: tconfig.h: No such file or directory
compilation terminated.
Makefile:531: recipe for target 'callback.o' failed
make[5]: *** [callback.o] Error 1
make[5]: *** Waiting for unfinished jobs....
In file included from ./../common/syscall.c:27:0:
./../common/cconfig.h:212:21: fatal error: tconfig.h: No such file or directory
compilation terminated.
In file included from wrapper.c:23:0:
config.h:161:21: fatal error: tconfig.h: No such file or directory
compilation terminated.
In file included from targ-map.c:4:0:
config.h:161:21: fatal error: tconfig.h: No such file or directory
Makefile:531: recipe for target 'syscall.o' failed
compilation terminated.
make[5]: *** [syscall.o] Error 1
Makefile:531: recipe for target 'targ-map.o' failed
make[5]: *** [targ-map.o] Error 1
Makefile:531: recipe for target 'wrapper.o' failed
make[5]: *** [wrapper.o] Error 1
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

Using the following defconfig:

BR2_arm=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/br-arm-full-2016.05-rc2-3-g011d4e2.tar.bz2"
BR2_TOOLCHAIN_EXTERNAL_GCC_4_8=y
BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_10=y
BR2_TOOLCHAIN_EXTERNAL_LOCALE=y
# BR2_TOOLCHAIN_EXTERNAL_HAS_THREADS_DEBUG is not set
BR2_TOOLCHAIN_EXTERNAL_INET_RPC=y
BR2_TOOLCHAIN_EXTERNAL_CXX=y
BR2_PACKAGE_HOST_GDB=y
BR2_PACKAGE_HOST_GDB_SIM=y
BR2_INIT_NONE=y
BR2_SYSTEM_BIN_SH_NONE=y
# BR2_PACKAGE_BUSYBOX is not set
# BR2_TARGET_ROOTFS_TAR is not set

> +# workaround a bug if in-tree build is used

If I understood correctly, it has been fixed in newer versions of gdb,
right? If that's the case, please indicate here in which version it has
been fixed, so that we can remove this workaround at some point in the future.

> +define GDB_SIM_WORKAROUND

It would be better named HOST_GDB_SIM_WORKAROUND.

Thanks!

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

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

end of thread, other threads:[~2016-05-31 19:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-28 20:57 [Buildroot] [PATCH v3] gdb: enable simulator support for host build Waldemar Brodkorb
2016-05-31 19:23 ` Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.