From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19329 invoked by alias); 20 Nov 2007 22:23:50 -0000 Received: (qmail 19297 invoked by uid 22791); 20 Nov 2007 22:23:46 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate1.de.ibm.com (HELO mtagate1.de.ibm.com) (195.212.29.150) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 20 Nov 2007 22:23:37 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate1.de.ibm.com (8.13.8/8.13.8) with ESMTP id lAKMNYpI022706 for ; Tue, 20 Nov 2007 22:23:34 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v8.7) with ESMTP id lAKMNX882990166 for ; Tue, 20 Nov 2007 23:23:33 +0100 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id lAKMNXnI014308 for ; Tue, 20 Nov 2007 23:23:33 +0100 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id lAKMNXDC014305; Tue, 20 Nov 2007 23:23:33 +0100 Message-Id: <200711202223.lAKMNXDC014305@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Tue, 20 Nov 2007 23:23:33 +0100 Subject: [rfc/rft] --enable-targets=all with 32-bit BFD To: muller@ics.u-strasbg.fr (Pierre Muller) Date: Tue, 20 Nov 2007 22:23:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org In-Reply-To: <001101c82ac9$c9ca71a0$5d5f54e0$@u-strasbg.fr> from "Pierre Muller" at Nov 19, 2007 05:32:34 PM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-11/txt/msg00387.txt.bz2 Pierre Muller wrote: > I checked in bfd/bfd.h and BFD_ARCH_SIZE was set to 32 > there. > > Adding --enable-64-bit-bfd I still > needed to add WERROR_CFLAGS="" > because I got warnings in win32-nat.c, > which implicitly assumes that CORE_ADDR > is 32 bit long. Would you mind testing the following patch? It should allow building GDB with --enable-target=all in a 32-bit-only BFD configuration (where CORE_ADDR is 32 bits long). When testing this on i386-linux, I noticed another bug: the i386_cygwin_osabi_sniffer routine claims all "elf32-i386" files as GDB_OSABI_CYGWIN, because Cygwin apparently uses ELF format core files. This means that if Cygwin is configured as secondary target, i386-linux debugging will fail because all ELF executables will be interpreted as Cygwin ... The following patch fixes this as well, by making sure that only Cygwin core files are claimed as GDB_OSABI_CYGWIN. The heuristic used is to check whether a ".reg" section of the proper size exists. Could you verify whether Cygwin core files are still recognized correctly with this patch? Thanks, Ulrich ChangeLog: * Makefile.in (ALL_TARGET_OBS): Remove object files that require 64-bit CORE_ADDR and BFD support, move them to ... (ALL_64_TARGET_OBS): ... this new variable. * configure.ac: Check for --enable-64-bit-bfd option. Only add 64-bit targets with --enable-targets=all if BFD supports 64-bit. * configure: Regenerate. * i386-cygwin-tdep.c (i386_cygwin_osabi_sniffer): Do not claim all elf32-i386 executables, only cygwin core files. Index: gdb/Makefile.in =================================================================== RCS file: /cvs/src/src/gdb/Makefile.in,v retrieving revision 1.961 diff -c -p -r1.961 Makefile.in *** gdb/Makefile.in 17 Nov 2007 01:02:01 -0000 1.961 --- gdb/Makefile.in 20 Nov 2007 21:44:45 -0000 *************** SIM_OBS = @SIM_OBS@ *** 431,442 **** # Target-dependent object files. TARGET_OBS = @TARGET_OBS@ ! # All target-dependent objects files (used with --enable-targets=all). ! ALL_TARGET_OBS = \ alphabsd-tdep.o alphafbsd-tdep.o alpha-linux-tdep.o alpha-mdebug-tdep.o \ alphanbsd-tdep.o alphaobsd-tdep.o alpha-osf1-tdep.o alpha-tdep.o \ amd64fbsd-tdep.o amd64-linux-tdep.o amd64nbsd-tdep.o amd64obsd-tdep.o \ amd64-sol2-tdep.o amd64-tdep.o \ armbsd-tdep.o arm-linux-tdep.o armnbsd-tdep.o armobsd-tdep.o \ arm-tdep.o arm-wince-tdep.o \ avr-tdep.o \ --- 431,450 ---- # Target-dependent object files. TARGET_OBS = @TARGET_OBS@ ! # All target-dependent objects files that require 64-bit CORE_ADDR ! # (used with --enable-targets=all --enable-64-bit-bfd). ! ALL_64_TARGET_OBS = \ alphabsd-tdep.o alphafbsd-tdep.o alpha-linux-tdep.o alpha-mdebug-tdep.o \ alphanbsd-tdep.o alphaobsd-tdep.o alpha-osf1-tdep.o alpha-tdep.o \ amd64fbsd-tdep.o amd64-linux-tdep.o amd64nbsd-tdep.o amd64obsd-tdep.o \ amd64-sol2-tdep.o amd64-tdep.o \ + ia64-linux-tdep.o ia64-tdep.o \ + mips64obsd-tdep.o \ + sparc64fbsd-tdep.o sparc64-linux-tdep.o sparc64nbsd-tdep.o \ + sparc64obsd-tdep.o sparc64-sol2-tdep.o sparc64-tdep.o + + # All other target-dependent objects files (used with --enable-targets=all). + ALL_TARGET_OBS = \ armbsd-tdep.o arm-linux-tdep.o armnbsd-tdep.o armobsd-tdep.o \ arm-tdep.o arm-wince-tdep.o \ avr-tdep.o \ *************** ALL_TARGET_OBS = \ *** 447,453 **** i386bsd-tdep.o i386-cygwin-tdep.o i386fbsd-tdep.o i386gnu-tdep.o \ i386-linux-tdep.o i386nbsd-tdep.o i386-nto-tdep.o i386obsd-tdep.o \ i386-sol2-tdep.o i386-tdep.o i387-tdep.o \ - ia64-linux-tdep.o ia64-tdep.o \ iq2000-tdep.o \ m32c-tdep.o \ m32r-linux-tdep.o m32r-tdep.o \ --- 455,460 ---- *************** ALL_TARGET_OBS = \ *** 455,461 **** m68kbsd-tdep.o m68klinux-tdep.o m68k-tdep.o \ m88k-tdep.o \ mep-tdep.o \ ! mips64obsd-tdep.o mips-irix-tdep.o mips-linux-tdep.o \ mipsnbsd-tdep.o mips-tdep.o \ mn10300-linux-tdep.o mn10300-tdep.o \ mt-tdep.o \ --- 462,468 ---- m68kbsd-tdep.o m68klinux-tdep.o m68k-tdep.o \ m88k-tdep.o \ mep-tdep.o \ ! mips-irix-tdep.o mips-linux-tdep.o \ mipsnbsd-tdep.o mips-tdep.o \ mn10300-linux-tdep.o mn10300-tdep.o \ mt-tdep.o \ *************** ALL_TARGET_OBS = \ *** 465,472 **** s390-tdep.o \ score-tdep.o \ sh64-tdep.o sh-linux-tdep.o shnbsd-tdep.o sh-tdep.o \ - sparc64fbsd-tdep.o sparc64-linux-tdep.o sparc64nbsd-tdep.o \ - sparc64obsd-tdep.o sparc64-sol2-tdep.o sparc64-tdep.o \ sparc-linux-tdep.o sparcnbsd-tdep.o sparcobsd-tdep.o \ sparc-sol2-tdep.o sparc-tdep.o \ spu-tdep.o \ --- 472,477 ---- Index: gdb/configure =================================================================== RCS file: /cvs/src/src/gdb/configure,v retrieving revision 1.239 diff -c -p -r1.239 configure *** gdb/configure 17 Nov 2007 01:02:01 -0000 1.239 --- gdb/configure 20 Nov 2007 21:44:47 -0000 *************** Optional Features: *** 861,866 **** --- 861,867 ---- --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --enable-targets alternative target configurations + --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes) --disable-gdbcli disable command-line interface (CLI) --disable-gdbmi disable machine-interface (MI) --enable-tui enable full-screen terminal user interface (TUI) *************** echo "$as_me: error: enable-targets opti *** 3095,3100 **** --- 3096,3115 ---- esac fi; + # Check whether to enable 64-bit support on 32-bit hosts + # Check whether --enable-64-bit-bfd or --disable-64-bit-bfd was given. + if test "${enable_64_bit_bfd+set}" = set; then + enableval="$enable_64_bit_bfd" + case "${enableval}" in + yes) want64=true ;; + no) want64=false ;; + *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for 64-bit-bfd option" >&5 + echo "$as_me: error: bad value ${enableval} for 64-bit-bfd option" >&2;} + { (exit 1); exit 1; }; } ;; + esac + else + want64=false + fi; # Provide defaults for some variables set by the per-host and per-target # configuration. gdb_host_obs=posix-hdep.o *************** do *** 3136,3291 **** ;; esac done fi done if test x${all_targets} = xtrue; then - TARGET_OBS='$(ALL_TARGET_OBS)' - fi - - - - # For other settings, only the main target counts. - gdb_sim= - gdb_osabi= - build_gdbserver= - targ=$target; . ${srcdir}/configure.tgt - - # Fetch the default architecture and default target vector from BFD. - targ=$target; . $srcdir/../bfd/config.bfd - - # We only want the first architecture, so strip off the others if - # there is more than one. - targ_archs=`echo $targ_archs | sed 's/ .*//'` - - if test "x$targ_archs" != x; then - - cat >>confdefs.h <<_ACEOF - #define DEFAULT_BFD_ARCH $targ_archs - _ACEOF - - fi - if test "x$targ_defvec" != x; then - - cat >>confdefs.h <<_ACEOF - #define DEFAULT_BFD_VEC $targ_defvec - _ACEOF - - fi - - test "$program_prefix" != NONE && - program_transform_name="s,^,$program_prefix,;$program_transform_name" - # Use a double $ so make ignores it. - test "$program_suffix" != NONE && - program_transform_name="s,\$,$program_suffix,;$program_transform_name" - # Double any \ or $. echo might interpret backslashes. - # By default was `s,x,x', remove it if useless. - cat <<\_ACEOF >conftest.sed - s/[\\$]/&&/g;s/;s,x,x,$// - _ACEOF - program_transform_name=`echo $program_transform_name | sed -f conftest.sed` - rm conftest.sed - - - # The CLI cannot be disabled yet, but may be in the future. - - # Enable CLI. - # Check whether --enable-gdbcli or --disable-gdbcli was given. - if test "${enable_gdbcli+set}" = set; then - enableval="$enable_gdbcli" - case $enableval in - yes) - ;; - no) - { { echo "$as_me:$LINENO: error: the command-line interface cannot be disabled yet" >&5 - echo "$as_me: error: the command-line interface cannot be disabled yet" >&2;} - { (exit 1); exit 1; }; } ;; - *) - { { echo "$as_me:$LINENO: error: bad value $enableval for --enable-gdbcli" >&5 - echo "$as_me: error: bad value $enableval for --enable-gdbcli" >&2;} - { (exit 1); exit 1; }; } ;; - esac - else - enable_gdbcli=yes - fi; - if test x"$enable_gdbcli" = xyes; then - if test -d $srcdir/cli; then - CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_CLI_OBS)" - CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_CLI_DEPS)" - CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_CLI_SRCS)" - ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_CLI_CFLAGS)" - fi - fi - - # Enable MI. - # Check whether --enable-gdbmi or --disable-gdbmi was given. - if test "${enable_gdbmi+set}" = set; then - enableval="$enable_gdbmi" - case $enableval in - yes | no) - ;; - *) - { { echo "$as_me:$LINENO: error: bad value $enableval for --enable-gdbmi" >&5 - echo "$as_me: error: bad value $enableval for --enable-gdbmi" >&2;} - { (exit 1); exit 1; }; } ;; - esac - else - enable_gdbmi=yes - fi; - if test x"$enable_gdbmi" = xyes; then - if test -d $srcdir/mi; then - CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_MI_OBS)" - CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_MI_DEPS)" - CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_MI_SRCS)" - ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_MI_CFLAGS)" - fi - fi - - # Enable TUI. - # Check whether --enable-tui or --disable-tui was given. - if test "${enable_tui+set}" = set; then - enableval="$enable_tui" - case $enableval in - yes | no) - ;; - *) - { { echo "$as_me:$LINENO: error: bad value $enableval for --enable-tui" >&5 - echo "$as_me: error: bad value $enableval for --enable-tui" >&2;} - { (exit 1); exit 1; }; } ;; - esac - else - enable_tui=yes - fi; ! # Enable gdbtk. ! # Check whether --enable-gdbtk or --disable-gdbtk was given. ! if test "${enable_gdbtk+set}" = set; then ! enableval="$enable_gdbtk" ! case $enableval in ! yes | no) ! ;; ! *) ! { { echo "$as_me:$LINENO: error: bad value $enableval for --enable-gdbtk" >&5 ! echo "$as_me: error: bad value $enableval for --enable-gdbtk" >&2;} ! { (exit 1); exit 1; }; } ;; ! esac ! else ! if test -d $srcdir/gdbtk -a -d $srcdir/../itcl; then ! enable_gdbtk=yes ! else ! enable_gdbtk=no ! fi ! fi; ! # We unconditionally disable gdbtk tests on selected platforms. ! case $host_os in ! go32* | windows*) ! { echo "$as_me:$LINENO: WARNING: gdbtk isn't supported on $host; disabling" >&5 ! echo "$as_me: WARNING: gdbtk isn't supported on $host; disabling" >&2;} ! enable_gdbtk=no ;; ! esac ! # Libunwind support. ! echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 --- 3151,3177 ---- ;; esac done + + # Check whether this target needs 64-bit CORE_ADDR + if test x${want64} = xfalse; then + . ${srcdir}/../bfd/config.bfd + fi fi done if test x${all_targets} = xtrue; then ! # We want all 64-bit targets if we either: ! # - run on a 64-bit host or ! # - already require 64-bit support for some other target or ! # - the --enable-64-bit-bfd option was supplied ! # Otherwise we only support all 32-bit targets. ! # ! # NOTE: This test must be in sync with the corresponding ! # tests in BFD! ! if test x${want64} = xfalse; then ! echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 *************** fi *** 3523,3528 **** --- 3409,3981 ---- done + echo "$as_me:$LINENO: checking for long" >&5 + echo $ECHO_N "checking for long... $ECHO_C" >&6 + if test "${ac_cv_type_long+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext + cat >>conftest.$ac_ext <<_ACEOF + /* end confdefs.h. */ + $ac_includes_default + int + main () + { + if ((long *) 0) + return 0; + if (sizeof (long)) + return 0; + ; + return 0; + } + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_long=yes + else + echo "$as_me: failed program was:" >&5 + sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_long=no + fi + rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + fi + echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 + echo "${ECHO_T}$ac_cv_type_long" >&6 + + echo "$as_me:$LINENO: checking size of long" >&5 + echo $ECHO_N "checking size of long... $ECHO_C" >&6 + if test "${ac_cv_sizeof_long+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + if test "$ac_cv_type_long" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext + cat >>conftest.$ac_ext <<_ACEOF + /* end confdefs.h. */ + $ac_includes_default + int + main () + { + static int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)]; + test_array [0] = 0 + + ; + return 0; + } + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext + cat >>conftest.$ac_ext <<_ACEOF + /* end confdefs.h. */ + $ac_includes_default + int + main () + { + static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; + test_array [0] = 0 + + ; + return 0; + } + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break + else + echo "$as_me: failed program was:" >&5 + sed 's/^/| /' conftest.$ac_ext >&5 + + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` + fi + rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done + else + echo "$as_me: failed program was:" >&5 + sed 's/^/| /' conftest.$ac_ext >&5 + + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext + cat >>conftest.$ac_ext <<_ACEOF + /* end confdefs.h. */ + $ac_includes_default + int + main () + { + static int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)]; + test_array [0] = 0 + + ; + return 0; + } + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext + cat >>conftest.$ac_ext <<_ACEOF + /* end confdefs.h. */ + $ac_includes_default + int + main () + { + static int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)]; + test_array [0] = 0 + + ; + return 0; + } + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break + else + echo "$as_me: failed program was:" >&5 + sed 's/^/| /' conftest.$ac_ext >&5 + + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` + fi + rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done + else + echo "$as_me: failed program was:" >&5 + sed 's/^/| /' conftest.$ac_ext >&5 + + ac_lo= ac_hi= + fi + rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + fi + rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + # Binary search between lo and hi bounds. + while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext + cat >>conftest.$ac_ext <<_ACEOF + /* end confdefs.h. */ + $ac_includes_default + int + main () + { + static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; + test_array [0] = 0 + + ; + return 0; + } + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid + else + echo "$as_me: failed program was:" >&5 + sed 's/^/| /' conftest.$ac_ext >&5 + + ac_lo=`expr '(' $ac_mid ')' + 1` + fi + rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done + case $ac_lo in + ?*) ac_cv_sizeof_long=$ac_lo;; + '') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 + See \`config.log' for more details." >&5 + echo "$as_me: error: cannot compute sizeof (long), 77 + See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; + esac + else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling + See \`config.log' for more details." >&5 + echo "$as_me: error: cannot run test program while cross compiling + See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + else + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext + cat >>conftest.$ac_ext <<_ACEOF + /* end confdefs.h. */ + $ac_includes_default + long longval () { return (long) (sizeof (long)); } + unsigned long ulongval () { return (long) (sizeof (long)); } + #include + #include + int + main () + { + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (long))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (long)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (long)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 0; + } + _ACEOF + rm -f conftest$ac_exeext + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_long=`cat conftest.val` + else + echo "$as_me: program exited with status $ac_status" >&5 + echo "$as_me: failed program was:" >&5 + sed 's/^/| /' conftest.$ac_ext >&5 + + ( exit $ac_status ) + { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 + See \`config.log' for more details." >&5 + echo "$as_me: error: cannot compute sizeof (long), 77 + See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + fi + rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + fi + fi + rm -f conftest.val + else + ac_cv_sizeof_long=0 + fi + fi + echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 + echo "${ECHO_T}$ac_cv_sizeof_long" >&6 + cat >>confdefs.h <<_ACEOF + #define SIZEOF_LONG $ac_cv_sizeof_long + _ACEOF + + + if test "x${ac_cv_sizeof_long}" = "x8"; then + want64=true + fi + fi + if test x${want64} = xtrue; then + TARGET_OBS='$(ALL_TARGET_OBS) $(ALL_64_TARGET_OBS)' + else + TARGET_OBS='$(ALL_TARGET_OBS)' + fi + fi + + + + # For other settings, only the main target counts. + gdb_sim= + gdb_osabi= + build_gdbserver= + targ=$target; . ${srcdir}/configure.tgt + + # Fetch the default architecture and default target vector from BFD. + targ=$target; . $srcdir/../bfd/config.bfd + + # We only want the first architecture, so strip off the others if + # there is more than one. + targ_archs=`echo $targ_archs | sed 's/ .*//'` + + if test "x$targ_archs" != x; then + + cat >>confdefs.h <<_ACEOF + #define DEFAULT_BFD_ARCH $targ_archs + _ACEOF + + fi + if test "x$targ_defvec" != x; then + + cat >>confdefs.h <<_ACEOF + #define DEFAULT_BFD_VEC $targ_defvec + _ACEOF + + fi + + test "$program_prefix" != NONE && + program_transform_name="s,^,$program_prefix,;$program_transform_name" + # Use a double $ so make ignores it. + test "$program_suffix" != NONE && + program_transform_name="s,\$,$program_suffix,;$program_transform_name" + # Double any \ or $. echo might interpret backslashes. + # By default was `s,x,x', remove it if useless. + cat <<\_ACEOF >conftest.sed + s/[\\$]/&&/g;s/;s,x,x,$// + _ACEOF + program_transform_name=`echo $program_transform_name | sed -f conftest.sed` + rm conftest.sed + + + # The CLI cannot be disabled yet, but may be in the future. + + # Enable CLI. + # Check whether --enable-gdbcli or --disable-gdbcli was given. + if test "${enable_gdbcli+set}" = set; then + enableval="$enable_gdbcli" + case $enableval in + yes) + ;; + no) + { { echo "$as_me:$LINENO: error: the command-line interface cannot be disabled yet" >&5 + echo "$as_me: error: the command-line interface cannot be disabled yet" >&2;} + { (exit 1); exit 1; }; } ;; + *) + { { echo "$as_me:$LINENO: error: bad value $enableval for --enable-gdbcli" >&5 + echo "$as_me: error: bad value $enableval for --enable-gdbcli" >&2;} + { (exit 1); exit 1; }; } ;; + esac + else + enable_gdbcli=yes + fi; + if test x"$enable_gdbcli" = xyes; then + if test -d $srcdir/cli; then + CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_CLI_OBS)" + CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_CLI_DEPS)" + CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_CLI_SRCS)" + ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_CLI_CFLAGS)" + fi + fi + + # Enable MI. + # Check whether --enable-gdbmi or --disable-gdbmi was given. + if test "${enable_gdbmi+set}" = set; then + enableval="$enable_gdbmi" + case $enableval in + yes | no) + ;; + *) + { { echo "$as_me:$LINENO: error: bad value $enableval for --enable-gdbmi" >&5 + echo "$as_me: error: bad value $enableval for --enable-gdbmi" >&2;} + { (exit 1); exit 1; }; } ;; + esac + else + enable_gdbmi=yes + fi; + if test x"$enable_gdbmi" = xyes; then + if test -d $srcdir/mi; then + CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_MI_OBS)" + CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_MI_DEPS)" + CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_MI_SRCS)" + ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_MI_CFLAGS)" + fi + fi + + # Enable TUI. + # Check whether --enable-tui or --disable-tui was given. + if test "${enable_tui+set}" = set; then + enableval="$enable_tui" + case $enableval in + yes | no) + ;; + *) + { { echo "$as_me:$LINENO: error: bad value $enableval for --enable-tui" >&5 + echo "$as_me: error: bad value $enableval for --enable-tui" >&2;} + { (exit 1); exit 1; }; } ;; + esac + else + enable_tui=yes + fi; + + # Enable gdbtk. + # Check whether --enable-gdbtk or --disable-gdbtk was given. + if test "${enable_gdbtk+set}" = set; then + enableval="$enable_gdbtk" + case $enableval in + yes | no) + ;; + *) + { { echo "$as_me:$LINENO: error: bad value $enableval for --enable-gdbtk" >&5 + echo "$as_me: error: bad value $enableval for --enable-gdbtk" >&2;} + { (exit 1); exit 1; }; } ;; + esac + else + if test -d $srcdir/gdbtk -a -d $srcdir/../itcl; then + enable_gdbtk=yes + else + enable_gdbtk=no + fi + fi; + # We unconditionally disable gdbtk tests on selected platforms. + case $host_os in + go32* | windows*) + { echo "$as_me:$LINENO: WARNING: gdbtk isn't supported on $host; disabling" >&5 + echo "$as_me: WARNING: gdbtk isn't supported on $host; disabling" >&2;} + enable_gdbtk=no ;; + esac + + # Libunwind support. # Check whether --with-libunwind or --without-libunwind was given. if test "${with_libunwind+set}" = set; then Index: gdb/configure.ac =================================================================== RCS file: /cvs/src/src/gdb/configure.ac,v retrieving revision 1.61 diff -c -p -r1.61 configure.ac *** gdb/configure.ac 17 Nov 2007 01:02:01 -0000 1.61 --- gdb/configure.ac 20 Nov 2007 21:44:47 -0000 *************** AC_ARG_ENABLE(targets, *** 101,106 **** --- 101,115 ---- *) enable_targets=$enableval ;; esac]) + # Check whether to enable 64-bit support on 32-bit hosts + AC_ARG_ENABLE(64-bit-bfd, + [ --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes)], + [case "${enableval}" in + yes) want64=true ;; + no) want64=false ;; + *) AC_MSG_ERROR(bad value ${enableval} for 64-bit-bfd option) ;; + esac],[want64=false])dnl + # Provide defaults for some variables set by the per-host and per-target # configuration. gdb_host_obs=posix-hdep.o *************** do *** 142,152 **** ;; esac done fi done if test x${all_targets} = xtrue; then ! TARGET_OBS='$(ALL_TARGET_OBS)' fi AC_SUBST(TARGET_OBS) --- 151,186 ---- ;; esac done + + # Check whether this target needs 64-bit CORE_ADDR + if test x${want64} = xfalse; then + . ${srcdir}/../bfd/config.bfd + fi fi done if test x${all_targets} = xtrue; then ! ! # We want all 64-bit targets if we either: ! # - run on a 64-bit host or ! # - already require 64-bit support for some other target or ! # - the --enable-64-bit-bfd option was supplied ! # Otherwise we only support all 32-bit targets. ! # ! # NOTE: This test must be in sync with the corresponding ! # tests in BFD! ! ! if test x${want64} = xfalse; then ! AC_CHECK_SIZEOF(long) ! if test "x${ac_cv_sizeof_long}" = "x8"; then ! want64=true ! fi ! fi ! if test x${want64} = xtrue; then ! TARGET_OBS='$(ALL_TARGET_OBS) $(ALL_64_TARGET_OBS)' ! else ! TARGET_OBS='$(ALL_TARGET_OBS)' ! fi fi AC_SUBST(TARGET_OBS) Index: gdb/i386-cygwin-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/i386-cygwin-tdep.c,v retrieving revision 1.14 diff -c -p -r1.14 i386-cygwin-tdep.c *** gdb/i386-cygwin-tdep.c 24 Oct 2007 21:16:30 -0000 1.14 --- gdb/i386-cygwin-tdep.c 20 Nov 2007 21:44:47 -0000 *************** i386_cygwin_osabi_sniffer (bfd *abfd) *** 252,260 **** if (strcmp (target_name, "pei-i386") == 0) return GDB_OSABI_CYGWIN; ! /* Cygwin uses elf core dumps. */ if (strcmp (target_name, "elf32-i386") == 0) ! return GDB_OSABI_CYGWIN; return GDB_OSABI_UNKNOWN; } --- 252,266 ---- if (strcmp (target_name, "pei-i386") == 0) return GDB_OSABI_CYGWIN; ! /* Cygwin uses elf core dumps. Do not claim all ELF executables, ! check whether there is a .reg section of proper size. */ if (strcmp (target_name, "elf32-i386") == 0) ! { ! asection *section = bfd_get_section_by_name (abfd, ".reg"); ! if (section ! && bfd_section_size (abfd, section) == I386_WIN32_SIZEOF_GREGSET) ! return GDB_OSABI_CYGWIN; ! } return GDB_OSABI_UNKNOWN; } -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com