Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Nov 2014 23:56:21 -0800
From:      John-Mark Gurney <jmg@funkthat.com>
To:        Tom Everett <tom@khubla.com>
Cc:        "freebsd-arm@freebsd.org" <freebsd-arm@freebsd.org>
Subject:   Re: gdb for arm
Message-ID:  <20141115075621.GX24601@funkthat.com>
In-Reply-To: <CAB3ij4C-gO8DSVkZqGZa7o7Vg7iRup28w1qGjKgKARPPfrMy9Q@mail.gmail.com>
References:  <CAB3ij4C-gO8DSVkZqGZa7o7Vg7iRup28w1qGjKgKARPPfrMy9Q@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--ryJZkp9/svQ58syV
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Tom Everett wrote this message on Fri, Nov 14, 2014 at 20:13 -0700:
> I'm trying to debug some bare metal arm code I've written on FreeBSD.  I'm
> using the xdev tools to cross compile for arm on amd64.  Could someone
> point me in the right direction in terms of cross-compiling gdb on FreeBSD?

If you add gdb to xdev, it should just work...  I did some work a while
back to make kgdb compile (but only kinda work)...

I've attached the patch...  The reenabling of CTF was to help me get
the avila board back to being functional...

I don't remeber why I needed CDMAKE...

I do vaguely remeber that there might have been some ordering issues,
but I don't remeber right now...

Let me know how it works for you...

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."

--ryJZkp9/svQ58syV
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="gdb.avila.patch"

Index: Makefile.inc1
===================================================================
--- Makefile.inc1	(revision 271882)
+++ Makefile.inc1	(working copy)
@@ -249,7 +249,7 @@ BMAKE=		MAKEOBJDIRPREFIX=${WORLDTMP} \
 		SSP_CFLAGS= \
 		MK_HTML=no MK_INFO=no NO_LINT=yes MK_MAN=no \
 		-DNO_PIC MK_PROFILE=no -DNO_SHARED \
-		-DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \
+		-DNO_CPU_CFLAGS MK_WARNS=no \
 		MK_CLANG_FULL=no MK_LLDB=no MK_TESTS=no
 
 # build-tools stage
@@ -260,7 +260,7 @@ TMAKE=		MAKEOBJDIRPREFIX=${OBJTREE} \
 		BOOTSTRAPPING=${OSRELDATE} \
 		SSP_CFLAGS= \
 		-DNO_LINT \
-		-DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no MK_CLANG_FULL=no MK_LLDB=no MK_TESTS=no
+		-DNO_CPU_CFLAGS MK_WARNS=no MK_CLANG_FULL=no MK_LLDB=no MK_TESTS=no
 
 # cross-tools stage
 XMAKE=		TOOLS_PREFIX=${WORLDTMP} ${BMAKE} \
@@ -678,9 +678,10 @@ buildworld_epilogue:
 buildenvvars:
 	@echo ${WMAKEENV:Q}
 
+WHICHENV=${BUILDENVSTAGE:UWMAKE}
 buildenv:
 	@echo Entering world for ${TARGET_ARCH}:${TARGET}
-	@cd ${.CURDIR} && env ${WMAKEENV} ${BUILDENV_SHELL} || true
+	@cd ${.CURDIR} && env ${${WHICHENV}ENV} ${BUILDENV_SHELL} || true
 
 TOOLCHAIN_TGTS=	${WMAKE_TGTS:N_depend:Neverything:Nbuild32}
 toolchain: ${TOOLCHAIN_TGTS}
@@ -1966,11 +1967,13 @@ _xb-build-tools:
 _xb-cross-tools:
 .for _tool in \
     ${_binutils} \
+    gnu/usr.bin/gdb \
     usr.bin/ar \
     ${_clang_libs} \
     ${_clang} \
     ${_cc}
 	${_+_}@${ECHODIR} "===> xdev ${_tool} (obj,depend,all)"; \
+	echo CDMAKE: ${CDMAKE} && \
 	cd ${.CURDIR}/${_tool} && \
 	${CDMAKE} DIRPRFX=${_tool}/ obj && \
 	${CDMAKE} DIRPRFX=${_tool}/ depend && \
@@ -1998,6 +2001,7 @@ _xi-cross-tools:
 	@echo "_xi-cross-tools"
 .for _tool in \
     ${_binutils} \
+    gnu/usr.bin/gdb \
     usr.bin/ar \
     ${_clang_libs} \
     ${_clang} \

--ryJZkp9/svQ58syV--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20141115075621.GX24601>