Altivec support requires >= P7
Originally reported downstream in Gentoo at https://bugs.gentoo.org/920234.
We pass --enable-power-altivec if the user specifies they have altivec, but nettle's "altivec" asm requires P7:
*powerpc64*)
if test "$ABI" = 64 ; then
GMP_ASM_POWERPC_R_REGISTERS
asm_path="powerpc64"
if test "x$enable_fat" = xyes ; then
asm_path="powerpc64/fat $asm_path"
OPT_NETTLE_SOURCES="fat-ppc.c $OPT_NETTLE_SOURCES"
FAT_TEST_LIST="none crypto_ext altivec power9"
else
if test "$enable_power9" = yes ; then
asm_path="powerpc64/p9 $asm_path"
fi
if test "$enable_power_crypto_ext" = yes ; then
asm_path="powerpc64/p8 $asm_path"
fi
if test "$enable_power_altivec" = yes ; then
asm_path="powerpc64/p7 $asm_path"
fi
fi
fi
;;
This leads to illegal instruction errors on a PowerMac G5.
Could the check be made to check if __VSX__ is defined (=> at least P7) and otherwise fallback to no-asm? Thanks.
Edited by Sam James