From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13172 invoked by alias); 31 May 2012 15:40:55 -0000 Received: (qmail 13163 invoked by uid 22791); 31 May 2012 15:40:53 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 31 May 2012 15:40:40 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q4VFePTg016607 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 31 May 2012 11:40:26 -0400 Received: from host2.jankratochvil.net (ovpn-116-47.ams2.redhat.com [10.36.116.47]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q4VFeKZf032048 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 31 May 2012 11:40:22 -0400 Date: Thu, 31 May 2012 15:40:00 -0000 From: Jan Kratochvil To: Pedro Alves Cc: Jeff Kenton , Joel Brobecker , gdb-patches@sourceware.org Subject: [patch] Require long long for GDB [Re: [patch] Compilation regression on older gcc + 32-bit host] Message-ID: <20120531154019.GA16401@host2.jankratochvil.net> References: <4FAD39A1.1000209@tilera.com> <20120514162046.GI10253@adacore.com> <4FBA4FD2.9090108@tilera.com> <4FBD1F67.9090609@redhat.com> <4FBE8B5E.6050800@tilera.com> <4FBFA26F.20002@redhat.com> <4FC4EA20.1040201@tilera.com> <4FC67B1C.6040700@redhat.com> <20120531085250.GA31740@host2.jankratochvil.net> <4FC74240.2070706@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4FC74240.2070706@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes 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: 2012-05/txt/msg01094.txt.bz2 On Thu, 31 May 2012 12:04:48 +0200, Pedro Alves wrote: > Not quite. bfd's only use of "long long" in common code is guarded by HAVE_STRTOULL. > I can't find any unconditional long long use in the whole of binutils. opcodes > uses long long in many ports, but then there are many ports that don't use it. It's native > toolchains on those ports that could be problematic (old hosts with old, non-gcc compilers). > (People on such hosts wouldn't be using "--enable-targets=all", nor building cross toolchains). OK, thanks for the analysis. > In any case, for gdb, I think it's now safe to assume that long long is available > on all supported hosts. + > and this means we're assuming the "#define LONGEST long" > is never reached nowaways, or that if it does, long is 64-bit. OK, so I will check in this patch. > It'd be super fine with the below as well, and it might even be better (stop > the non-fixed-sized types insanity). You should then change tramp_frame > to use uint64_t instead of ULONGEST, though. And ULL afterwards. Thanks, Jan gdb/ 2012-05-31 Jan Kratochvil * configure.ac (CC_HAS_LONG_LONG): Replace by AC_MSG_ERROR. * defs.h (LONGEST, ULONGEST): Remove conditionalization for CC_HAS_LONG_LONG. * dwarf2-frame.c (DW64_CIE_ID): Likewise. * printcmd.c (ui_printf): Remove conditionalizations for CC_HAS_LONG_LONG. * config.in: Regenerate. * configure: Regenerate. gdb/doc/ 2012-05-31 Jan Kratochvil * gdbint.texinfo (Host Definition): Remove CC_HAS_LONG_LONG. diff --git a/gdb/configure.ac b/gdb/configure.ac index d7409d0..dbf8dc0 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -1487,9 +1487,9 @@ AC_CACHE_CHECK([for long long support in compiler], gdb_cv_c_long_long, [[switch (foo & 2) { case 0: return 1; }]])], gdb_cv_c_long_long=yes, gdb_cv_c_long_long=no)]) -if test $gdb_cv_c_long_long = yes; then - AC_DEFINE(CC_HAS_LONG_LONG, 1, - [Define to 1 if the compiler supports long long.]) +if test $gdb_cv_c_long_long != yes; then + # libdecnumber requires long long. + AC_MSG_ERROR([Compiler must support long long for GDB.]) fi # Check if the compiler and runtime support printing long longs. diff --git a/gdb/defs.h b/gdb/defs.h index 03092aa..60b738e 100644 --- a/gdb/defs.h +++ b/gdb/defs.h @@ -120,20 +120,8 @@ typedef bfd_vma CORE_ADDR; #else /* No BFD64 */ -#ifdef CC_HAS_LONG_LONG #define LONGEST long long #define ULONGEST unsigned long long -#else -#ifdef BFD_HOST_64_BIT -/* BFD_HOST_64_BIT is defined for some hosts that don't have long long - (e.g. i386-windows) so try it. */ -#define LONGEST BFD_HOST_64_BIT -#define ULONGEST BFD_HOST_U_64_BIT -#else -#define LONGEST long -#define ULONGEST unsigned long -#endif -#endif #endif /* No BFD64 */ diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c index 01786ef..a99ef1e 100644 --- a/gdb/dwarf2-frame.c +++ b/gdb/dwarf2-frame.c @@ -1790,11 +1790,7 @@ add_fde (struct dwarf2_fde_table *fde_table, struct dwarf2_fde *fde) fde_table->entries[fde_table->num_entries - 1] = fde; } -#ifdef CC_HAS_LONG_LONG #define DW64_CIE_ID 0xffffffffffffffffULL -#else -#define DW64_CIE_ID ~0 -#endif /* Defines the type of eh_frames that are expected to be decoded: CIE, FDE or any of them. */ diff --git a/gdb/printcmd.c b/gdb/printcmd.c index 030a4f2..8fee2cb 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -2499,7 +2499,7 @@ ui_printf (char *arg, struct ui_file *stream) error (_("long double not supported in printf")); #endif case long_long_arg: -#if defined (CC_HAS_LONG_LONG) && defined (PRINTF_HAS_LONG_LONG) +#ifdef PRINTF_HAS_LONG_LONG { long long val = value_as_long (val_args[i]); @@ -2635,7 +2635,7 @@ ui_printf (char *arg, struct ui_file *stream) handle %p as glibc would: %#x or a literal "(nil)". */ char *p, *fmt, *fmt_p; -#if defined (CC_HAS_LONG_LONG) && defined (PRINTF_HAS_LONG_LONG) +#ifdef PRINTF_HAS_LONG_LONG long long val = value_as_long (val_args[i]); #else long val = value_as_long (val_args[i]); @@ -2670,7 +2670,7 @@ ui_printf (char *arg, struct ui_file *stream) gdb_assert (*p == 'p' && *(p + 1) == '\0'); if (val != 0) { -#if defined (CC_HAS_LONG_LONG) && defined (PRINTF_HAS_LONG_LONG) +#ifdef PRINTF_HAS_LONG_LONG *fmt_p++ = 'l'; #endif *fmt_p++ = 'l'; diff --git a/gdb/config.in b/gdb/config.in index a3bd8dd..b29a1d9 100644 --- a/gdb/config.in +++ b/gdb/config.in @@ -12,9 +12,6 @@ /* Directory of programs. */ #undef BINDIR -/* Define to 1 if the compiler supports long long. */ -#undef CC_HAS_LONG_LONG - /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP systems. This function is required for `alloca.c' support on those systems. */ diff --git a/gdb/configure b/gdb/configure index f638268..6f31786 100755 --- a/gdb/configure +++ b/gdb/configure @@ -11494,10 +11494,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_c_long_long" >&5 $as_echo "$gdb_cv_c_long_long" >&6; } -if test $gdb_cv_c_long_long = yes; then - -$as_echo "#define CC_HAS_LONG_LONG 1" >>confdefs.h - +if test $gdb_cv_c_long_long != yes; then + # libdecnumber requires long long. + as_fn_error "Compiler must support long long for GDB." "$LINENO" 5 fi # Check if the compiler and runtime support printing long longs. @@ -12805,7 +12804,7 @@ $as_echo "could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6; } elif test "`uname -s`" = "Darwin"; then # If Tcl was built as a framework, attempt to use the libraries # from the framework at the given location so that linking works - # against Tcl.framework installed in an arbitary location. + # against Tcl.framework installed in an arbitrary location. case ${TCL_DEFS} in *TCL_FRAMEWORK*) if test -f "${TCL_BIN_DIR}/${TCL_LIB_FILE}"; then @@ -12920,7 +12919,7 @@ $as_echo "could not find ${TK_BIN_DIR}/tkConfig.sh" >&6; } elif test "`uname -s`" = "Darwin"; then # If Tk was built as a framework, attempt to use the libraries # from the framework at the given location so that linking works - # against Tk.framework installed in an arbitary location. + # against Tk.framework installed in an arbitrary location. case ${TK_DEFS} in *TK_FRAMEWORK*) if test -f "${TK_BIN_DIR}/${TK_LIB_FILE}"; then diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo index 267a6eb..3b9d8ed 100644 --- a/gdb/doc/gdbint.texinfo +++ b/gdb/doc/gdbint.texinfo @@ -2770,11 +2770,6 @@ Substitute for isatty, if not available. @item FOPEN_RB Define this if binary files are opened the same way as text files. -@item CC_HAS_LONG_LONG -@cindex @code{long long} data type -Define this if the host C compiler supports @code{long long}. This is set -by the @code{configure} script. - @item PRINTF_HAS_LONG_LONG Define this if the host can handle printing of long long integers via the printf format conversion specifier @code{ll}. This is set by the