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:
parent
fd3f05d215
commit
8f3a0ea69f
1
sshaes.c
1
sshaes.c
@ -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 */
|
||||
|
||||
|
@ -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 */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user