On Sat, Feb 1, 2020 at 8:38 PM Jeffrey Walton noloader@gmail.com wrote:
... I'm catching a crash with Nettle 3.5.1 on a Core-i7 8700 configured with --enable-x86-aesni and --enable-x86-sha-ni. I verified the compiler supports both AESNI and SHA. ...
Here is the logic I was trying to use. It accommodates both Linux and Solaris.
AESNI_OPT=$("$CC" "$CFLAGS" -dM -E -maes - </dev/null 2>&1 | grep -i -c "__AES__") SHANI_OPT=$("$CC" "$CFLAGS" -dM -E -msha - </dev/null 2>&1 | grep -i -c "__SHA__")
if [[ "$AESNI_OPT" -eq 1 ]]; then echo "Compiler supports AES-NI. Adding --enable-x86-aesni" CONFIG_OPTS+=("--enable-x86-aesni") fi
if [[ "$SHANI_OPT" -eq 1 ]]; then echo "Compiler supports SHA-NI. Adding --enable-x86-sha-ni" CONFIG_OPTS+=("--enable-x86-sha-ni") fi
# Crash on Solaris machines with --enable-fat #if [[ "$IS_IA32" -ne 0 ]]; then # echo "Using runtime algorithm selection. Adding --enable-fat" # CONFIG_OPTS+=("--enable-fat") #fi
This is what is confusing me:
--enable-fat Enable fat library build (default=no) --enable-arm-neon Enable ARM Neon assembly. (default=auto) --enable-x86-aesni Enable x86_64 aes instructions. (default=no) --enable-x86-sha-ni Enable x86_64 sha_ni instructions. (default=no) --enable-mini-gmp Enable mini-gmp, used instead of libgmp.
SHA-NI is off by default. The build system should not be trying to build SHA-NI unless I explicitly enable it.
Jeff