X-Git-Url: https://bearssl.org/gitweb//home/git/?p=BearSSL;a=blobdiff_plain;f=src%2Finner.h;h=fb49d0ef99d73b91d3d036b9fd5acc865eefe4a4;hp=52bcaf087b302c6f5b209e231225b824b7161966;hb=8e94ad2fcb11794c559025277e56f3fbeb676f5d;hpb=af9c79a0710a45361f9ae4313f8bb5bf738c3b7a;ds=sidebyside diff --git a/src/inner.h b/src/inner.h index 52bcaf0..fb49d0e 100644 --- a/src/inner.h +++ b/src/inner.h @@ -2243,18 +2243,25 @@ int br_ssl_choose_hash(unsigned bf); */ #if BR_i386 || BR_amd64 +/* + * On GCC before version 5.0, we need to use the pragma to enable the + * target options globally, because the 'target' function attribute + * appears to be unreliable. Before 4.6 we must also avoid the + * push_options / pop_options mechanism, because it tends to trigger + * some internal compiler errors. + */ #if BR_GCC && !BR_GCC_5_0 #if BR_GCC_4_6 #define BR_TARGETS_X86_UP \ _Pragma("GCC push_options") \ _Pragma("GCC target(\"sse2,ssse3,sse4.1,aes,pclmul,rdrnd\")") +#define BR_TARGETS_X86_DOWN \ + _Pragma("GCC pop_options") #else #define BR_TARGETS_X86_UP \ - _Pragma("GCC push_options") \ _Pragma("GCC target(\"sse2,ssse3,sse4.1,aes,pclmul\")") #endif -#define BR_TARGETS_X86_DOWN \ - _Pragma("GCC pop_options") +#define BR_TARGETS_X86_DOWN #pragma GCC diagnostic ignored "-Wpsabi" #endif @@ -2286,7 +2293,7 @@ int br_ssl_choose_hash(unsigned bf); BR_TARGETS_X86_UP #include #include -#define bswap32 __builtin_bswap32 +#define br_bswap32 __builtin_bswap32 BR_TARGETS_X86_DOWN #endif @@ -2294,7 +2301,7 @@ BR_TARGETS_X86_DOWN #include #include #include -#define bswap32 _byteswap_ulong +#define br_bswap32 _byteswap_ulong #endif static inline int