aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-12-04 00:28:14 -0500
committerMike Frysinger <vapier@gentoo.org>2022-01-01 12:49:07 -0500
commit1d5269c994bf4af088b1a9d0ed39825541623a99 (patch)
tree427712dedcd41fc7d1d0e8f837444ec8f6c6c762 /gdb
parent3cc8ed6aaee33355a5d911a7401db3f1b05a2714 (diff)
downloadgdb-1d5269c994bf4af088b1a9d0ed39825541623a99.zip
gdb-1d5269c994bf4af088b1a9d0ed39825541623a99.tar.gz
gdb-1d5269c994bf4af088b1a9d0ed39825541623a99.tar.bz2
unify 64-bit bfd checks
Move the 64-bit bfd logic out of bfd/configure.ac and into bfd64.m4 under config so it can be shared between all the other subdirs. This replaces want64 with enable_64_bit_bfd which was already being declared, but not used directly.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/aclocal.m41
-rw-r--r--gdb/config.in6
-rwxr-xr-xgdb/configure123
-rw-r--r--gdb/configure.ac29
4 files changed, 74 insertions, 85 deletions
diff --git a/gdb/aclocal.m4 b/gdb/aclocal.m4
index 8c75625..3ed4a58 100644
--- a/gdb/aclocal.m4
+++ b/gdb/aclocal.m4
@@ -201,6 +201,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
m4_include([../config/acx.m4])
m4_include([../config/ax_pthread.m4])
+m4_include([../config/bfd64.m4])
m4_include([../config/debuginfod.m4])
m4_include([../config/depstand.m4])
m4_include([../config/enable.m4])
diff --git a/gdb/config.in b/gdb/config.in
index 4b8f1f7..cd9f252 100644
--- a/gdb/config.in
+++ b/gdb/config.in
@@ -685,9 +685,6 @@
/* Define to 1 if the `setpgrp' function takes no argument. */
#undef SETPGRP_VOID
-/* The size of `long', as computed by sizeof. */
-#undef SIZEOF_LONG
-
/* The size of `long long', as computed by sizeof. */
#undef SIZEOF_LONG_LONG
@@ -700,6 +697,9 @@
/* The size of `unsigned __int128', as computed by sizeof. */
#undef SIZEOF_UNSIGNED___INT128
+/* The size of `void *', as computed by sizeof. */
+#undef SIZEOF_VOID_P
+
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at runtime.
diff --git a/gdb/configure b/gdb/configure
index d13ab37..429eaeb 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -772,6 +772,8 @@ PKG_CONFIG_PATH
PKG_CONFIG
HAVE_NATIVE_GCORE_TARGET
TARGET_OBS
+ENABLE_BFD_64_BIT_FALSE
+ENABLE_BFD_64_BIT_TRUE
subdirs
GDB_DATADIR
DEBUGDIR
@@ -6649,17 +6651,70 @@ esac
fi
-# Check whether to enable 64-bit support on 32-bit hosts
# Check whether --enable-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 ;;
- *) as_fn_error $? "bad value ${enableval} for 64-bit-bfd option" "$LINENO" 5 ;;
+ enableval=$enable_64_bit_bfd; case $enableval in #(
+ yes|no) :
+ ;; #(
+ *) :
+ as_fn_error $? "bad value ${enableval} for 64-bit-bfd option" "$LINENO" 5 ;; #(
+ *) :
+ ;;
esac
else
- want64=false
+ enable_64_bit_bfd=no
+fi
+
+
+if test "x$enable_64_bit_bfd" = "xno"; then :
+ # The cast to long int 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.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5
+$as_echo_n "checking size of void *... " >&6; }
+if ${ac_cv_sizeof_void_p+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_void_p" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (void *)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_void_p=0
+ fi
+fi
+
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5
+$as_echo "$ac_cv_sizeof_void_p" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_VOID_P $ac_cv_sizeof_void_p
+_ACEOF
+
+
+ if test "x$ac_cv_sizeof_void_p" = "x8"; then :
+ enable_64_bit_bfd=yes
+fi
+
+fi
+
+ if test "x$enable_64_bit_bfd" = "xyes"; then
+ ENABLE_BFD_64_BIT_TRUE=
+ ENABLE_BFD_64_BIT_FALSE='#'
+else
+ ENABLE_BFD_64_BIT_TRUE='#'
+ ENABLE_BFD_64_BIT_FALSE=
+fi
+
+
# Provide defaults for some variables set by the per-host and per-target
# configuration.
@@ -6709,7 +6764,7 @@ fi
done
# Check whether this target needs 64-bit CORE_ADDR
- if test x${want64} = xfalse; then
+ if test x${enable_64_bit_bfd} = xno; then
. ${srcdir}/../bfd/config.bfd
fi
@@ -6722,55 +6777,7 @@ 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
- # The cast to long int 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.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5
-$as_echo_n "checking size of long... " >&6; }
-if ${ac_cv_sizeof_long+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then :
-
-else
- if test "$ac_cv_type_long" = yes; then
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (long)
-See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_long=0
- fi
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5
-$as_echo "$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
+ if test x${enable_64_bit_bfd} = xyes; then
TARGET_OBS='$(ALL_TARGET_OBS) $(ALL_64_TARGET_OBS)'
else
TARGET_OBS='$(ALL_TARGET_OBS)'
@@ -20126,6 +20133,10 @@ if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${ENABLE_BFD_64_BIT_TRUE}" && test -z "${ENABLE_BFD_64_BIT_FALSE}"; then
+ as_fn_error $? "conditional \"ENABLE_BFD_64_BIT\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${HAVE_PYTHON_TRUE}" && test -z "${HAVE_PYTHON_FALSE}"; then
as_fn_error $? "conditional \"HAVE_PYTHON\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/gdb/configure.ac b/gdb/configure.ac
index bee78d7..13e880d 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -165,14 +165,7 @@ AS_HELP_STRING([--enable-targets=TARGETS], [alternative target configurations]),
*) enable_targets=$enableval ;;
esac])
-# Check whether to enable 64-bit support on 32-bit hosts
-AC_ARG_ENABLE(64-bit-bfd,
-AS_HELP_STRING([--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
+BFD_64_BIT
# Provide defaults for some variables set by the per-host and per-target
# configuration.
@@ -221,7 +214,7 @@ do
done
# Check whether this target needs 64-bit CORE_ADDR
- if test x${want64} = xfalse; then
+ if test x${enable_64_bit_bfd} = xno; then
. ${srcdir}/../bfd/config.bfd
fi
@@ -234,23 +227,7 @@ do
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
+ if test x${enable_64_bit_bfd} = xyes; then
TARGET_OBS='$(ALL_TARGET_OBS) $(ALL_64_TARGET_OBS)'
else
TARGET_OBS='$(ALL_TARGET_OBS)'