From c7c1f26676dc467e261b70fb85db4ea550f5bcc8 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Mon, 19 Apr 2021 13:58:29 -0400 Subject: Move GCC target attribute into config_misc.h --- config_misc.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'config_misc.h') diff --git a/config_misc.h b/config_misc.h index 67b2d4ab..1f083ab9 100644 --- a/config_misc.h +++ b/config_misc.h @@ -191,4 +191,19 @@ # pragma GCC diagnostic ignored "-Wunused-function" #endif +// Should work for Clang 7 and above: https://stackoverflow.com/q/39958935. +// But Clang 10 is broke: https://bugs.llvm.org/show_bug.cgi?id=50025. +#if defined(__i386__) || defined(__i686__) || defined(__amd64__) +# if (CRYPTOPP_GCC_VERSION >= 40800) +# include +# define CRYPTOPP_HAVE_ATTRIBUTE_TARGET 1 +# define CRYPTOPP_TARGET_DEFAULT __attribute__ ((target ("default"))) +# define CRYPTOPP_TARGET_SSSE3 __attribute__ ((target ("ssse3"))) +# endif +#endif + +#ifndef CRYPTOPP_TARGET_DEFAULT +# define CRYPTOPP_TARGET_DEFAULT +#endif + #endif // CRYPTOPP_CONFIG_MISC_H -- cgit v1.2.1