1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00

Fix Arm crypto build failure on clang post-12.

I had manually defined the ACLE feature macro __ARM_FEATURE_CRYPTO
before including arm_neon.h, in the expectation that it would turn on
the AES, SHA-1 and SHA-256 intrinsics. But up-to-date clang has now
separated those intrinsics from each other, and guarded them by two
more specific feature macros, one for AES and one for the two SHAs. So
just defining __ARM_FEATURE_CRYPTO isn't good enough any more, and my
attempts to use crypto intrinsics in the following functions provoke a
compile error.

The fix is to define the appropriate new feature macro by hand
(leaving the old definition in place for earlier clang versions).

This fix is only needed on the release branch, of course: on main,
we've already done the reorganisation that avoids the need to manually
define ACLE feature macros at all, because the accelerated crypto code
is compiled in separate objects using command-line compile flags in
the way that the toolchain normally expects.
This commit is contained in:
Simon Tatham 2021-06-12 14:03:27 +01:00
parent fd3f05d215
commit 8f3a0ea69f
3 changed files with 3 additions and 0 deletions

View File

@ -1580,6 +1580,7 @@ NI_ENC_DEC(256)
*/
#define __ARM_NEON 1
#define __ARM_FEATURE_CRYPTO 1
#define __ARM_FEATURE_AES 1
#define FUNC_ISA __attribute__ ((target("neon,crypto")))
#endif /* USE_CLANG_ATTR_TARGET_AARCH64 */

View File

@ -723,6 +723,7 @@ const ssh_hashalg ssh_sha256_hw = {
*/
#define __ARM_NEON 1
#define __ARM_FEATURE_CRYPTO 1
#define __ARM_FEATURE_SHA2 1
#define FUNC_ISA __attribute__ ((target("neon,crypto")))
#endif /* USE_CLANG_ATTR_TARGET_AARCH64 */

View File

@ -690,6 +690,7 @@ const ssh_hashalg ssh_sha1_hw = {
*/
#define __ARM_NEON 1
#define __ARM_FEATURE_CRYPTO 1
#define __ARM_FEATURE_SHA2 1
#define FUNC_ISA __attribute__ ((target("neon,crypto")))
#endif /* USE_CLANG_ATTR_TARGET_AARCH64 */