Index: crypto/external/bsd/openssl/dist/crypto/ppccap.c =================================================================== RCS file: /home/netbsd/src/crypto/external/bsd/openssl/dist/crypto/ppccap.c,v retrieving revision 1.15 diff -p -u -r1.15 ppccap.c --- crypto/external/bsd/openssl/dist/crypto/ppccap.c 22 Jun 2020 16:25:08 -0000 1.15 +++ crypto/external/bsd/openssl/dist/crypto/ppccap.c 27 Jun 2020 10:35:04 -0000 @@ -26,6 +26,10 @@ # include # include #endif +#if defined(__NetBSD__) +# include +# include +#endif #include #include #include @@ -365,6 +369,17 @@ void OPENSSL_cpuid_setup(void) sigaction(SIGILL, &ill_act, &ill_oact); #ifndef OSSL_IMPLEMENT_GETAUXVAL +# ifdef __NetBSD__ + int error, val; + size_t len = sizeof(val); + + /* + * If machdep.fpu_present == 0, FPU is absent and emulated by software. + * Avoid using it, which results in incorrect results. + */ + error = sysctlbyname("machdep.fpu_present", &val, &len, NULL, 0); + if (error != 0 || (error == 0 && val != 0)) +# endif if (sigsetjmp(ill_jmp,1) == 0) { OPENSSL_fpu_probe(); OPENSSL_ppccap_P |= PPC_FPU;