Guard use of SIGILL probes on Apple platforms

pull/462/head
Jeffrey Walton 2017-08-17 18:06:57 -04:00
parent 82456515c5
commit 51fe8a7776
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
4 changed files with 25 additions and 0 deletions

View File

@ -75,6 +75,11 @@ bool CPU_ProbeCRC32()
return result;
#else
# if defined(__APPLE__)
// No SIGILL probes on Apple platforms.
return false;
# endif
// longjmp and clobber warnings. Volatile is required.
// http://github.com/weidai11/cryptopp/issues/24 and http://stackoverflow.com/q/7721854
volatile bool result = true;

View File

@ -221,6 +221,11 @@ bool CPU_ProbePMULL()
return result;
# else
# if defined(__APPLE__)
// No SIGILL probes on Apple platforms. Plus, Apple Clang does not have PMULL intrinsics.
return false;
# endif
// longjmp and clobber warnings. Volatile is required.
// http://github.com/weidai11/cryptopp/issues/24 and http://stackoverflow.com/q/7721854
volatile bool result = true;

View File

@ -98,6 +98,11 @@ bool CPU_ProbeAES()
return result;
# else
# if defined(__APPLE__)
// No SIGILL probes on Apple platforms.
return false;
# endif
// longjmp and clobber warnings. Volatile is required.
// http://github.com/weidai11/cryptopp/issues/24 and http://stackoverflow.com/q/7721854
volatile bool result = true;

View File

@ -84,6 +84,11 @@ bool CPU_ProbeSHA1()
return result;
# else
# if defined(__APPLE__)
// No SIGILL probes on Apple platforms.
return false;
# endif
// longjmp and clobber warnings. Volatile is required.
// http://github.com/weidai11/cryptopp/issues/24 and http://stackoverflow.com/q/7721854
volatile bool result = true;
@ -143,6 +148,11 @@ bool CPU_ProbeSHA2()
return result;
#else
# if defined(__APPLE__)
// No SIGILL probes on Apple platforms.
return false;
# endif
// longjmp and clobber warnings. Volatile is required.
// http://github.com/weidai11/cryptopp/issues/24 and http://stackoverflow.com/q/7721854
volatile bool result = true;