diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py old mode 100644 new mode 100755 index f5ca9284517e0..6279dcd3e04d3 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -83,6 +83,10 @@ def _strip_options_requirements(self): def _required_boost_components(self): return ["context", "filesystem", "program_options", "regex", "system", "thread"] + # Freeze max. CMake version at 3.16.2 to fix the Linux build + def build_requirements(self): + self.build_requires("cmake/3.16.2") + def requirements(self): self.requires("boost/1.74.0") self.requires("bzip2/1.0.8") @@ -91,7 +95,7 @@ def requirements(self): self.requires("glog/0.4.0") self.requires("libevent/2.1.12") self.requires("lz4/1.9.2") - self.requires("openssl/1.1.1h") + self.requires("openssl/1.1.1i") self.requires("snappy/1.1.8") self.requires("zlib/1.2.11") self.requires("zstd/1.4.5") diff --git a/recipes/folly/all/patches/0007-allow-builtins.patch b/recipes/folly/all/patches/0007-allow-builtins.patch index 7ba7a61fbd217..de09722f02acc 100644 --- a/recipes/folly/all/patches/0007-allow-builtins.patch +++ b/recipes/folly/all/patches/0007-allow-builtins.patch @@ -1,13 +1,128 @@ diff --git a/folly/portability/Builtins.h b/folly/portability/Builtins.h -index 971cb88..102fda1 100644 +index 971cb8819..e68de4456 100644 --- a/folly/portability/Builtins.h +++ b/folly/portability/Builtins.h -@@ -41,7 +41,7 @@ FOLLY_ALWAYS_INLINE void __builtin___clear_cache(char* begin, char* end) { +@@ -41,7 +41,6 @@ FOLLY_ALWAYS_INLINE void __builtin___clear_cache(char* begin, char* end) { } } -#if !defined(_MSC_VER) || (_MSC_VER < 1923) -+#if !defined(_MSC_VER) || (_MSC_VER < 1930) FOLLY_ALWAYS_INLINE int __builtin_clz(unsigned int x) { unsigned long index; return int(_BitScanReverse(&index, (unsigned long)x) ? 31 - index : 32); +@@ -93,7 +92,6 @@ FOLLY_ALWAYS_INLINE int __builtin_ctzll(unsigned long long x) { + return int(_BitScanForward64(&index, x) ? index : 64); + } + #endif +-#endif // !defined(_MSC_VER) || (_MSC_VER < 1923) + + FOLLY_ALWAYS_INLINE int __builtin_ffs(int x) { + unsigned long index; +@@ -119,15 +117,12 @@ FOLLY_ALWAYS_INLINE int __builtin_popcount(unsigned int x) { + return int(__popcnt(x)); + } + +-#if !defined(_MSC_VER) || (_MSC_VER < 1923) + FOLLY_ALWAYS_INLINE int __builtin_popcountl(unsigned long x) { + static_assert(sizeof(x) == 4, ""); + return int(__popcnt(x)); + } +-#endif // !defined(_MSC_VER) || (_MSC_VER < 1923) + #endif + +-#if !defined(_MSC_VER) || (_MSC_VER < 1923) + #if defined(_M_IX86) + FOLLY_ALWAYS_INLINE int __builtin_popcountll(unsigned long long x) { + return int(__popcnt((unsigned int)(x >> 32))) + +@@ -138,7 +133,6 @@ FOLLY_ALWAYS_INLINE int __builtin_popcountll(unsigned long long x) { + return int(__popcnt64(x)); + } + #endif +-#endif // !defined(_MSC_VER) || (_MSC_VER < 1923) + + FOLLY_ALWAYS_INLINE void* __builtin_return_address(unsigned int frame) { + // I really hope frame is zero... +-- + +diff --git a/folly/portability/Builtins.h b/folly/portability/Builtins.h +index e68de4456..30caf4003 100644 +--- a/folly/portability/Builtins.h ++++ b/folly/portability/Builtins.h +@@ -16,7 +16,7 @@ + + #pragma once + +-#if defined(_WIN32) && !defined(__clang__) ++#if defined(_WIN32) && !defined(__MINGW32__) && !defined(__clang__) + #include + #include + #include +-- +see https://github.com/facebook/folly/issues/1412 +diff --git a/folly/portability/Builtins.h b/folly/portability/Builtins.h +index 30caf4003..e8ef97266 100644 +--- a/folly/portability/Builtins.h ++++ b/folly/portability/Builtins.h +@@ -22,6 +22,14 @@ + #include + #include + ++// MSVC had added support for __builtin_clz etc. in 16.3 (1923) but it will be ++// removed in 16.8 (1928). ++#if (_MSC_VER >= 1923) && (_MSC_VER < 1928) ++#define FOLLY_DETAILFOLLY_DETAIL_MSC_BUILTIN_SUPPORT 1 ++#else ++#define FOLLY_DETAILFOLLY_DETAIL_MSC_BUILTIN_SUPPORT 0 ++#endif ++ + namespace folly { + namespace portability { + namespace detail { +@@ -41,6 +49,7 @@ FOLLY_ALWAYS_INLINE void __builtin___clear_cache(char* begin, char* end) { + } + } + ++#if !defined(_MSC_VER) || !defined(FOLLY_DETAIL_MSC_BUILTIN_SUPPORT) + FOLLY_ALWAYS_INLINE int __builtin_clz(unsigned int x) { + unsigned long index; + return int(_BitScanReverse(&index, (unsigned long)x) ? 31 - index : 32); +@@ -92,6 +101,7 @@ FOLLY_ALWAYS_INLINE int __builtin_ctzll(unsigned long long x) { + return int(_BitScanForward64(&index, x) ? index : 64); + } + #endif ++#endif // !defined(_MSC_VER) || !defined(FOLLY_DETAIL_MSC_BUILTIN_SUPPORT) + + FOLLY_ALWAYS_INLINE int __builtin_ffs(int x) { + unsigned long index; +@@ -117,12 +127,15 @@ FOLLY_ALWAYS_INLINE int __builtin_popcount(unsigned int x) { + return int(__popcnt(x)); + } + ++#if !defined(_MSC_VER) || !defined(FOLLY_DETAIL_MSC_BUILTIN_SUPPORT) + FOLLY_ALWAYS_INLINE int __builtin_popcountl(unsigned long x) { + static_assert(sizeof(x) == 4, ""); + return int(__popcnt(x)); + } ++#endif // !defined(_MSC_VER) || !defined(FOLLY_DETAIL_MSC_BUILTIN_SUPPORT) + #endif + ++#if !defined(_MSC_VER) || !defined(FOLLY_DETAIL_MSC_BUILTIN_SUPPORT) + #if defined(_M_IX86) + FOLLY_ALWAYS_INLINE int __builtin_popcountll(unsigned long long x) { + return int(__popcnt((unsigned int)(x >> 32))) + +@@ -133,6 +146,7 @@ FOLLY_ALWAYS_INLINE int __builtin_popcountll(unsigned long long x) { + return int(__popcnt64(x)); + } + #endif ++#endif // !defined(_MSC_VER) || !defined(FOLLY_DETAIL_MSC_BUILTIN_SUPPORT) + + FOLLY_ALWAYS_INLINE void* __builtin_return_address(unsigned int frame) { + // I really hope frame is zero... +@@ -141,3 +155,5 @@ FOLLY_ALWAYS_INLINE void* __builtin_return_address(unsigned int frame) { + return _ReturnAddress(); + } + #endif ++ ++#undef FOLLY_DETAIL_MSC_BUILTIN_SUPPORT +-- +