summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-dbs
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/recipes-dbs')
-rw-r--r--meta-oe/recipes-dbs/mongodb/mongodb/0001-IntelRDFPMathLib20U1-Check-for-__DEFINED_wchar_t.patch36
-rw-r--r--meta-oe/recipes-dbs/mongodb/mongodb/0001-Tell-scons-to-use-build-settings-from-environment-va.patch67
-rw-r--r--meta-oe/recipes-dbs/mongodb/mongodb/0001-Use-__GLIBC__-to-control-use-of-gnu_get_libc_version.patch50
-rw-r--r--meta-oe/recipes-dbs/mongodb/mongodb/0001-Use-long-long-instead-of-int64_t.patch67
-rw-r--r--meta-oe/recipes-dbs/mongodb/mongodb/0001-Use-strerror_r-only-on-glibc-systems.patch26
-rw-r--r--meta-oe/recipes-dbs/mongodb/mongodb/0001-mongo-Add-using-std-string.patch72
-rw-r--r--meta-oe/recipes-dbs/mongodb/mongodb/0002-Add-a-definition-for-the-macro-__ELF_NATIVE_CLASS.patch35
-rw-r--r--meta-oe/recipes-dbs/mongodb/mongodb/0002-d_state.cpp-Add-missing-dependenncy-on-local_shardin.patch28
-rw-r--r--meta-oe/recipes-dbs/mongodb/mongodb/0003-Conditionalize-glibc-specific-strerror_r.patch39
-rw-r--r--meta-oe/recipes-dbs/mongodb/mongodb/0004-wiredtiger-Disable-strtouq-on-musl.patch26
-rw-r--r--meta-oe/recipes-dbs/mongodb/mongodb/arm64-support.patch43
-rw-r--r--meta-oe/recipes-dbs/mongodb/mongodb/disable-hw-crc32-on-arm64-s390x.patch50
-rw-r--r--meta-oe/recipes-dbs/mongodb/mongodb_git.bb77
13 files changed, 616 insertions, 0 deletions
diff --git a/meta-oe/recipes-dbs/mongodb/mongodb/0001-IntelRDFPMathLib20U1-Check-for-__DEFINED_wchar_t.patch b/meta-oe/recipes-dbs/mongodb/mongodb/0001-IntelRDFPMathLib20U1-Check-for-__DEFINED_wchar_t.patch
new file mode 100644
index 000000000..5da34480e
--- /dev/null
+++ b/meta-oe/recipes-dbs/mongodb/mongodb/0001-IntelRDFPMathLib20U1-Check-for-__DEFINED_wchar_t.patch
@@ -0,0 +1,36 @@
1From fbfceebce2121831904f2f7115252dd03b413a6d Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 19 Sep 2017 18:52:53 -0700
4Subject: [PATCH] IntelRDFPMathLib20U1: Check for __DEFINED_wchar_t
5
6This is defined by musl if wchar_t is already defined
7
8avoids errors like
9
10src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid_functions.h:46:15: error: typedef redefinition with different types
11 ('int' vs 'unsigned int')
12typedef int wchar_t;
13
14Signed-off-by: Khem Raj <raj.khem@gmail.com>
15---
16Upstream-Status: Pending
17
18 src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid_functions.h | 2 +-
19 1 file changed, 1 insertion(+), 1 deletion(-)
20
21diff --git a/src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid_functions.h b/src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid_functions.h
22index 2b3f76db86..cc80305775 100755
23--- a/src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid_functions.h
24+++ b/src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid_functions.h
25@@ -42,7 +42,7 @@
26 #include <ctype.h>
27
28 // Fix system header issue on Sun solaris and define required type by ourselves
29-#if !defined(_WCHAR_T) && !defined(_WCHAR_T_DEFINED) && !defined(__QNX__)
30+#if !defined(_WCHAR_T) && !defined(_WCHAR_T_DEFINED) && !defined(__QNX__) && !defined(__DEFINED_wchar_t)
31 typedef int wchar_t;
32 #endif
33
34--
352.14.1
36
diff --git a/meta-oe/recipes-dbs/mongodb/mongodb/0001-Tell-scons-to-use-build-settings-from-environment-va.patch b/meta-oe/recipes-dbs/mongodb/mongodb/0001-Tell-scons-to-use-build-settings-from-environment-va.patch
new file mode 100644
index 000000000..09d49d28c
--- /dev/null
+++ b/meta-oe/recipes-dbs/mongodb/mongodb/0001-Tell-scons-to-use-build-settings-from-environment-va.patch
@@ -0,0 +1,67 @@
1From 53368d3f4adc09dd84234a9af31771bcd8ca2757 Mon Sep 17 00:00:00 2001
2From: Sven Ebenfeld <sven.ebenfeld@gmail.com>
3Date: Fri, 15 Jan 2016 22:41:28 +0100
4Subject: [PATCH] Tell scons to use build settings from environment variables
5
6Signed-off-by: Sven Ebenfeld <sven.ebenfeld@gmail.com>
7---
8 SConstruct | 8 ++++++--
9 src/mongo/util/SConscript | 2 ++
10 2 files changed, 8 insertions(+), 2 deletions(-)
11
12diff --git a/SConstruct b/SConstruct
13index 5082a4b..3370f70 100644
14--- a/SConstruct
15+++ b/SConstruct
16@@ -507,6 +507,7 @@ def variable_arch_converter(val):
17 'amd64': 'x86_64',
18 'emt64': 'x86_64',
19 'x86': 'i386',
20+ 'aarch64': 'arm64',
21 }
22 val = val.lower()
23
24@@ -568,7 +569,8 @@ env_vars.Add('ARFLAGS',
25 converter=variable_shlex_converter)
26
27 env_vars.Add('CC',
28- help='Select the C compiler to use')
29+ help='Select the C compiler to use',
30+ default=os.getenv('CC'))
31
32 env_vars.Add('CCFLAGS',
33 help='Sets flags for the C and C++ compiler',
34@@ -588,7 +590,8 @@ env_vars.Add('CPPPATH',
35 converter=variable_shlex_converter)
36
37 env_vars.Add('CXX',
38- help='Select the C++ compiler to use')
39+ help='Select the C++ compiler to use',
40+ default=os.getenv('CXX'))
41
42 env_vars.Add('CXXFLAGS',
43 help='Sets flags for the C++ compiler',
44@@ -818,6 +821,7 @@ envDict = dict(BUILD_ROOT=buildDir,
45 )
46
47 env = Environment(variables=env_vars, **envDict)
48+env.PrependENVPath('PATH', os.getenv('PATH'))
49 del envDict
50
51 env.AddMethod(env_os_is_wrapper, 'TargetOSIs')
52diff --git a/src/mongo/util/SConscript b/src/mongo/util/SConscript
53index 6add602..8d05a62 100644
54--- a/src/mongo/util/SConscript
55+++ b/src/mongo/util/SConscript
56@@ -251,6 +251,8 @@ if get_option('allocator') == 'tcmalloc':
57 'MONGO_HAVE_GPERFTOOLS_GET_THREAD_CACHE_SIZE'
58 ]
59 )
60+ if not use_system_version_of_library('valgrind'):
61+ tcmspEnv.InjectThirdPartyIncludePaths('valgrind')
62
63 tcmspEnv.Library(
64 target='tcmalloc_set_parameter',
65--
661.9.1
67
diff --git a/meta-oe/recipes-dbs/mongodb/mongodb/0001-Use-__GLIBC__-to-control-use-of-gnu_get_libc_version.patch b/meta-oe/recipes-dbs/mongodb/mongodb/0001-Use-__GLIBC__-to-control-use-of-gnu_get_libc_version.patch
new file mode 100644
index 000000000..f8c419d8a
--- /dev/null
+++ b/meta-oe/recipes-dbs/mongodb/mongodb/0001-Use-__GLIBC__-to-control-use-of-gnu_get_libc_version.patch
@@ -0,0 +1,50 @@
1From 3eed8388b49d5d3cbc2db74fee1b017eb4b40d0a Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 2 Sep 2017 10:06:24 -0700
4Subject: [PATCH] Use __GLIBC__ to control use of gnu_get_libc_version
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7---
8Upstream-Status: Pending
9 src/mongo/util/processinfo_linux.cpp | 6 ++++--
10 1 file changed, 4 insertions(+), 2 deletions(-)
11
12diff --git a/src/mongo/util/processinfo_linux.cpp b/src/mongo/util/processinfo_linux.cpp
13index 910015215e..bf8c1ffd15 100644
14--- a/src/mongo/util/processinfo_linux.cpp
15+++ b/src/mongo/util/processinfo_linux.cpp
16@@ -40,7 +40,7 @@
17 #include <sys/mman.h>
18 #include <sys/utsname.h>
19 #include <unistd.h>
20-#ifdef __UCLIBC__
21+#ifndef __GLIBC__
22 #include <features.h>
23 #else
24 #include <gnu/libc-version.h>
25@@ -451,11 +451,13 @@ double ProcessInfo::getSystemMemoryPressurePercentage() {
26 }
27
28 void ProcessInfo::getExtraInfo(BSONObjBuilder& info) {
29+#if defined(__GLIBC__)
30 LinuxProc p(_pid);
31 if (p._maj_flt <= std::numeric_limits<long long>::max())
32 info.appendNumber("page_faults", static_cast<long long>(p._maj_flt));
33 else
34 info.appendNumber("page_faults", static_cast<double>(p._maj_flt));
35+#endif
36 }
37
38 /**
39@@ -491,7 +493,7 @@ void ProcessInfo::SystemInfo::collectSystemInfo() {
40 stringstream ss;
41 ss << "uClibc-" << __UCLIBC_MAJOR__ << "." << __UCLIBC_MINOR__ << "." << __UCLIBC_SUBLEVEL__;
42 bExtra.append("libcVersion", ss.str());
43-#else
44+#elif defined(__GLIBC__)
45 bExtra.append("libcVersion", gnu_get_libc_version());
46 #endif
47 if (!verSig.empty())
48--
492.14.1
50
diff --git a/meta-oe/recipes-dbs/mongodb/mongodb/0001-Use-long-long-instead-of-int64_t.patch b/meta-oe/recipes-dbs/mongodb/mongodb/0001-Use-long-long-instead-of-int64_t.patch
new file mode 100644
index 000000000..c43beb4c1
--- /dev/null
+++ b/meta-oe/recipes-dbs/mongodb/mongodb/0001-Use-long-long-instead-of-int64_t.patch
@@ -0,0 +1,67 @@
1From a4951489d649c2b609cbb80f6cfb49fdcad8bd43 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 2 Sep 2017 10:03:37 -0700
4Subject: [PATCH] Use long long instead of int64_t
5
6Fixes
7error: call to member function 'appendNumber' is ambiguous
8since this function expects long long as parameter and not int64_t
9
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12Upstream-Status: Pending
13 src/mongo/util/procparser.cpp | 10 +++++-----
14 1 file changed, 5 insertions(+), 5 deletions(-)
15
16diff --git a/src/mongo/util/procparser.cpp b/src/mongo/util/procparser.cpp
17index 36f2ae0254..2c164bcbf3 100644
18--- a/src/mongo/util/procparser.cpp
19+++ b/src/mongo/util/procparser.cpp
20@@ -260,7 +260,7 @@ Status parseProcStat(const std::vector<StringData>& keys,
21
22 StringData stringValue((*partIt).begin(), (*partIt).end() - (*partIt).begin());
23
24- uint64_t value;
25+ long long value;
26
27 if (!parseNumberFromString(stringValue, &value).isOK()) {
28 value = 0;
29@@ -272,7 +272,7 @@ Status parseProcStat(const std::vector<StringData>& keys,
30 } else {
31 StringData stringValue((*partIt).begin(), (*partIt).end() - (*partIt).begin());
32
33- uint64_t value;
34+ long long value;
35
36 if (!parseNumberFromString(stringValue, &value).isOK()) {
37 value = 0;
38@@ -365,7 +365,7 @@ Status parseProcMemInfo(const std::vector<StringData>& keys,
39
40 StringData stringValue((*partIt).begin(), (*partIt).end());
41
42- uint64_t value;
43+ long long value;
44
45 if (!parseNumberFromString(stringValue, &value).isOK()) {
46 value = 0;
47@@ -426,7 +426,7 @@ Status parseProcDiskStats(const std::vector<StringData>& disks,
48 StringData data,
49 BSONObjBuilder* builder) {
50 bool foundKeys = false;
51- std::vector<uint64_t> stats;
52+ std::vector<long long> stats;
53 stats.reserve(kDiskFieldCount);
54
55 using string_split_iterator = boost::split_iterator<StringData::const_iterator>;
56@@ -501,7 +501,7 @@ Status parseProcDiskStats(const std::vector<StringData>& disks,
57
58 StringData stringValue((*partIt).begin(), (*partIt).end());
59
60- uint64_t value;
61+ long long value;
62
63 if (!parseNumberFromString(stringValue, &value).isOK()) {
64 value = 0;
65--
662.14.1
67
diff --git a/meta-oe/recipes-dbs/mongodb/mongodb/0001-Use-strerror_r-only-on-glibc-systems.patch b/meta-oe/recipes-dbs/mongodb/mongodb/0001-Use-strerror_r-only-on-glibc-systems.patch
new file mode 100644
index 000000000..0334d994e
--- /dev/null
+++ b/meta-oe/recipes-dbs/mongodb/mongodb/0001-Use-strerror_r-only-on-glibc-systems.patch
@@ -0,0 +1,26 @@
1From a4dfc92ff342e59596ab64267a8d4f22f173c23b Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 2 Sep 2017 12:40:41 -0700
4Subject: [PATCH 1/4] Use strerror_r only on glibc systems
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7---
8 src/mongo/util/log.cpp | 2 +-
9 1 file changed, 1 insertion(+), 1 deletion(-)
10
11diff --git a/src/mongo/util/log.cpp b/src/mongo/util/log.cpp
12index 1957eb4791..ddf3908818 100644
13--- a/src/mongo/util/log.cpp
14+++ b/src/mongo/util/log.cpp
15@@ -101,7 +101,7 @@ string errnoWithDescription(int errNumber) {
16 char buf[kBuflen];
17 char* msg{nullptr};
18
19-#if defined(__GNUC__) && defined(_GNU_SOURCE)
20+#if defined(__GNUC__) && defined(_GNU_SOURCE) && defined(__GLIBC__)
21 msg = strerror_r(errNumber, buf, kBuflen);
22 #elif defined(_WIN32)
23
24--
252.14.1
26
diff --git a/meta-oe/recipes-dbs/mongodb/mongodb/0001-mongo-Add-using-std-string.patch b/meta-oe/recipes-dbs/mongodb/mongodb/0001-mongo-Add-using-std-string.patch
new file mode 100644
index 000000000..e517d53d1
--- /dev/null
+++ b/meta-oe/recipes-dbs/mongodb/mongodb/0001-mongo-Add-using-std-string.patch
@@ -0,0 +1,72 @@
1From 5fdec9592285f5976345fbccb3d07fae1245ab53 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 2 Aug 2017 15:41:22 -0700
4Subject: [PATCH] mongo: Add using std::string
5
6This is needed with latest clang
7Fixes
8src/mongo/db/dbwebserver.cpp:206:23: error: use of undeclared identifier 'string'; did you mean 'String'?
9 static vector<string> commands;
10 ^~~~~~
11 String
12
13Signed-off-by: Khem Raj <raj.khem@gmail.com>
14---
15 src/mongo/db/dbwebserver.cpp | 1 +
16 src/mongo/db/matcher/expression_leaf.cpp | 2 ++
17 src/mongo/db/repl/master_slave.cpp | 1 +
18 src/mongo/util/net/miniwebserver.cpp | 1 +
19 4 files changed, 5 insertions(+)
20
21diff --git a/src/mongo/db/dbwebserver.cpp b/src/mongo/db/dbwebserver.cpp
22index b202e0500b..0255613524 100644
23--- a/src/mongo/db/dbwebserver.cpp
24+++ b/src/mongo/db/dbwebserver.cpp
25@@ -67,6 +67,7 @@ namespace mongo {
26 using std::map;
27 using std::stringstream;
28 using std::vector;
29+using std::string;
30
31 using namespace html;
32
33diff --git a/src/mongo/db/matcher/expression_leaf.cpp b/src/mongo/db/matcher/expression_leaf.cpp
34index d562bff141..4d931985e2 100644
35--- a/src/mongo/db/matcher/expression_leaf.cpp
36+++ b/src/mongo/db/matcher/expression_leaf.cpp
37@@ -44,6 +44,8 @@
38 #include "mongo/stdx/memory.h"
39 #include "mongo/util/mongoutils/str.h"
40
41+using std::string;
42+
43 namespace mongo {
44
45 Status LeafMatchExpression::setPath(StringData path) {
46diff --git a/src/mongo/db/repl/master_slave.cpp b/src/mongo/db/repl/master_slave.cpp
47index 05faad1259..ea25d7151b 100644
48--- a/src/mongo/db/repl/master_slave.cpp
49+++ b/src/mongo/db/repl/master_slave.cpp
50@@ -78,6 +78,7 @@ using std::endl;
51 using std::max;
52 using std::min;
53 using std::set;
54+using std::string;
55 using std::stringstream;
56 using std::unique_ptr;
57 using std::vector;
58diff --git a/src/mongo/util/net/miniwebserver.cpp b/src/mongo/util/net/miniwebserver.cpp
59index 5f4165d42f..239720c349 100644
60--- a/src/mongo/util/net/miniwebserver.cpp
61+++ b/src/mongo/util/net/miniwebserver.cpp
62@@ -46,6 +46,7 @@ namespace mongo {
63
64 using std::shared_ptr;
65 using std::stringstream;
66+using std::string;
67 using std::vector;
68
69 MiniWebServer::MiniWebServer(const string& name, const string& ip, int port, ServiceContext* ctx)
70--
712.13.3
72
diff --git a/meta-oe/recipes-dbs/mongodb/mongodb/0002-Add-a-definition-for-the-macro-__ELF_NATIVE_CLASS.patch b/meta-oe/recipes-dbs/mongodb/mongodb/0002-Add-a-definition-for-the-macro-__ELF_NATIVE_CLASS.patch
new file mode 100644
index 000000000..098306f50
--- /dev/null
+++ b/meta-oe/recipes-dbs/mongodb/mongodb/0002-Add-a-definition-for-the-macro-__ELF_NATIVE_CLASS.patch
@@ -0,0 +1,35 @@
1From df7ef16afcc6ab55daa686e4f15c16e3d1280337 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 2 Sep 2017 12:42:30 -0700
4Subject: [PATCH 2/4] Add a definition for the macro __ELF_NATIVE_CLASS
5
6It depends on the native arch's word size.
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9---
10 src/mongo/util/stacktrace_posix.cpp | 9 +++++++++
11 1 file changed, 9 insertions(+)
12
13diff --git a/src/mongo/util/stacktrace_posix.cpp b/src/mongo/util/stacktrace_posix.cpp
14index 53ab85f56f..7c458e7ef2 100644
15--- a/src/mongo/util/stacktrace_posix.cpp
16+++ b/src/mongo/util/stacktrace_posix.cpp
17@@ -37,6 +37,15 @@
18 #include <string>
19 #include <sys/utsname.h>
20
21+#if !defined(__GLIBC__)
22+#if defined __x86_64__ && !defined __ILP32__
23+# define __WORDSIZE 64
24+#else
25+# define __WORDSIZE 32
26+#endif
27+#define __ELF_NATIVE_CLASS __WORDSIZE
28+#endif
29+
30 #include "mongo/base/init.h"
31 #include "mongo/config.h"
32 #include "mongo/db/jsobj.h"
33--
342.14.1
35
diff --git a/meta-oe/recipes-dbs/mongodb/mongodb/0002-d_state.cpp-Add-missing-dependenncy-on-local_shardin.patch b/meta-oe/recipes-dbs/mongodb/mongodb/0002-d_state.cpp-Add-missing-dependenncy-on-local_shardin.patch
new file mode 100644
index 000000000..95f9c1c1c
--- /dev/null
+++ b/meta-oe/recipes-dbs/mongodb/mongodb/0002-d_state.cpp-Add-missing-dependenncy-on-local_shardin.patch
@@ -0,0 +1,28 @@
1From 5759878e5d278f11a1063e8fccd1e6b7b54caadf Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 2 Aug 2017 16:25:37 -0700
4Subject: [PATCH 2/2] d_state.cpp: Add missing dependenncy on
5 local_sharding_info
6
7Fixes
8| src/mongo/s/d_state.cpp:81: error: undefined reference to 'mongo::enableLocalShardingInfo(mongo::ServiceContext*, std::function<bool (mongo::OperationContext*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)>)'
9
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12 src/mongo/s/SConscript | 1 +
13 1 file changed, 1 insertion(+)
14
15diff --git a/src/mongo/s/SConscript b/src/mongo/s/SConscript
16index 71720be517..51bd199127 100644
17--- a/src/mongo/s/SConscript
18+++ b/src/mongo/s/SConscript
19@@ -317,5 +317,6 @@ env.Library(
20 "$BUILD_DIR/mongo/db/s/sharding",
21 "$BUILD_DIR/mongo/executor/network_interface_factory",
22 "$BUILD_DIR/mongo/s/client/shard_local",
23+ "$BUILD_DIR/mongo/s/local_sharding_info",
24 ],
25 )
26--
272.13.3
28
diff --git a/meta-oe/recipes-dbs/mongodb/mongodb/0003-Conditionalize-glibc-specific-strerror_r.patch b/meta-oe/recipes-dbs/mongodb/mongodb/0003-Conditionalize-glibc-specific-strerror_r.patch
new file mode 100644
index 000000000..1591f94c9
--- /dev/null
+++ b/meta-oe/recipes-dbs/mongodb/mongodb/0003-Conditionalize-glibc-specific-strerror_r.patch
@@ -0,0 +1,39 @@
1From 458f80f482a201b427a1c92235804d0c3f98fd51 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 2 Sep 2017 13:01:11 -0700
4Subject: [PATCH 3/4] Conditionalize glibc specific strerror_r
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7---
8 .../asio-asio-1-11-0/asio/include/asio/impl/error_code.ipp | 11 ++++-------
9 1 file changed, 4 insertions(+), 7 deletions(-)
10
11diff --git a/src/third_party/asio-asio-1-11-0/asio/include/asio/impl/error_code.ipp b/src/third_party/asio-asio-1-11-0/asio/include/asio/impl/error_code.ipp
12index 4e7badb14a..0eeae884e2 100644
13--- a/src/third_party/asio-asio-1-11-0/asio/include/asio/impl/error_code.ipp
14+++ b/src/third_party/asio-asio-1-11-0/asio/include/asio/impl/error_code.ipp
15@@ -97,17 +97,14 @@ public:
16 #if defined(__sun) || defined(__QNX__) || defined(__SYMBIAN32__)
17 using namespace std;
18 return strerror(value);
19-#elif defined(__MACH__) && defined(__APPLE__) \
20- || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) \
21- || defined(_AIX) || defined(__hpux) || defined(__osf__) \
22- || defined(__ANDROID__)
23+#elif defined(__GLIBC__) && defined(_GNU_SOURCE)
24+ char buf[256] = "";
25+ return strerror_r(value, buf, sizeof(buf));
26+#else
27 char buf[256] = "";
28 using namespace std;
29 strerror_r(value, buf, sizeof(buf));
30 return buf;
31-#else
32- char buf[256] = "";
33- return strerror_r(value, buf, sizeof(buf));
34 #endif
35 #endif // defined(ASIO_WINDOWS)
36 }
37--
382.14.1
39
diff --git a/meta-oe/recipes-dbs/mongodb/mongodb/0004-wiredtiger-Disable-strtouq-on-musl.patch b/meta-oe/recipes-dbs/mongodb/mongodb/0004-wiredtiger-Disable-strtouq-on-musl.patch
new file mode 100644
index 000000000..e871f2ba9
--- /dev/null
+++ b/meta-oe/recipes-dbs/mongodb/mongodb/0004-wiredtiger-Disable-strtouq-on-musl.patch
@@ -0,0 +1,26 @@
1From a1c77702926eb8546ff96b00b5b994f7478dabae Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 2 Sep 2017 13:13:15 -0700
4Subject: [PATCH 4/4] wiredtiger: Disable strtouq on musl
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7---
8 src/third_party/wiredtiger/build_linux/wiredtiger_config.h | 2 +-
9 1 file changed, 1 insertion(+), 1 deletion(-)
10
11diff --git a/src/third_party/wiredtiger/build_linux/wiredtiger_config.h b/src/third_party/wiredtiger/build_linux/wiredtiger_config.h
12index 1122e1e319..fdfd48687b 100644
13--- a/src/third_party/wiredtiger/build_linux/wiredtiger_config.h
14+++ b/src/third_party/wiredtiger/build_linux/wiredtiger_config.h
15@@ -101,7 +101,7 @@
16 #define HAVE_STRING_H 1
17
18 /* Define to 1 if you have the `strtouq' function. */
19-#define HAVE_STRTOUQ 1
20+/* #undef HAVE_STRTOUQ 1 */
21
22 /* Define to 1 if you have the `sync_file_range' function. */
23 /* #undef HAVE_SYNC_FILE_RANGE */
24--
252.14.1
26
diff --git a/meta-oe/recipes-dbs/mongodb/mongodb/arm64-support.patch b/meta-oe/recipes-dbs/mongodb/mongodb/arm64-support.patch
new file mode 100644
index 000000000..9046bb2f4
--- /dev/null
+++ b/meta-oe/recipes-dbs/mongodb/mongodb/arm64-support.patch
@@ -0,0 +1,43 @@
1Add alises for arm64 which is same as aarch64
2
3Signed-off-by: Khem Raj <raj.khem@gmail.com>
4Upstream-Status: Pending
5
6Index: git/SConstruct
7===================================================================
8--- git.orig/SConstruct
9+++ git/SConstruct
10@@ -990,6 +990,7 @@ elif endian == "big":
11 processor_macros = {
12 'arm' : { 'endian': 'little', 'defines': ('__arm__',) },
13 'aarch64' : { 'endian': 'little', 'defines': ('__arm64__', '__aarch64__')},
14+ 'arm64' : { 'endian': 'little', 'defines': ('__arm64__', '__aarch64__')},
15 'i386' : { 'endian': 'little', 'defines': ('__i386', '_M_IX86')},
16 'ppc64le' : { 'endian': 'little', 'defines': ('__powerpc64__',)},
17 's390x' : { 'endian': 'big', 'defines': ('__s390x__',)},
18Index: git/src/third_party/IntelRDFPMathLib20U1/SConscript
19===================================================================
20--- git.orig/src/third_party/IntelRDFPMathLib20U1/SConscript
21+++ git/src/third_party/IntelRDFPMathLib20U1/SConscript
22@@ -301,7 +301,7 @@ if processor == 'i386':
23 elif processor == 'arm':
24 cpp_defines['IA32'] = '1'
25 cpp_defines['ia32'] = '1'
26-elif processor == "aarch64":
27+elif processor == "aarch64" or processor == 'arm64':
28 cpp_defines['efi2'] = '1'
29 cpp_defines['EFI2'] = '1'
30 # Using 64 bit little endian
31Index: git/src/third_party/wiredtiger/SConscript
32===================================================================
33--- git.orig/src/third_party/wiredtiger/SConscript
34+++ git/src/third_party/wiredtiger/SConscript
35@@ -139,7 +139,7 @@ condition_map = {
36 'POSIX_HOST' : not env.TargetOSIs('windows'),
37 'WINDOWS_HOST' : env.TargetOSIs('windows'),
38
39- 'ARM64_HOST' : env['TARGET_ARCH'] == 'aarch64',
40+ 'ARM64_HOST' : env['TARGET_ARCH'] in ('aarch64', 'arm64'),
41 'POWERPC_HOST' : env['TARGET_ARCH'] == 'ppc64le',
42 'X86_HOST' : env['TARGET_ARCH'] == 'x86_64',
43 'ZSERIES_HOST' : env['TARGET_ARCH'] == 's390x',
diff --git a/meta-oe/recipes-dbs/mongodb/mongodb/disable-hw-crc32-on-arm64-s390x.patch b/meta-oe/recipes-dbs/mongodb/mongodb/disable-hw-crc32-on-arm64-s390x.patch
new file mode 100644
index 000000000..5c5c20ce3
--- /dev/null
+++ b/meta-oe/recipes-dbs/mongodb/mongodb/disable-hw-crc32-on-arm64-s390x.patch
@@ -0,0 +1,50 @@
1imported from debian
2
3Upstream-Status: Pending
4Index: git/src/third_party/wiredtiger/SConscript
5===================================================================
6--- git.orig/src/third_party/wiredtiger/SConscript
7+++ git/src/third_party/wiredtiger/SConscript
8@@ -169,7 +169,9 @@ if useSnappy:
9 # If not available at runtime, we fall back to software in some cases.
10 #
11 # On zSeries we may disable because SLES 11 kernel doe not support the instructions.
12-if not (env['TARGET_ARCH'] == 's390x' and get_option("use-s390x-crc32") == "off"):
13+# Debian: disable hardware-assisted crc32 on s390x and arm64, as at least the
14+# buildd's do not support the instructions.
15+if env['TARGET_ARCH'] not in ('s390x', 'arm64', 'aarch64'):
16 env.Append(CPPDEFINES=["HAVE_CRC32_HARDWARE"])
17
18 wtlib = env.Library(
19Index: git/src/third_party/wiredtiger/dist/filelist
20===================================================================
21--- git.orig/src/third_party/wiredtiger/dist/filelist
22+++ git/src/third_party/wiredtiger/dist/filelist
23@@ -54,7 +54,6 @@ src/checksum/power8/crc32_wrapper.c POWE
24 src/checksum/software/checksum.c
25 src/checksum/x86/crc32-x86.c X86_HOST
26 src/checksum/zseries/crc32-s390x.c ZSERIES_HOST
27-src/checksum/zseries/crc32le-vx.sx ZSERIES_HOST
28 src/config/config.c
29 src/config/config_api.c
30 src/config/config_check.c
31Index: git/src/third_party/wiredtiger/src/checksum/zseries/crc32-s390x.c
32===================================================================
33--- git.orig/src/third_party/wiredtiger/src/checksum/zseries/crc32-s390x.c
34+++ git/src/third_party/wiredtiger/src/checksum/zseries/crc32-s390x.c
35@@ -78,6 +78,7 @@ unsigned int __wt_crc32c_le(unsigned int
36 return crc; \
37 }
38
39+#if defined(HAVE_CRC32_HARDWARE)
40 /* Main CRC-32 functions */
41 DEFINE_CRC32_VX(__wt_crc32c_le_vx, __wt_crc32c_le_vgfm_16, __wt_crc32c_le)
42
43@@ -90,6 +91,7 @@ __wt_checksum_hw(const void *chunk, size
44 {
45 return (~__wt_crc32c_le_vx(0xffffffff, chunk, len));
46 }
47+#endif
48
49 #endif
50
diff --git a/meta-oe/recipes-dbs/mongodb/mongodb_git.bb b/meta-oe/recipes-dbs/mongodb/mongodb_git.bb
new file mode 100644
index 000000000..8acbf071b
--- /dev/null
+++ b/meta-oe/recipes-dbs/mongodb/mongodb_git.bb
@@ -0,0 +1,77 @@
1SUMMARY = "mongodb"
2LICENSE = "AGPL-3.0 & Apache-2.0 & Zlib"
3LIC_FILES_CHKSUM = "file://GNU-AGPL-3.0.txt;md5=73f1eb20517c55bf9493b7dd6e480788 \
4 file://APACHE-2.0.txt;md5=3b83ef96387f14655fc854ddc3c6bd57"
5
6DEPENDS = "openssl libpcre libpcap zlib python boost"
7
8inherit scons dos2unix siteinfo
9
10PV = "3.4.6+git${SRCPV}"
11SRCREV = "c55eb86ef46ee7aede3b1e2a5d184a7df4bfb5b5"
12SRC_URI = "git://github.com/mongodb/mongo.git;branch=v3.4 \
13 file://0001-Tell-scons-to-use-build-settings-from-environment-va.patch \
14 file://0001-mongo-Add-using-std-string.patch \
15 file://0002-d_state.cpp-Add-missing-dependenncy-on-local_shardin.patch \
16 file://0001-Use-long-long-instead-of-int64_t.patch \
17 file://0001-Use-__GLIBC__-to-control-use-of-gnu_get_libc_version.patch \
18 file://0001-Use-strerror_r-only-on-glibc-systems.patch \
19 file://0002-Add-a-definition-for-the-macro-__ELF_NATIVE_CLASS.patch \
20 file://0003-Conditionalize-glibc-specific-strerror_r.patch \
21 file://arm64-support.patch \
22 file://0001-IntelRDFPMathLib20U1-Check-for-__DEFINED_wchar_t.patch \
23 file://disable-hw-crc32-on-arm64-s390x.patch \
24 "
25SRC_URI_append_libc-musl ="\
26 file://0004-wiredtiger-Disable-strtouq-on-musl.patch \
27 "
28S = "${WORKDIR}/git"
29
30# Wiredtiger supports only 64-bit platforms
31PACKAGECONFIG_x86-64 ??= "tcmalloc wiredtiger"
32PACKAGECONFIG_aarch64 ??= "tcmalloc wiredtiger"
33PACKAGECONFIG ??= "tcmalloc"
34# gperftools compilation fails for arm below v7 because of missing support of
35# dmb operation. So we use system-allocator instead of tcmalloc
36PACKAGECONFIG_remove_armv6 = "tcmalloc"
37PACKAGECONFIG_remove_libc-musl = "tcmalloc"
38
39#std::current_exception is undefined for arm < v6
40COMPATIBLE_MACHINE_armv4 = "(!.*armv4).*"
41COMPATIBLE_MACHINE_armv5 = "(!.*armv5).*"
42COMPATIBLE_MACHINE_armv7a = "(!.*armv7a).*"
43COMPATIBLE_MACHINE_armv7ve = "(!.*armv7ve).*"
44COMPATIBLE_MACHINE_mips64 = "(!.*mips64).*"
45COMPATIBLE_MACHINE_powerpc = "(!.*ppc).*"
46
47PACKAGECONFIG[tcmalloc] = "--use-system-tcmalloc,--allocator=system,gperftools,"
48PACKAGECONFIG[wiredtiger] = "--wiredtiger=on,--wiredtiger=off,,"
49
50EXTRA_OESCONS = "--prefix=${D}${prefix} \
51 LIBPATH=${STAGING_LIBDIR} \
52 LINKFLAGS='${LDFLAGS}' \
53 CXXFLAGS='${CXXFLAGS}' \
54 TARGET_ARCH=${TARGET_ARCH} \
55 --ssl \
56 --disable-warnings-as-errors \
57 --use-system-pcre \
58 --use-system-zlib \
59 --js-engine=none \
60 --nostrip \
61 --endian=${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'le', 'little', 'big', d)} \
62 ${PACKAGECONFIG_CONFARGS} \
63 mongod mongos"
64
65do_configure_prepend() {
66 # tests use hex floats, not supported in plain C++
67 sed -e 's|-std=c++11|-std=gnu++11|g' -i ${S}/SConstruct
68}
69scons_do_compile() {
70 ${STAGING_BINDIR_NATIVE}/scons ${PARALLEL_MAKE} ${EXTRA_OESCONS} || \
71 die "scons build execution failed."
72}
73
74scons_do_install() {
75 ${STAGING_BINDIR_NATIVE}/scons install ${EXTRA_OESCONS}|| \
76 die "scons install execution failed."
77}