Hi Josef,

gdbserver should be configured with --host only (it is to be hosted on target)
gdb and gdbserver are actually tied to eachother, as well as toolchain and
userland build on target. It therefore makes sense to build them as a userland app.

Attached is a makefile in order to get a gdb 6.6 tarball from GNU to build
correctly on a ARM/XScale target, ixp465. Also the two patches are needed.

Hope they can be of some help.

regards,
Per



Wolf, Josef wrote:
Hello!

I'm using uClinux-dist-20051014 with an lp2292 (arm7tdmi).  I tried to
compile the gdbserver that is included in uClinux-dist-20051014.  But
its
configure script bails out with "Target not supported by gdbserver."
Then I checked config.status, and it says

   # This directory was configured as follows
   ../../configure --host=i686-cp-linux-gnu --target=m68k-elf

which don't look right to me for two reasons:

- gdbserver's README says it must be configured with host beeing
identical
  to target.  This sounds reasonable, since the server runs on the
target
  and it needs to understand the target architecture.

- m68k-elf is oviously not correct for arm7tdmi.

I found a description on ucdot:

  http://www.ucdot.org/article.pl?sid=03/01/07/0214244&mode=thread

but this description seems to assume that the sources are already
configured for arm architecture.

Any hints how to configure gdb for arm7tdmi?  Do I need to start from
vanilla sources?
_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

# Glue Makefile for gdb/gdbserver
#
# Author: Per Hallsmark <[EMAIL PROTECTED]>
#

PKG=gdb-6.6

HOST=
HOST_ENV=CC= CFLAGS=

TGT=arm-linux
TGT_ENV=

all: build_host build_target

$(PKG)/build/Makefile:
        mkdir $(PKG)/build
        cd $(PKG)/build && $(HOST_ENV) ../configure --target=$(TGT) \
                --with-sysroot

build_host: $(PKG)/build/Makefile
        $(MAKE) -C $(PKG)/build

$(PKG)/build-$(TGT)/gdbserver/Makefile:
        mkdir -p $(PKG)/build-$(TGT)/gdbserver
        cd $(PKG)/build-$(TGT)/gdbserver && \
                $(TGT_ENV) ../../gdb/gdbserver/configure --host=$(TGT)
        
build_target: $(PKG)/build-$(TGT)/gdbserver/Makefile
        $(MAKE) -C $(PKG)/build-$(TGT)/gdbserver

romfs:
        $(ROMFSINST) $(PKG)/build-$(TGT)/gdbserver/gdbserver /bin/gdbserver

clean:
        $(RM) -r $(PKG)/build $(PKG)/build-$(TGT)
diff --exclude='*.svn*' -ur gdb-6.6.orig/gdb/gdbserver/linux-arm-low.c gdb-6.6/gdb/gdbserver/linux-arm-low.c
--- gdb-6.6.orig/gdb/gdbserver/linux-arm-low.c	2006-05-30 17:57:09.000000000 +0200
+++ gdb-6.6/gdb/gdbserver/linux-arm-low.c	2007-03-12 11:11:16.000000000 +0100
@@ -32,7 +32,7 @@
 #endif
 
 #ifdef HAVE_SYS_REG_H
-#include <sys/reg.h>
+//#include <sys/reg.h>
 #endif
 
 #define arm_num_regs 26
