Subject: Re: cross-GDB issue
To: Allen Briggs <briggs@wasabisystems.com>
From: Ian Lance Taylor <ian@wasabisystems.com>
List: tech-toolchain
Date: 11/13/2003 10:11:10
Allen Briggs <briggs@wasabisystems.com> writes:

> I'm trying to build a cross-gdb for evbarm on ix86.  It's not linking
> because:
> 
> libgdb.a(solib.o): In function `clear_solib':
> solib.o(.text+0xa04): undefined reference to `disable_breakpoints_in_shlibs'
> libgdb.a(solib-svr4.o): In function `enable_break':
> solib-svr4.o(.text+0x7d2): undefined reference to `remove_solib_event_breakpoints'
> solib-svr4.o(.text+0x9fb): undefined reference to `create_solib_event_breakpoint'
> 
> They symbols aren't defined in breakpoint.o where they should be because
> SOLIB_ADD is not defined on the target.  I tried taking the tack that
> seems to have been taken for other NetBSD targets, which is to add a
> tm-nbsd.h that includes solib.h, call that a TM_FILE, and add it to the
> target makefile fragment config/arm/nbsd.mt, but that results in
> 
> configure: warning: GDB: Ignoring TM_FILE in /x/home/briggs/netbsd/current/clean/src/tools/gdb/../../gnu/dist/gdb/gdb/config/arm/nbsd.mt
> 
> since arm--netbsdelf is apparently known as something called a
> MULTI_ARCH target from configure.tgt:
> 
> arm*-*-netbsd*)         gdb_target=nbsd  
>                         gdb_multi_arch=yes ;;
> 
> So I'm not sure what the correct path out of this is.  ARM appears to be
> the only NetBSD architecture that's a gdb_multi_arch, so there doesn't
> seem to be a precedent.

I note that this fails in the current development sources as well, in
the same way.

I think the appended is more or less the right fix, but I haven't
really tested it.  It builds, but I haven't tried to run it on
anything.

Ian

Index: gdb/config/arm/nbsd.mt
===================================================================
RCS file: /cvsroot/src/gnu/dist/gdb/gdb/config/arm/nbsd.mt,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 nbsd.mt
--- gdb/config/arm/nbsd.mt	2003/08/11 20:25:31	1.1.1.1
+++ gdb/config/arm/nbsd.mt	2003/11/13 15:10:22
@@ -1,2 +1,6 @@
 # Target: ARM running NetBSD
 TDEPFILES= arm-tdep.o armnbsd-tdep.o solib.o solib-svr4.o nbsd-tdep.o
+
+GDB_MULTI_ARCH=GDB_MULTI_ARCH_TM
+
+TM_FILE=tm-nbsd.h
--- /dev/null	Thu Nov 13 10:08:22 2003
+++ gdb/config/arm/tm-nbsd.h	Thu Nov 13 10:06:59 2003
@@ -0,0 +1,28 @@
+/* Macro definitions for ARM running under NetBSD.
+   Copyright 2003 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifndef TM_NBSD_H
+#define TM_NBSD_H
+
+#define GDB_MULTI_ARCH GDB_MULTI_ARCH_TM
+
+#include "solib.h"
+
+#endif /* TM_NBSD_H */