On Thu, Apr 5, 2018 at 12:00 AM, Thomas Munro
<thomas.mu...@enterprisedb.com> wrote:
> ... trying to figure out how to detect the instruction portably using SIGILL 
> ...

Ahh, OpenSSL's armcap.c shows how to do this.  You need to
siglongjmp() out of there.  Here's a patch that does it that way.
Isn't this better?

I tested this on a Linux ARM system that has the instruction, and I
put a kill(getpid(), SIGILL) in there to test the negative case
because I don't have access to an ARM system without the instruction.
I don't have a FreeBSD/ARM system to test on either but I checked that
the flow control technique works fine on FreeBSD on another
architecture when it hits an instruction it doesn't support.

-- 
Thomas Munro
http://www.enterprisedb.com

Attachment: 0001-Use-a-portable-way-to-detect-ARMv8-CRC32-hardware.patch
Description: Binary data

Reply via email to