diff --exclude='*.svn*' -urN gdb-6.6.orig/readline/configure gdb-6.6/readline/configure
--- gdb-6.6.orig/readline/configure	2006-05-05 20:26:12.000000000 +0200
+++ gdb-6.6/readline/configure	2007-03-07 15:04:46.000000000 +0100
@@ -312,7 +312,7 @@
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os CROSS_COMPILE SET_MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP CC_FOR_BUILD INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA AR RANLIB ac_ct_RANLIB MAKE_SHELL WCWIDTH_OBJ SHOBJ_CC SHOBJ_CFLAGS SHOBJ_LD SHOBJ_LDFLAGS SHOBJ_XLDFLAGS SHOBJ_LIBS SHOBJ_STATUS SHLIB_STATUS SHLIB_XLDFLAGS SHLIB_DOT SHLIB_LIBPREF SHLIB_LIBSUFF SHLIB_LIBVERSION SHLIB_DLLVERSION SHLIB_LIBS SHLIB_MAJOR SHLIB_MINOR STATIC_TARGET SHARED_TARGET STATIC_INSTALL_TARGET SHARED_INSTALL_TARGET PURIFY BUILD_DIR LOCAL_CFLAGS LOCAL_LDFLAGS LOCAL_DEFS ARFLAGS LIBVERSION TERMCAP_LIB LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os DO_CROSS_COMPILE SET_MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP CC_FOR_BUILD INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA AR RANLIB ac_ct_RANLIB MAKE_SHELL WCWIDTH_OBJ SHOBJ_CC SHOBJ_CFLAGS SHOBJ_LD SHOBJ_LDFLAGS SHOBJ_XLDFLAGS SHOBJ_LIBS SHOBJ_STATUS SHLIB_STATUS SHLIB_XLDFLAGS SHLIB_DOT SHLIB_LIBPREF SHLIB_LIBSUFF SHLIB_LIBVERSION SHLIB_DLLVERSION SHLIB_LIBS SHLIB_MAJOR SHLIB_MINOR STATIC_TARGET SHARED_TARGET STATIC_INSTALL_TARGET SHARED_INSTALL_TARGET PURIFY BUILD_DIR LOCAL_CFLAGS LOCAL_LDFLAGS LOCAL_DEFS ARFLAGS LIBVERSION TERMCAP_LIB LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -1475,7 +1475,7 @@
         . ${cross_cache}
     fi
     unset cross_cache
-    CROSS_COMPILE='-DCROSS_COMPILING'
+    DO_CROSS_COMPILE='-DCROSS_COMPILING'
 
 fi
 
@@ -8723,7 +8723,7 @@
 s,@host_cpu@,$host_cpu,;t t
 s,@host_vendor@,$host_vendor,;t t
 s,@host_os@,$host_os,;t t
-s,@CROSS_COMPILE@,$CROSS_COMPILE,;t t
+s,@DO_CROSS_COMPILE@,$DO_CROSS_COMPILE,;t t
 s,@SET_MAKE@,$SET_MAKE,;t t
 s,@CC@,$CC,;t t
 s,@CFLAGS@,$CFLAGS,;t t
diff --exclude='*.svn*' -urN gdb-6.6.orig/readline/configure.in gdb-6.6/readline/configure.in
--- gdb-6.6.orig/readline/configure.in	2006-05-05 20:26:12.000000000 +0200
+++ gdb-6.6/readline/configure.in	2007-03-07 15:04:24.000000000 +0100
@@ -96,8 +96,8 @@
         . ${cross_cache}
     fi
     unset cross_cache
-    CROSS_COMPILE='-DCROSS_COMPILING'
-    AC_SUBST(CROSS_COMPILE)
+    DO_CROSS_COMPILE='-DCROSS_COMPILING'
+    AC_SUBST(DO_CROSS_COMPILE)
 fi
 
 echo ""
diff --exclude='*.svn*' -urN gdb-6.6.orig/readline/Makefile.in gdb-6.6/readline/Makefile.in
--- gdb-6.6.orig/readline/Makefile.in	2006-10-21 22:47:07.000000000 +0200
+++ gdb-6.6/readline/Makefile.in	2007-03-07 15:04:01.000000000 +0100
@@ -73,7 +73,7 @@
 LOCAL_CFLAGS = @LOCAL_CFLAGS@ -DRL_LIBRARY_VERSION='"$(RL_LIBRARY_VERSION)"'
 CPPFLAGS = @CPPFLAGS@
 
-DEFS = @DEFS@ @CROSS_COMPILE@
+DEFS = @DEFS@ @DO_CROSS_COMPILE@
 LOCAL_DEFS = @LOCAL_DEFS@
 
 TERMCAP_LIB = @TERMCAP_LIB@
_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to