From: Nathan Sidwell Date: Tue, 3 Nov 2009 09:33:18 +0000 (+0000) Subject: * configure.ac (i[34567]86-*): Check if we're targetting x86-64 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8838b45ede3169a840916bbe0234f1f9f451c9b3;p=binutils-gdb.git * 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. --- diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 5a83c8fa636..59979c82fcf 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,11 @@ +2009-11-03 Nathan Sidwell + + * 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. + 2009-10-29 Sandra Loosemore PR gdb/10783 diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure index 687105a5c85..955f7165670 100755 --- a/gdb/gdbserver/configure +++ b/gdb/gdbserver/configure @@ -3973,6 +3973,40 @@ cat >>confdefs.h <<_ACEOF _ACEOF +# Check for various supplementary target information (beyond the +# triplet) which might affect the choices in configure.srv. +case "${target}" in + i[34567]86-*-linux*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if building for x86-64" >&5 +$as_echo_n "checking if building for x86-64... " >&6; } +if test "${gdb_cv_i386_is_x86_64+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $CFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if __x86_64__ +got it +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "got it" >/dev/null 2>&1; then : + gdb_cv_i386_is_x86_64=yes +else + gdb_cv_i386_is_x86_64=no +fi +rm -f conftest* + + CPPFLAGS="$save_CPPFLAGS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_i386_is_x86_64" >&5 +$as_echo "$gdb_cv_i386_is_x86_64" >&6; } + ;; +esac + . ${srcdir}/configure.srv if test "${srv_mingwce}" = "yes"; then diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac index 2f2b2a3ff4b..57eaf2172df 100644 --- a/gdb/gdbserver/configure.ac +++ b/gdb/gdbserver/configure.ac @@ -73,6 +73,25 @@ ACX_BUGURL([http://www.gnu.org/software/gdb/bugs/]) 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 diff --git a/gdb/gdbserver/configure.srv b/gdb/gdbserver/configure.srv index 7aded2730a0..ea746be1a13 100644 --- a/gdb/gdbserver/configure.srv +++ b/gdb/gdbserver/configure.srv @@ -64,6 +64,9 @@ case "${target}" in 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