Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] btrace: fix the non-native build
@ 2013-08-13 14:47 Mircea Gherzan
  2013-08-13 15:03 ` Mark Kettenis
  0 siblings, 1 reply; 3+ messages in thread
From: Mircea Gherzan @ 2013-08-13 14:47 UTC (permalink / raw)
  To: tromey, jan.kratochvil; +Cc: gdb-patches, markus.t.metzger, Mircea Gherzan

When building on a non-Linux host for a Linux target, the build fails
because the linux-btrace object is not built/linked.

2013-08-09  Mircea Gherzan  <mircea.gherzan@intel.com>

gdb/
	* configure.tgt: Add linux-btrace.o to gdb_target_obs for i386
	and x86_64 Linux targets.
	* config/i386/linux.mh (NATDEPFILES): Remove linux-btrace.o.
	* config/i386/linux64.mh (NATDEPFILES): Remove linux-btrace.o.

Signed-off-by: Mircea Gherzan <mircea.gherzan@intel.com>
---
 gdb/config/i386/linux.mh   | 3 +--
 gdb/config/i386/linux64.mh | 2 +-
 gdb/configure.tgt          | 5 +++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/gdb/config/i386/linux.mh b/gdb/config/i386/linux.mh
index 7c64e83..8316d87 100644
--- a/gdb/config/i386/linux.mh
+++ b/gdb/config/i386/linux.mh
@@ -4,8 +4,7 @@ NAT_FILE= config/nm-linux.h
 NATDEPFILES= inf-ptrace.o fork-child.o \
 	i386-nat.o i386-linux-nat.o \
 	proc-service.o linux-thread-db.o \
-	linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
-	linux-btrace.o
+	linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o
 NAT_CDEPS = $(srcdir)/proc-service.list
 
 # The dynamically loaded libthread_db needs access to symbols in the
diff --git a/gdb/config/i386/linux64.mh b/gdb/config/i386/linux64.mh
index 8d782c1..d2b95fd 100644
--- a/gdb/config/i386/linux64.mh
+++ b/gdb/config/i386/linux64.mh
@@ -3,7 +3,7 @@ NATDEPFILES= inf-ptrace.o fork-child.o \
 	i386-nat.o amd64-nat.o amd64-linux-nat.o \
 	linux-nat.o linux-osdata.o \
 	proc-service.o linux-thread-db.o linux-fork.o \
-	linux-procfs.o linux-ptrace.o linux-btrace.o
+	linux-procfs.o linux-ptrace.o
 NAT_FILE= config/nm-linux.h
 NAT_CDEPS = $(srcdir)/proc-service.list
 
diff --git a/gdb/configure.tgt b/gdb/configure.tgt
index 653ba2b..0dabd57 100644
--- a/gdb/configure.tgt
+++ b/gdb/configure.tgt
@@ -221,7 +221,7 @@ i[34567]86-*-linux*)
 	# Target: Intel 386 running GNU/Linux
 	gdb_target_obs="i386-tdep.o i386-linux-tdep.o glibc-tdep.o i387-tdep.o \
 			solib-svr4.o symfile-mem.o \
-			linux-tdep.o linux-record.o"
+			linux-tdep.o linux-record.o linux-btrace.o"
 	if test "x$enable_64_bit_bfd" = "xyes"; then
 	    # Target: GNU/Linux x86-64
 	    gdb_target_obs="amd64-tdep.o amd64-linux-tdep.o ${gdb_target_obs}"
@@ -660,7 +660,8 @@ x86_64-*-linux*)
 	# Target: GNU/Linux x86-64
 	gdb_target_obs="amd64-tdep.o amd64-linux-tdep.o i386-tdep.o \
 			i387-tdep.o i386-linux-tdep.o glibc-tdep.o \
-			solib-svr4.o symfile-mem.o linux-tdep.o linux-record.o"
+			solib-svr4.o symfile-mem.o linux-tdep.o linux-record.o \
+			linux-btrace.o"
 	build_gdbserver=yes
 	;;
 x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu)
-- 
1.7.12.4


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

* Re: [PATCH] btrace: fix the non-native build
  2013-08-13 14:47 [PATCH] btrace: fix the non-native build Mircea Gherzan
@ 2013-08-13 15:03 ` Mark Kettenis
  2013-08-21 13:59   ` Jan Kratochvil
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Kettenis @ 2013-08-13 15:03 UTC (permalink / raw)
  To: mircea.gherzan
  Cc: tromey, jan.kratochvil, gdb-patches, markus.t.metzger, mircea.gherzan

> From: Mircea Gherzan <mircea.gherzan@intel.com>
> Date: Tue, 13 Aug 2013 16:45:54 +0200
> 
> When building on a non-Linux host for a Linux target, the build fails
> because the linux-btrace object is not built/linked.
> 
> 2013-08-09  Mircea Gherzan  <mircea.gherzan@intel.com>
> 
> gdb/
> 	* configure.tgt: Add linux-btrace.o to gdb_target_obs for i386
> 	and x86_64 Linux targets.
> 	* config/i386/linux.mh (NATDEPFILES): Remove linux-btrace.o.
> 	* config/i386/linux64.mh (NATDEPFILES): Remove linux-btrace.o.

Nope.  linux-btrace.c contains native code that should only ever be
linked into a native GDB.


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

* Re: [PATCH] btrace: fix the non-native build
  2013-08-13 15:03 ` Mark Kettenis
@ 2013-08-21 13:59   ` Jan Kratochvil
  0 siblings, 0 replies; 3+ messages in thread
From: Jan Kratochvil @ 2013-08-21 13:59 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: mircea.gherzan, tromey, gdb-patches, markus.t.metzger

On Tue, 13 Aug 2013 17:03:01 +0200, Mark Kettenis wrote:
> > From: Mircea Gherzan <mircea.gherzan@intel.com>
> > Date: Tue, 13 Aug 2013 16:45:54 +0200
> > 
> > When building on a non-Linux host for a Linux target, the build fails
> > because the linux-btrace object is not built/linked.

You should have included your config and error message.


> > 2013-08-09  Mircea Gherzan  <mircea.gherzan@intel.com>
> > 
> > gdb/
> > 	* configure.tgt: Add linux-btrace.o to gdb_target_obs for i386
> > 	and x86_64 Linux targets.
> > 	* config/i386/linux.mh (NATDEPFILES): Remove linux-btrace.o.
> > 	* config/i386/linux64.mh (NATDEPFILES): Remove linux-btrace.o.
> 
> Nope.  linux-btrace.c contains native code that should only ever be
> linked into a native GDB.

Technically linux-btrace.c defines:
	linux_disable_btrace
	linux_enable_btrace
	linux_read_btrace
	linux_supports_btrace

which are only used from amd64-linux-nat.c and i386-linux-nat.c which both are
also present in NATDEPFILES.

I have tested build on x86_64-unknown-netbsd5.1 (gcc70.fsffrance.org) for both
FSF GDB HEAD and for v4 patchset by Markus Metzger and it all builds fine.

(gdbserver is off-topic here, the patch does not modify any gdbserver-related
files.)


Jan


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

end of thread, other threads:[~2013-08-21 13:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-13 14:47 [PATCH] btrace: fix the non-native build Mircea Gherzan
2013-08-13 15:03 ` Mark Kettenis
2013-08-21 13:59   ` Jan Kratochvil

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