This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [GDB] Use AC_CHECK_SIZEOF to test for PRFPREGSET_T_BROKEN
- From: Andreas Schwab <schwab at suse dot de>
- To: Matthew Wahab <matthew dot wahab at foss dot arm dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 28 Sep 2016 10:38:49 +0200
- Subject: Re: [GDB] Use AC_CHECK_SIZEOF to test for PRFPREGSET_T_BROKEN
- Authentication-results: sourceware.org; auth=none
- References: <57EB70F9.6050808@foss.arm.com>
On Sep 28 2016, Matthew Wahab <matthew.wahab@foss.arm.com> wrote:
> diff --git a/gdb/configure.ac b/gdb/configure.ac
> index e451e60..b162d87 100644
> --- a/gdb/configure.ac
> +++ b/gdb/configure.ac
> @@ -1573,21 +1573,14 @@ if test "$ac_cv_header_sys_procfs_h" = yes; then
>
> if test $bfd_cv_have_sys_procfs_type_prfpregset_t = yes; then
> AC_MSG_CHECKING(whether prfpregset_t type is broken)
> - AC_CACHE_VAL(gdb_cv_prfpregset_t_broken,
> - [AC_TRY_RUN([#include <sys/procfs.h>
> - int main ()
> - {
> - if (sizeof (prfpregset_t) == sizeof (void *))
> - return 1;
> - return 0;
> - }],
> - gdb_cv_prfpregset_t_broken=no,
> - gdb_cv_prfpregset_t_broken=yes,
> - gdb_cv_prfpregset_t_broken=yes)])
> - AC_MSG_RESULT($gdb_cv_prfpregset_t_broken)
> - if test $gdb_cv_prfpregset_t_broken = yes; then
> + AC_CHECK_SIZEOF(prfpregset_t, [], [ #include <sys/procfs.h> ])
> + AC_CHECK_SIZEOF(void *)
> + if test "${ac_cv_sizeof_prfpregset_t}" = "${ac_cv_sizeof_void_p}"; then
> + AC_MSG_RESULT(yes)
> AC_DEFINE(PRFPREGSET_T_BROKEN, 1,
> [Define if the prfpregset_t type is broken.])
> + else
> + AC_MSG_RESULT(no)
This mangles the configure output. The output of the AC_CHECK_SIZEOF
checks occurs in the middle of the output of the prfpregset_t check.
You should not nest configure checks.
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."