mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-09 09:27:59 +00:00
Fix build with GCC4.x.
Since the rewrite of hardware SHA support in cbbd464fd7
, we've been
attempting to build with SHA-NI support on x86 with some GCC 4.x,
including Ubuntu 14.04's 4.8.x, whereas before we only tried it with
GCC 5.x and above. Revert to that.
(I think that GCC has had some support for this extension since 4.9.0 --
the "sha" attribute went in in upstream commit fc975a4090 -- and it
at least compiles with 4.9.2, but I'm assuming Pavel had a good reason
for sticking to 5+ in 5a38b293bd.)
This commit is contained in:
parent
68c47ac470
commit
93a5b56439
10
sshsh256.c
10
sshsh256.c
@ -22,8 +22,7 @@
|
||||
# define HW_SHA256 HW_SHA256_NI
|
||||
# endif
|
||||
#elif defined(__GNUC__)
|
||||
# if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) && \
|
||||
(defined(__x86_64__) || defined(__i386))
|
||||
# if (__GNUC__ >= 5) && (defined(__x86_64__) || defined(__i386))
|
||||
# define HW_SHA256 HW_SHA256_NI
|
||||
# endif
|
||||
#elif defined (_MSC_VER)
|
||||
@ -339,13 +338,12 @@ const ssh_hashalg ssh_sha256_sw = {
|
||||
/*
|
||||
* Set target architecture for Clang and GCC
|
||||
*/
|
||||
#if !defined(__clang__) && defined(__GNUC__)
|
||||
#if defined(__clang__) || defined(__GNUC__)
|
||||
# define FUNC_ISA __attribute__ ((target("sse4.1,sha")))
|
||||
#if !defined(__clang__)
|
||||
# pragma GCC target("sha")
|
||||
# pragma GCC target("sse4.1")
|
||||
#endif
|
||||
|
||||
#if defined(__clang__) || (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)))
|
||||
# define FUNC_ISA __attribute__ ((target("sse4.1,sha")))
|
||||
#else
|
||||
# define FUNC_ISA
|
||||
#endif
|
||||
|
11
sshsha.c
11
sshsha.c
@ -22,8 +22,7 @@
|
||||
# define HW_SHA1 HW_SHA1_NI
|
||||
# endif
|
||||
#elif defined(__GNUC__)
|
||||
# if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) && \
|
||||
(defined(__x86_64__) || defined(__i386))
|
||||
# if (__GNUC__ >= 5) && (defined(__x86_64__) || defined(__i386))
|
||||
# define HW_SHA1 HW_SHA1_NI
|
||||
# endif
|
||||
#elif defined (_MSC_VER)
|
||||
@ -322,13 +321,13 @@ const ssh_hashalg ssh_sha1_sw = {
|
||||
/*
|
||||
* Set target architecture for Clang and GCC
|
||||
*/
|
||||
#if !defined(__clang__) && defined(__GNUC__)
|
||||
|
||||
#if defined(__clang__) || defined(__GNUC__)
|
||||
# define FUNC_ISA __attribute__ ((target("sse4.1,sha")))
|
||||
#if !defined(__clang__)
|
||||
# pragma GCC target("sha")
|
||||
# pragma GCC target("sse4.1")
|
||||
#endif
|
||||
|
||||
#if defined(__clang__) || (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)))
|
||||
# define FUNC_ISA __attribute__ ((target("sse4.1,sha")))
|
||||
#else
|
||||
# define FUNC_ISA
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user