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]

ping/FYI: [patch] Require long long for GDB


Hi,

there was a discussion that GDB already requires "long long" but the codebase
in some cases still handles [!CC_HAS_LONG_LONG].

I will check it in, originally posted as:
	[patch] Require long long for GDB [Re: [patch] Compilation regression on older gcc + 32-bit host]
	Message-ID: <20120531154019.GA16401@host2.jankratochvil.net>
	http://sourceware.org/ml/gdb-patches/2012-05/msg01094.html


Jan


gdb/
2012-05-31  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* 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  <jan.kratochvil@redhat.com>

	* gdbint.texinfo (Host Definition): Remove CC_HAS_LONG_LONG.

diff --git a/gdb/config.in b/gdb/config.in
index b54d245..9e21325 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 e34229b..fdfd17c 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -11602,10 +11602,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.
diff --git a/gdb/configure.ac b/gdb/configure.ac
index 2bfbe73..db52804 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -1556,9 +1556,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 5e8a681..369ee7a 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -125,20 +125,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/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo
index 34b0bec..5dbf7bf 100644
--- a/gdb/doc/gdbint.texinfo
+++ b/gdb/doc/gdbint.texinfo
@@ -2761,11 +2761,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
diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c
index dcfbeb7..5662cc2 100644
--- a/gdb/dwarf2-frame.c
+++ b/gdb/dwarf2-frame.c
@@ -1805,11 +1805,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 143bd0e..25b14e1 100644
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -2221,7 +2221,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]);
 
@@ -2356,7 +2356,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]);
@@ -2391,7 +2391,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';


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