Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Nathan Sidwell <nathan@codesourcery.com>
To: gdb-patches@sourceware.org
Subject: x86-64 gdbserver config
Date: Mon, 02 Nov 2009 12:51:00 -0000	[thread overview]
Message-ID: <4AEED5B3.7020107@codesourcery.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 459 bytes --]

This patch allows building an x86-64 gdbserver for a multilibbed 
i686-pc-linux-gnu target.  One cannot tell from the target triplet that x86-64 
source files are needed -- one must invoke the compiler and examine the 
__x86_64__ #define.  For instance, the CC_FOR_TARGET may be 'my-gcc -m64'.

built and tested for an m64 multilib of an i686-pc-linux-gnu target.  ok?

nathan
-- 
Nathan Sidwell    ::   http://www.codesourcery.com   ::         CodeSourcery


[-- Attachment #2: x86-64.patch --]
[-- Type: text/x-patch, Size: 2307 bytes --]

2009-10-30  Nathan Sidwell  <nathan@codesourcery.com>

	* configure.ac (i[34567]86-*): Check if we're targetting x86-64
	with an i686 compiler.
	* configure.srv (i[34567]86-*-linux*): Pull in x86-64 handling if
	needed.
	* configure: Rebuilt.

Index: configure
===================================================================
Index: configure.ac
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/configure.ac,v
retrieving revision 1.28
diff -c -3 -p -r1.28 configure.ac
*** configure.ac	29 Oct 2009 17:43:44 -0000	1.28
--- configure.ac	2 Nov 2009 12:44:11 -0000
*************** ACX_BUGURL([http://www.gnu.org/software/
*** 73,78 ****
--- 73,97 ----
  AC_DEFINE_UNQUOTED([PKGVERSION], ["$PKGVERSION"], [Additional package description])
  AC_DEFINE_UNQUOTED([REPORT_BUGS_TO], ["$REPORT_BUGS_TO"], [Bug reporting address])
  
+ # Check for various supplementary target information (beyond the
+ # triplet) which might affect the choices in configure.srv.
+ case "${target}" in
+ changequote(,)dnl
+   i[34567]86-*-linux*)
+ changequote([,])dnl
+     AC_CACHE_CHECK([if building for x86-64], [gdb_cv_i386_is_x86_64],
+       	           [save_CPPFLAGS="$CPPFLAGS"
+                     CPPFLAGS="$CPPFLAGS $CFLAGS"
+                     AC_EGREP_CPP([got it], [
+ #if __x86_64__
+ got it
+ #endif
+                  ], [gdb_cv_i386_is_x86_64=yes],
+                     [gdb_cv_i386_is_x86_64=no])
+                     CPPFLAGS="$save_CPPFLAGS"])
+     ;;
+ esac
+ 
  . ${srcdir}/configure.srv
  
  if test "${srv_mingwce}" = "yes"; then
Index: configure.srv
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/configure.srv,v
retrieving revision 1.46
diff -c -3 -p -r1.46 configure.srv
*** configure.srv	31 Jul 2009 15:23:20 -0000	1.46
--- configure.srv	2 Nov 2009 12:44:11 -0000
*************** case "${target}" in
*** 64,69 ****
--- 64,72 ----
  			srv_tgtobj="i386-low.o win32-low.o win32-i386-low.o"
  			;;
    i[34567]86-*-linux*)	srv_regobj=reg-i386-linux.o
+ 			if test "$gdb_cv_i386_is_x86_64" = yes ; then
+ 			    srv_regobj="reg-x86-64-linux.o $srv_regobj"
+ 			fi
  			srv_tgtobj="linux-low.o linux-x86-low.o i386-low.o i387-fp.o"
  			srv_linux_usrregs=yes
  			srv_linux_regsets=yes

             reply	other threads:[~2009-11-02 12:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-02 12:51 Nathan Sidwell [this message]
2009-11-02 23:08 ` Joel Brobecker
2009-11-03  2:37   ` Daniel Jacobowitz
2009-11-03  3:39     ` Joel Brobecker
2009-11-03  3:55 ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4AEED5B3.7020107@codesourcery.com \
    --to=nathan@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox