public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: pkubaj@FreeBSD.org
Cc: gcc-patches@gcc.gnu.org, fortran@gcc.gnu.org
Subject: Re: [PATCH V2] powerpc: properly check for feenableexcept() on FreeBSD
Date: Thu, 12 May 2022 15:16:37 -0500	[thread overview]
Message-ID: <20220512201637.GR25951@gate.crashing.org> (raw)
In-Reply-To: <20220503102111.10406-1-pkubaj@FreeBSD.org>

Hi Piotr,

On Tue, May 03, 2022 at 12:21:12PM +0200, pkubaj@FreeBSD.org wrote:
> FreeBSD/powerpc* has feenableexcept() defined in fenv.h header.

Declared, not defined.  These are required to be real functions (on all
platforms that have these functions), not macros or inlines or whatever.

So what library *does* have these functions?  It would be much neater to
do the similar to the libm test but with that other library.  Just libc,
maybe?

The answer to this will probably also answer Ke Wen's questions, or at
least just point to a good and more general way of solving this :-)

Maybe the AC_CHECK_LIB could just use GCC_CHECK_MATH_FUNC or such?

You also need a changelog entry here.  Something like


2022-05-12  Piotr Kubaj  <pkubaj@FreeBSD.org>

libgfortran/
	* configure.ac (powerpc*-freebsd*): Define HAVE_FEENABLEEXCEPT if
	<fenv.h> declares the feenableexcept function.
	* configure: Regenerate.


> +case x$target in
> +  xpowerpc*-freebsd*)
> +    AC_CACHE_CHECK([for fenv.h and feenableexcept], have_feenableexcept, [
> +      AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
> +        [[ #include <fenv.h>  ]],
> +        [[ feenableexcept(FE_DIVBYZERO | FE_INVALID); ]])],
> +        [ have_feenableexcept="yes" ],
> +        [ have_feenableexcept="no"  ])])

Please get rid of all surplus whitespace here.  Imitate existing tests,
if you need inspiration :-)


Segher

  parent reply	other threads:[~2022-05-12 20:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-03 10:21 pkubaj
2022-05-03 10:33 ` Piotr Kubaj
2022-05-10 23:32   ` Piotr Kubaj
2022-05-12  7:20     ` Kewen.Lin
2022-05-12 20:16 ` Segher Boessenkool [this message]
2022-05-13  2:59   ` Kewen.Lin
2022-05-13 10:34     ` Piotr Kubaj
2022-05-13 12:53       ` Segher Boessenkool
2022-05-14  5:46     ` Piotr Kubaj

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220512201637.GR25951@gate.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=pkubaj@FreeBSD.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).