Browse Source

Merge pull request #9111 from neheb/fol

libfolly: Update to version 2019.05.27.00
lilik-openwrt-22.03
Rosen Penev 6 years ago
committed by GitHub
parent
commit
1cc3c11739
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 17 additions and 282 deletions
  1. +4
    -6
      libs/fbthrift/Makefile
  2. +3
    -4
      libs/libfizz/Makefile
  3. +5
    -6
      libs/libfolly/Makefile
  4. +0
    -114
      libs/libfolly/patches/102-uclibc-patches.patch
  5. +0
    -147
      libs/libfolly/patches/103-openssl-compatibility.patch
  6. +2
    -2
      libs/librsocket-cpp/Makefile
  7. +3
    -3
      libs/libwangle/Makefile

+ 4
- 6
libs/fbthrift/Makefile View File

@ -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 <ambhave@fb.com>
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


+ 3
- 4
libs/libfizz/Makefile View File

@ -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


+ 5
- 6
libs/libfolly/Makefile View File

@ -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


+ 0
- 114
libs/libfolly/patches/102-uclibc-patches.patch View File

@ -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 <typename T>
class CachelinePadded {
- static_assert(
- alignof(T) <= max_align_v,
- "CachelinePadded does not support over-aligned types.");
-
public:
template <typename... Args>
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 <folly/Singleton.h>
#include <folly/String.h>
#include <folly/json.h>
+#include <folly/portability/Math.h>
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<double>::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 <byteswap.h>
#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__

+ 0
- 147
libs/libfolly/patches/103-openssl-compatibility.patch View File

@ -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<uint16_t, std::string> 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 <openssl/asn1.h>
#include <openssl/bio.h>
+#include <openssl/bn.h>
#include <openssl/crypto.h>
#include <openssl/dh.h>
#include <openssl/err.h>
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<std::string> 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 <folly/Conv.h>
#include <folly/portability/OpenSSL.h>
+#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<SSLLock[]>& locks() {
static auto locksInst = new std::unique_ptr<SSLLock[]>();
return *locksInst;
@@ -128,8 +129,8 @@ static void callbackLocking(int mode, int n, const char*, int) {
}
}
-static unsigned long callbackThreadID() {
- return static_cast<unsigned long>(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<SSLLock[]>(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

+ 2
- 2
libs/librsocket-cpp/Makefile View File

@ -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


+ 3
- 3
libs/libwangle/Makefile View File

@ -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


Loading…
Cancel
Save