This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

x86-64 gdbserver config


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

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]