Commit 6e152bdb authored by Georgios Bitzes's avatar Georgios Bitzes
Browse files

Try to fix SLC6 build, apply patches on folly

parent 4c657454
Pipeline #1266556 failed with stages
in 37 minutes and 55 seconds
......@@ -13,6 +13,7 @@ deps-slc6:
- spectool -g -R eos-folly-deps.spec
- mkdir -p ~/rpmbuild/SOURCES
- cp SConstruct.double-conversion ~/rpmbuild/SOURCES
- cp 0001-Apply-SLC6-patches.patch ~/rpmbuild/SOURCES
- rpmbuild -ba eos-folly-deps.spec
- mkdir "$CI_JOB_NAME"
- cp -r /root/rpmbuild/RPMS/ /root/rpmbuild/SRPMS/ "$CI_JOB_NAME"
......
diff -urN folly-2019.11.11.00-orig/0001-Apply-SLC6-patches.patch folly-2019.11.11.00/0001-Apply-SLC6-patches.patch
--- folly-2019.11.11.00-orig/0001-Apply-SLC6-patches.patch 1970-01-01 01:00:00.000000000 +0100
+++ folly-2019.11.11.00/0001-Apply-SLC6-patches.patch 2019-12-02 11:42:39.296764146 +0100
@@ -0,0 +1,115 @@
+From a26bad390f9e4cf8c6743e84b0bdeadba19d6259 Mon Sep 17 00:00:00 2001
+From: Georgios Bitzes <georgios.bitzes@cern.ch>
+Date: Mon, 2 Dec 2019 11:11:40 +0100
+Subject: [PATCH] Apply SLC6 patches
+
+---
+ folly/Benchmark.cpp | 6 +++++-
+ folly/io/async/AsyncSSLSocket.cpp | 15 +++++++++++++++
+ folly/io/async/SSLContext.cpp | 4 ++++
+ folly/portability/Time.cpp | 3 +++
+ folly/ssl/OpenSSLCertUtils.cpp | 9 +++++++++
+ 5 files changed, 36 insertions(+), 1 deletions(-)
+
+diff --git a/folly/Benchmark.cpp b/folly/Benchmark.cpp
+index cdaccce..44197a4 100644
+--- a/folly/Benchmark.cpp
++++ b/folly/Benchmark.cpp
+@@ -36,6 +36,9 @@
+ #include <folly/container/Foreach.h>
+ #include <folly/json.h>
+
++#include <cstdio>
++#include <cinttypes>
++
+ using namespace std;
+
+ DEFINE_bool(benchmark, false, "Run benchmarks.");
+@@ -337,7 +340,8 @@ class BenchmarkResultsPrinter {
+ break;
+ case UserMetric::Type::CUSTOM:
+ default:
+- printf(" %-*" PRId64, int(name.length()), ptr->value);
++ break;
++ //printf(" %-*" PRId64, int(name.length()), ptr->value);
+ }
+ } else {
+ printf(" %-*s", int(name.length()), "NaN");
+diff --git a/folly/io/async/AsyncSSLSocket.cpp b/folly/io/async/AsyncSSLSocket.cpp
+index bb452aa..7bf8156 100644
+--- a/folly/io/async/AsyncSSLSocket.cpp
++++ b/folly/io/async/AsyncSSLSocket.cpp
+@@ -718,6 +718,21 @@ bool AsyncSSLSocket::needsPeerVerification() const {
+ verifyPeer_ == SSLContext::SSLVerifyPeerEnum::VERIFY_REQ_CLIENT_CERT);
+ }
+
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
++# define SSL_CTX_add1_chain_cert(ctx,x509) \
++ SSL_CTX_ctrl(ctx,SSL_CTRL_CHAIN_CERT,1,(char *)(x509))
++static X509_VERIFY_PARAM *SSL_get0_param(SSL *ssl)
++{
++ return ssl->param;
++}
++
++static int X509_VERIFY_PARAM_set1_host(X509_VERIFY_PARAM *param,
++ const char *name, size_t namelen)
++{
++ return 1;
++}
++#endif
++
+ bool AsyncSSLSocket::applyVerificationOptions(const ssl::SSLUniquePtr& ssl) {
+ // apply the settings specified in verifyPeer_
+ if (verifyPeer_ == SSLContext::SSLVerifyPeerEnum::USE_CTX) {
+diff --git a/folly/io/async/SSLContext.cpp b/folly/io/async/SSLContext.cpp
+index 4043da6..76a95c8 100644
+--- a/folly/io/async/SSLContext.cpp
++++ b/folly/io/async/SSLContext.cpp
+@@ -24,6 +24,10 @@
+ #include <folly/ssl/Init.h>
+ #include <folly/system/ThreadId.h>
+
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
++# define SSL_CTX_add1_chain_cert(ctx,x509) 0
++#endif
++
+ // ---------------------------------------------------------------------
+ // SSLContext implementation
+ // ---------------------------------------------------------------------
+diff --git a/folly/portability/Time.cpp b/folly/portability/Time.cpp
+index 44863c5..e0660cc 100644
+--- a/folly/portability/Time.cpp
++++ b/folly/portability/Time.cpp
+@@ -34,6 +34,9 @@ static void duration_to_ts(
+ .count());
+ }
+
++#undef FOLLY_HAVE_CLOCK_GETTIME
++#define FOLLY_HAVE_CLOCK_GETTIME 1
++
+ #if !FOLLY_HAVE_CLOCK_GETTIME || FOLLY_FORCE_CLOCK_GETTIME_DEFINITION
+ #if __MACH__
+ #include <errno.h>
+diff --git a/folly/ssl/OpenSSLCertUtils.cpp b/folly/ssl/OpenSSLCertUtils.cpp
+index ea36a53..67b188d 100644
+--- a/folly/ssl/OpenSSLCertUtils.cpp
++++ b/folly/ssl/OpenSSLCertUtils.cpp
+@@ -21,6 +21,15 @@
+ #include <folly/String.h>
+ #include <folly/ssl/OpenSSLPtrTypes.h>
+
++#include <openssl/crypto.h>
++
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
++
++int ASN1_TIME_diff(int *pday, int *psec, const ASN1_TIME *from, const ASN1_TIME *to) {
++ return 3;
++}
++#endif
++
+ namespace folly {
+ namespace ssl {
+
+--
+1.7.1
+
diff -urN folly-2019.11.11.00-orig/folly/Benchmark.cpp folly-2019.11.11.00/folly/Benchmark.cpp
--- folly-2019.11.11.00-orig/folly/Benchmark.cpp 2019-12-02 11:42:15.725522097 +0100
+++ folly-2019.11.11.00/folly/Benchmark.cpp 2019-12-02 11:42:42.604798120 +0100
@@ -36,6 +36,9 @@
#include <folly/container/Foreach.h>
#include <folly/json.h>
+#include <cstdio>
+#include <cinttypes>
+
using namespace std;
DEFINE_bool(benchmark, false, "Run benchmarks.");
@@ -337,7 +340,8 @@
break;
case UserMetric::Type::CUSTOM:
default:
- printf(" %-*" PRId64, int(name.length()), ptr->value);
+ break;
+ //printf(" %-*" PRId64, int(name.length()), ptr->value);
}
} else {
printf(" %-*s", int(name.length()), "NaN");
diff -urN folly-2019.11.11.00-orig/folly/io/async/AsyncSSLSocket.cpp folly-2019.11.11.00/folly/io/async/AsyncSSLSocket.cpp
--- folly-2019.11.11.00-orig/folly/io/async/AsyncSSLSocket.cpp 2019-12-02 11:42:15.741522261 +0100
+++ folly-2019.11.11.00/folly/io/async/AsyncSSLSocket.cpp 2019-12-02 11:42:42.604798120 +0100
@@ -718,6 +718,21 @@
verifyPeer_ == SSLContext::SSLVerifyPeerEnum::VERIFY_REQ_CLIENT_CERT);
}
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+# define SSL_CTX_add1_chain_cert(ctx,x509) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_CHAIN_CERT,1,(char *)(x509))
+static X509_VERIFY_PARAM *SSL_get0_param(SSL *ssl)
+{
+ return ssl->param;
+}
+
+static int X509_VERIFY_PARAM_set1_host(X509_VERIFY_PARAM *param,
+ const char *name, size_t namelen)
+{
+ return 1;
+}
+#endif
+
bool AsyncSSLSocket::applyVerificationOptions(const ssl::SSLUniquePtr& ssl) {
// apply the settings specified in verifyPeer_
if (verifyPeer_ == SSLContext::SSLVerifyPeerEnum::USE_CTX) {
diff -urN folly-2019.11.11.00-orig/folly/io/async/SSLContext.cpp folly-2019.11.11.00/folly/io/async/SSLContext.cpp
--- folly-2019.11.11.00-orig/folly/io/async/SSLContext.cpp 2019-12-02 11:42:15.741522261 +0100
+++ folly-2019.11.11.00/folly/io/async/SSLContext.cpp 2019-12-02 11:42:42.604798120 +0100
@@ -24,6 +24,10 @@
#include <folly/ssl/Init.h>
#include <folly/system/ThreadId.h>
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+# define SSL_CTX_add1_chain_cert(ctx,x509) 0
+#endif
+
// ---------------------------------------------------------------------
// SSLContext implementation
// ---------------------------------------------------------------------
diff -urN folly-2019.11.11.00-orig/folly/portability/Time.cpp folly-2019.11.11.00/folly/portability/Time.cpp
--- folly-2019.11.11.00-orig/folly/portability/Time.cpp 2019-12-02 11:42:15.629521112 +0100
+++ folly-2019.11.11.00/folly/portability/Time.cpp 2019-12-02 11:42:42.604798120 +0100
@@ -34,6 +34,9 @@
.count());
}
+#undef FOLLY_HAVE_CLOCK_GETTIME
+#define FOLLY_HAVE_CLOCK_GETTIME 1
+
#if !FOLLY_HAVE_CLOCK_GETTIME || FOLLY_FORCE_CLOCK_GETTIME_DEFINITION
#if __MACH__
#include <errno.h>
diff -urN folly-2019.11.11.00-orig/folly/ssl/OpenSSLCertUtils.cpp folly-2019.11.11.00/folly/ssl/OpenSSLCertUtils.cpp
--- folly-2019.11.11.00-orig/folly/ssl/OpenSSLCertUtils.cpp 2019-12-02 11:42:15.632521142 +0100
+++ folly-2019.11.11.00/folly/ssl/OpenSSLCertUtils.cpp 2019-12-02 11:42:42.605798129 +0100
@@ -21,6 +21,15 @@
#include <folly/String.h>
#include <folly/ssl/OpenSSLPtrTypes.h>
+#include <openssl/crypto.h>
+
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+
+int ASN1_TIME_diff(int *pday, int *psec, const ASN1_TIME *from, const ASN1_TIME *to) {
+ return 3;
+}
+#endif
+
namespace folly {
namespace ssl {
......@@ -17,6 +17,8 @@ License: Apache
URL: https://github.com/facebook/folly.git
Source0: https://github.com/facebook/folly/archive/v%{version}.tar.gz
Patch0: 0001-Apply-SLC6-patches.patch
BuildRequires: gcc-c++
BuildRequires: make
BuildRequires: which
......@@ -60,6 +62,10 @@ This package provides the headers and static library for eos-folly.
%prep
%setup -q -c -n eos-folly -a 0
%if 0%{distribution} == 6
%patch0 -p0
%endif
%build
%if 0%{distribution} == 6 || 0%{distribution} == 7
source /opt/rh/devtoolset-8/enable
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment