From 599bab84a1019ccd6228dcc5a8bf8b9a33a96452 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Wed, 20 Dec 2017 10:12:28 +0000 Subject: [PATCH] Condition out AES-NI support if using a too-old clang. A clang too old to have __attribute__((target)) will not manage to compile the clang-style hardware-accelerated functions, so it shouldn't try. --- sshaes.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sshaes.c b/sshaes.c index 7ebeb5be..50879913 100644 --- a/sshaes.c +++ b/sshaes.c @@ -1151,6 +1151,14 @@ const struct ssh2_ciphers ssh2_aes = { # undef COMPILER_SUPPORTS_AES_NI #endif +#if defined(__clang__) +# if !__has_attribute(target) +/* If clang is old enough not to support __attribute__((target(...))) + * as used below, then we can't use this code after all. */ +# undef COMPILER_SUPPORTS_AES_NI +# endif +#endif + #ifdef COMPILER_SUPPORTS_AES_NI /*