bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: test-fenv-* failures on legacy Darwin/powerpc


From: Bruno Haible
Subject: Re: test-fenv-* failures on legacy Darwin/powerpc
Date: Fri, 10 Nov 2023 20:36:51 +0100

> I would guess that the problem is that on PowerPC, enabling these traps
> requires OS support (in order to set the bits FE0 and FE1 of the MSR
> (= Machine State Register), which can only be done through privileged
> instructions), and Mac OS X 10.4 does not provide that support, or
> we don't know how to use it.

Just found that xnu/osfmk/ppc/status.c contains a function
thread_enable_fpe(), and this function gets called from
xnu/bsd/kern/kern_sig.c when a SIGFPE signal handler is installed
(value != SIG_DFL or SIG_IGN).

Can you try to install this handler for SIGFPE?

static void
my_sigfpe_handler (int sig)
{
  signal (SIGFPE, SIG_DFL);
  raise (sig);
}

This would be much easier than a Mach exception handler.

Bruno






reply via email to

[Prev in Thread] Current Thread [Next in Thread]