From e243f40fd4bcbc850ac5e8974a4e606175e4a30c Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Fri, 31 May 2019 10:47:35 -0700 Subject: [PATCH 1/5] libfolly: Update to version 2019.05.27.00 Removed upstreamed patches. Also fixes a redefinition error on some platforms. Cleaned up the DEPENDS to be simpler and more concise. Signed-off-by: Rosen Penev --- libs/libfolly/Makefile | 11 +- .../libfolly/patches/102-uclibc-patches.patch | 114 -------------- .../patches/103-openssl-compatibility.patch | 147 ------------------ 3 files changed, 5 insertions(+), 267 deletions(-) delete mode 100644 libs/libfolly/patches/102-uclibc-patches.patch delete mode 100644 libs/libfolly/patches/103-openssl-compatibility.patch diff --git a/libs/libfolly/Makefile b/libs/libfolly/Makefile index 83e4f454b..73df0725f 100644 --- a/libs/libfolly/Makefile +++ b/libs/libfolly/Makefile @@ -1,12 +1,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libfolly -PKG_VERSION:=2019.05.06.00 +PKG_VERSION:=2019.05.27.00 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/facebook/folly/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=59e88d792e4c917e2f37ac22c230af0056bce8aa7bacf2d9e94ceb177a7c1079 +PKG_HASH:=7535937e4b4bde14e6c854dc55a5fe9f290ccf1918621f20678ebecd0c1239e1 PKG_BUILD_DIR:=$(BUILD_DIR)/folly-$(PKG_VERSION) PKG_LICENSE:=Apache-2.0 @@ -32,10 +32,9 @@ define Package/libfolly CATEGORY:=Libraries TITLE:=An open-source C++ library developed and used at Facebook. URL:=https://github.com/facebook/folly - DEPENDS:=+libstdcpp +boost +boost-context +boost-system +boost-thread \ - +boost-date_time +boost-filesystem +boost-program_options +boost-regex \ - +libbz2 +libopenssl +libdouble-conversion +libevent2 +glog +zlib +libzstd \ - +gflags +libsodium +liblzma +libaio +liblz4 +libunwind +libatomic + DEPENDS:=+boost +boost-context +boost-date_time +boost-filesystem +boost-program_options +boost-regex \ + +libopenssl +libdouble-conversion +libevent2 +glog +libsodium +libaio +libunwind +libatomic \ + +libbz2 +zlib +libzstd +liblzma +liblz4 endef define Package/libfolly/description diff --git a/libs/libfolly/patches/102-uclibc-patches.patch b/libs/libfolly/patches/102-uclibc-patches.patch deleted file mode 100644 index 2dc539e77..000000000 --- a/libs/libfolly/patches/102-uclibc-patches.patch +++ /dev/null @@ -1,114 +0,0 @@ -diff --git a/folly/CachelinePadded.h b/folly/CachelinePadded.h ---- a/folly/CachelinePadded.h -+++ b/folly/CachelinePadded.h -@@ -35,10 +35,6 @@ - */ - template - class CachelinePadded { -- static_assert( -- alignof(T) <= max_align_v, -- "CachelinePadded does not support over-aligned types."); -- - public: - template - explicit CachelinePadded(Args&&... args) -diff --git a/folly/experimental/JSONSchema.cpp b/folly/experimental/JSONSchema.cpp ---- a/folly/experimental/JSONSchema.cpp -+++ b/folly/experimental/JSONSchema.cpp -@@ -25,6 +25,7 @@ - #include - #include - #include -+#include - - namespace folly { - namespace jsonschema { -@@ -141,7 +142,7 @@ - return none; - } - if (schema_.isDouble() || value.isDouble()) { -- const auto rem = std::remainder(value.asDouble(), schema_.asDouble()); -+ const auto rem = folly::remainder(value.asDouble(), schema_.asDouble()); - if (std::abs(rem) > std::numeric_limits::epsilon()) { - return makeError("a multiple of ", schema_, value); - } -diff --git a/folly/external/farmhash/farmhash.cpp b/folly/external/farmhash/farmhash.cpp ---- a/folly/external/farmhash/farmhash.cpp -+++ b/folly/external/farmhash/farmhash.cpp -@@ -181,6 +181,7 @@ - - #undef bswap_32 - #undef bswap_64 -+#undef _BYTESWAP_H - #include - - #endif -diff --git a/folly/portability/Math.h b/folly/portability/Math.h ---- a/folly/portability/Math.h -+++ b/folly/portability/Math.h -@@ -20,21 +20,24 @@ - - namespace folly { - --#ifndef __ANDROID__ -+#if !defined(__ANDROID__) && !defined(__UCLIBC__) - - /** -- * Most platforms hopefully provide std::nextafter. -+ * Most platforms hopefully provide std::{nextafter,remainder}. - */ - - /* using override */ using std::nextafter; -+/* using override */ using std::remainder; - --#else // !__ANDROID__ -+#else // !__ANDROID__ && !__UCLIBC__ - - /** - * On Android, std::nextafter isn't implemented. However, the C functions and - * compiler builtins are still provided. Using the GCC builtin is actually - * slightly faster, as they're constexpr and the use cases within folly are in - * constexpr context. -+ * -+ * UCLIBC doesn't implement std::remainder. Use the builtin versions. - */ - - #if defined(__GNUC__) && !defined(__clang__) -@@ -51,6 +54,18 @@ - return __builtin_nextafterl(x, y); - } - -+constexpr float remainder(float x, float y) { -+ return __builtin_remainderf(x, y); -+} -+ -+constexpr double remainder(double x, double y) { -+ return __builtin_remainder(x, y); -+} -+ -+constexpr long double remainder(long double x, long double y) { -+ return __builtin_remainderl(x, y); -+} -+ - #else // __GNUC__ - - inline float nextafter(float x, float y) { -@@ -65,6 +80,18 @@ - return ::nextafterl(x, y); - } - -+inline float remainder(float x, float y) { -+ return ::remainderf(x, y); -+} -+ -+inline double remainder(double x, double y) { -+ return ::remainder(x, y); -+} -+ -+inline long double remainder(long double x, long double y) { -+ return ::remainderl(x, y); -+} -+ - #endif // __GNUC__ - - #endif // __ANDROID__ diff --git a/libs/libfolly/patches/103-openssl-compatibility.patch b/libs/libfolly/patches/103-openssl-compatibility.patch deleted file mode 100644 index 72c3c7a2d..000000000 --- a/libs/libfolly/patches/103-openssl-compatibility.patch +++ /dev/null @@ -1,147 +0,0 @@ -diff --git a/folly/io/async/ssl/OpenSSLUtils.cpp b/folly/io/async/ssl/OpenSSLUtils.cpp -index 0504cf8..a9c2775 100644 ---- a/folly/io/async/ssl/OpenSSLUtils.cpp -+++ b/folly/io/async/ssl/OpenSSLUtils.cpp -@@ -155,8 +155,12 @@ static std::unordered_map getOpenSSLCipherNames() { - SSL_CTX* ctx = nullptr; - SSL* ssl = nullptr; - -+#if OPENSSL_VERSION_NUMBER < 0x10100000L - const SSL_METHOD* meth = SSLv23_server_method(); - OpenSSL_add_ssl_algorithms(); -+#else -+ const SSL_METHOD* meth = TLS_server_method(); -+#endif - - if ((ctx = SSL_CTX_new(meth)) == nullptr) { - return ret; -diff --git a/folly/portability/OpenSSL.h b/folly/portability/OpenSSL.h -index a4f4b04..427bf95 100644 ---- a/folly/portability/OpenSSL.h -+++ b/folly/portability/OpenSSL.h -@@ -27,6 +27,7 @@ - - #include - #include -+#include - #include - #include - #include -diff --git a/folly/ssl/OpenSSLCertUtils.cpp b/folly/ssl/OpenSSLCertUtils.cpp -index 544bb4f..423dd2c 100644 ---- a/folly/ssl/OpenSSLCertUtils.cpp -+++ b/folly/ssl/OpenSSLCertUtils.cpp -@@ -155,12 +155,17 @@ folly::Optional OpenSSLCertUtils::toString(X509& x509) { - } - } - -+#if OPENSSL_VERSION_NUMBER < 0x10100000L -+#define X509_get0_notAfter X509_get_notAfter -+#define X509_get0_notBefore X509_get_notBefore -+#endif -+ - std::string OpenSSLCertUtils::getNotAfterTime(X509& x509) { -- return getDateTimeStr(X509_get_notAfter(&x509)); -+ return getDateTimeStr(X509_get0_notAfter(&x509)); - } - - std::string OpenSSLCertUtils::getNotBeforeTime(X509& x509) { -- return getDateTimeStr(X509_get_notBefore(&x509)); -+ return getDateTimeStr(X509_get0_notBefore(&x509)); - } - - std::string OpenSSLCertUtils::getDateTimeStr(const ASN1_TIME* time) { -diff --git a/folly/ssl/OpenSSLVersionFinder.h b/folly/ssl/OpenSSLVersionFinder.h -index d0110d7..9d65580 100644 ---- a/folly/ssl/OpenSSLVersionFinder.h -+++ b/folly/ssl/OpenSSLVersionFinder.h -@@ -18,6 +18,12 @@ - #include - #include - -+#if OPENSSL_VERSION_NUMBER < 0x10100000L -+#define OPENSSL_VERSION SSLEAY_VERSION -+#define OpenSSL_version SSLeay_version -+#define OpenSSL_version_num SSLeay -+#endif -+ - // This is used to find the OpenSSL version at runtime. Just returning - // OPENSSL_VERSION_NUMBER is insufficient as runtime version may be different - // from the compile-time version -@@ -25,7 +31,7 @@ namespace folly { - namespace ssl { - inline std::string getOpenSSLLongVersion() { - #ifdef OPENSSL_VERSION_TEXT -- return SSLeay_version(SSLEAY_VERSION); -+ return OpenSSL_version(OPENSSL_VERSION); - #elif defined(OPENSSL_VERSION_NUMBER) - return folly::format("0x{:x}", OPENSSL_VERSION_NUMBER).str(); - #else -@@ -35,7 +41,7 @@ inline std::string getOpenSSLLongVersion() { - - inline uint64_t getOpenSSLNumericVersion() { - #ifdef OPENSSL_VERSION_NUMBER -- return SSLeay(); -+ return OpenSSL_version_num(); - #else - return 0; - #endif -diff --git a/folly/ssl/detail/OpenSSLThreading.cpp b/folly/ssl/detail/OpenSSLThreading.cpp -index 3414fbd..ce345ab 100644 ---- a/folly/ssl/detail/OpenSSLThreading.cpp -+++ b/folly/ssl/detail/OpenSSLThreading.cpp -@@ -115,6 +115,7 @@ struct SSLLock { - // SSLContext runs in such environments. - // Instead of declaring a static member we "new" the static - // member so that it won't be destructed on exit(). -+#if !FOLLY_SSL_DETAIL_OPENSSL_IS_110 - static std::unique_ptr& locks() { - static auto locksInst = new std::unique_ptr(); - return *locksInst; -@@ -128,8 +129,8 @@ static void callbackLocking(int mode, int n, const char*, int) { - } - } - --static unsigned long callbackThreadID() { -- return static_cast(folly::getCurrentThreadID()); -+static void callbackThreadID(CRYPTO_THREADID *id) { -+ return CRYPTO_THREADID_set_numeric(id, folly::getCurrentThreadID()); - } - - static CRYPTO_dynlock_value* dyn_create(const char*, int) { -@@ -150,28 +151,33 @@ dyn_lock(int mode, struct CRYPTO_dynlock_value* lock, const char*, int) { - static void dyn_destroy(struct CRYPTO_dynlock_value* lock, const char*, int) { - delete lock; - } -+#endif - - void installThreadingLocks() { -+#if !FOLLY_SSL_DETAIL_OPENSSL_IS_110 - // static locking - locks() = std::make_unique(size_t(CRYPTO_num_locks())); - for (auto it : lockTypes()) { - locks()[size_t(it.first)].lockType = it.second; - } -- CRYPTO_set_id_callback(callbackThreadID); -+ CRYPTO_THREADID_set_callback(callbackThreadID); - CRYPTO_set_locking_callback(callbackLocking); - // dynamic locking - CRYPTO_set_dynlock_create_callback(dyn_create); - CRYPTO_set_dynlock_lock_callback(dyn_lock); - CRYPTO_set_dynlock_destroy_callback(dyn_destroy); -+#endif - } - - void cleanupThreadingLocks() { -- CRYPTO_set_id_callback(nullptr); -+#if !FOLLY_SSL_DETAIL_OPENSSL_IS_110 -+ CRYPTO_THREADID_set_callback(nullptr); - CRYPTO_set_locking_callback(nullptr); - CRYPTO_set_dynlock_create_callback(nullptr); - CRYPTO_set_dynlock_lock_callback(nullptr); - CRYPTO_set_dynlock_destroy_callback(nullptr); - locks().reset(); -+#endif - } - - } // namespace detail From b9c64ba0039f1d36f81b8247952130c820d1909d Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Fri, 31 May 2019 11:43:49 -0700 Subject: [PATCH 2/5] libfizz: Update to 2019.05.27.00 Simplified DEPENDS. libfolly is all that's needed. Signed-off-by: Rosen Penev --- libs/libfizz/Makefile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libs/libfizz/Makefile b/libs/libfizz/Makefile index 1449fae13..3f5681fdc 100644 --- a/libs/libfizz/Makefile +++ b/libs/libfizz/Makefile @@ -1,12 +1,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libfizz -PKG_VERSION:=2019.05.06.00 +PKG_VERSION:=2019.05.27.00 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/facebookincubator/fizz/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=80d4089cef655192733a7b0536bd3e2dab9baf143ed99510308064ff4842ae11 +PKG_HASH:=d3f5325717a2af3684a41889d45b19e975cfff177faffdfaab8cb63df4e0318c PKG_BUILD_DIR:=$(BUILD_DIR)/fizz-$(PKG_VERSION) PKG_LICENSE:=BSD @@ -25,8 +25,7 @@ CMAKE_INSTALL:=1 define Package/libfizz SECTION:=libs CATEGORY:=Libraries - DEPENDS:=+libfolly +boost +libopenssl +glog +gflags +libevent2 \ - +libdouble-conversion +libsodium + DEPENDS:=+libfolly TITLE:=C++14 implementation of the TLS-1.3 standard URL:=https://github.com/facebookincubator/fizz endef From 2d9ad583f56aab57eda31b0f2610915d507f7dec Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Fri, 31 May 2019 13:05:54 -0700 Subject: [PATCH 3/5] librsocket-cpp: Simplify dependencies Signed-off-by: Rosen Penev --- libs/librsocket-cpp/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/librsocket-cpp/Makefile b/libs/librsocket-cpp/Makefile index d64ad42fb..775ca72fc 100644 --- a/libs/librsocket-cpp/Makefile +++ b/libs/librsocket-cpp/Makefile @@ -29,14 +29,14 @@ define Package/librsocket-cpp SECTION:=libs CATEGORY:=Libraries TITLE:=C++ implementation of RSocket - DEPENDS:=+libfolly +gflags +glog +libopenssl +libyarpl + DEPENDS:=+libyarpl endef define Package/libyarpl SECTION:=libs CATEGORY:=Libraries TITLE:=yarpl: Yet Another Reactive Programming Library - DEPENDS:=+libfolly +gflags +glog +libatomic + DEPENDS:=+libfolly endef define Package/librsocket-cpp/description From 650c7e6eecb377531065a111969fa2f035a6831a Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Fri, 31 May 2019 13:09:06 -0700 Subject: [PATCH 4/5] libwangle: Update to 2019.05.27.00 Simplify dependencies. Signed-off-by: Rosen Penev --- libs/libwangle/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/libwangle/Makefile b/libs/libwangle/Makefile index 055c3f1a6..ace8e2c87 100644 --- a/libs/libwangle/Makefile +++ b/libs/libwangle/Makefile @@ -1,12 +1,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libwangle -PKG_VERSION:=2019.05.06.00 +PKG_VERSION:=2019.05.27.00 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/facebook/wangle/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=de145e3748a5f71be1883ad2ea4be37e99f99fcb1838a6a258ca2c4cd0d053e7 +PKG_HASH:=935d94658133279d98de27ab7c78801c87f16414b8eec43766798acc5b14f549 PKG_BUILD_DIR:=$(BUILD_DIR)/wangle-$(PKG_VERSION) PKG_LICENSE:=Apache-2.0 @@ -25,7 +25,7 @@ define Package/libwangle SECTION:=libs CATEGORY:=Libraries TITLE:=Wangle: C++ networking library - DEPENDS:=+libstdcpp +libfolly +libsodium +libfizz + DEPENDS:=+libfizz endef define Package/libwangle/description From b2269ff2f1b2072bc49f9f46b7e35eec5c5a0d1a Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Fri, 31 May 2019 13:16:56 -0700 Subject: [PATCH 5/5] fbthrift: Update to 2019.05.27.00 Simplify dependencies. Signed-off-by: Rosen Penev --- libs/fbthrift/Makefile | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/libs/fbthrift/Makefile b/libs/fbthrift/Makefile index 3e8c0e9bc..5bd4e1965 100644 --- a/libs/fbthrift/Makefile +++ b/libs/fbthrift/Makefile @@ -1,13 +1,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=fbthrift -PKG_VERSION:=2019.05.06.00 +PKG_VERSION:=2019.05.27.00 PKG_RELEASE:=1 PKG_MAINTAINER:=Amol Bhave PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/facebook/fbthrift/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=563ad2cacbd29cd22da3a608da52a2ab831942592c0f47dbeeab7131d9291995 +PKG_HASH:=7c56dae532e60844520cef4ce03abd4911323fe340fdee0cc3a6a3e8adb09e3f PKG_LICENSE_FILES:=LICENSE @@ -36,10 +36,8 @@ define Package/fbthrift SECTION:=libs CATEGORY:=Libraries TITLE:=Facebook's branch of Apache Thrift, including a new C++ server. - DEPENDS:=+libstdcpp +boost +boost-filesystem +libfolly +glog +libsodium \ - +libwangle +libfmt +libyarpl +libmstch +librsocket-cpp \ - +@boost-host-build-filesystem +@boost-host-build-system \ - +@boost-host-build-thread + DEPENDS:=+libwangle +libfmt +libmstch +librsocket-cpp +@boost-host-build-filesystem \ + +@boost-host-build-thread +@boost-host-build-system endef define Package/fbthrift/description