diff mbox series

[oe,meta-oe,2/2] mongodb: Disable for armv7

Message ID 20170902190205.18257-2-raj.khem@gmail.com
State New
Headers show
Series [oe,meta-oe,1/2] gperftools: Fix build with musl | expand

Commit Message

Khem Raj Sept. 2, 2017, 7:02 p.m. UTC
32bit arm is not supported
Add patches to compile with musl

Signed-off-by: Khem Raj <raj.khem@gmail.com>

---
 ...__-to-control-use-of-gnu_get_libc_version.patch | 50 ++++++++++++++++
 .../0001-Use-long-long-instead-of-int64_t.patch    | 67 ++++++++++++++++++++++
 meta-oe/recipes-support/mongodb/mongodb_git.bb     |  8 +++
 3 files changed, 125 insertions(+)
 create mode 100644 meta-oe/recipes-support/mongodb/mongodb/0001-Use-__GLIBC__-to-control-use-of-gnu_get_libc_version.patch
 create mode 100644 meta-oe/recipes-support/mongodb/mongodb/0001-Use-long-long-instead-of-int64_t.patch

-- 
2.14.1

-- 
_______________________________________________
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
diff mbox series

Patch

diff --git a/meta-oe/recipes-support/mongodb/mongodb/0001-Use-__GLIBC__-to-control-use-of-gnu_get_libc_version.patch b/meta-oe/recipes-support/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-support/mongodb/mongodb/0001-Use-__GLIBC__-to-control-use-of-gnu_get_libc_version.patch
@@ -0,0 +1,50 @@ 
+From 3eed8388b49d5d3cbc2db74fee1b017eb4b40d0a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 2 Sep 2017 10:06:24 -0700
+Subject: [PATCH] Use __GLIBC__ to control use of gnu_get_libc_version
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+ src/mongo/util/processinfo_linux.cpp | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/src/mongo/util/processinfo_linux.cpp b/src/mongo/util/processinfo_linux.cpp
+index 910015215e..bf8c1ffd15 100644
+--- a/src/mongo/util/processinfo_linux.cpp
++++ b/src/mongo/util/processinfo_linux.cpp
+@@ -40,7 +40,7 @@
+ #include <sys/mman.h>
+ #include <sys/utsname.h>
+ #include <unistd.h>
+-#ifdef __UCLIBC__
++#ifndef __GLIBC__
+ #include <features.h>
+ #else
+ #include <gnu/libc-version.h>
+@@ -451,11 +451,13 @@ double ProcessInfo::getSystemMemoryPressurePercentage() {
+ }
+ 
+ void ProcessInfo::getExtraInfo(BSONObjBuilder& info) {
++#if defined(__GLIBC__)
+     LinuxProc p(_pid);
+     if (p._maj_flt <= std::numeric_limits<long long>::max())
+         info.appendNumber("page_faults", static_cast<long long>(p._maj_flt));
+     else
+         info.appendNumber("page_faults", static_cast<double>(p._maj_flt));
++#endif
+ }
+ 
+ /**
+@@ -491,7 +493,7 @@ void ProcessInfo::SystemInfo::collectSystemInfo() {
+     stringstream ss;
+     ss << "uClibc-" << __UCLIBC_MAJOR__ << "." << __UCLIBC_MINOR__ << "." << __UCLIBC_SUBLEVEL__;
+     bExtra.append("libcVersion", ss.str());
+-#else
++#elif defined(__GLIBC__)
+     bExtra.append("libcVersion", gnu_get_libc_version());
+ #endif
+     if (!verSig.empty())
+-- 
+2.14.1
+
diff --git a/meta-oe/recipes-support/mongodb/mongodb/0001-Use-long-long-instead-of-int64_t.patch b/meta-oe/recipes-support/mongodb/mongodb/0001-Use-long-long-instead-of-int64_t.patch
new file mode 100644
index 000000000..c43beb4c1
--- /dev/null
+++ b/meta-oe/recipes-support/mongodb/mongodb/0001-Use-long-long-instead-of-int64_t.patch
@@ -0,0 +1,67 @@ 
+From a4951489d649c2b609cbb80f6cfb49fdcad8bd43 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 2 Sep 2017 10:03:37 -0700
+Subject: [PATCH] Use long long instead of int64_t
+
+Fixes
+error: call to member function 'appendNumber' is ambiguous
+since this function expects long long as parameter and not int64_t
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+ src/mongo/util/procparser.cpp | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/src/mongo/util/procparser.cpp b/src/mongo/util/procparser.cpp
+index 36f2ae0254..2c164bcbf3 100644
+--- a/src/mongo/util/procparser.cpp
++++ b/src/mongo/util/procparser.cpp
+@@ -260,7 +260,7 @@ Status parseProcStat(const std::vector<StringData>& keys,
+ 
+                     StringData stringValue((*partIt).begin(), (*partIt).end() - (*partIt).begin());
+ 
+-                    uint64_t value;
++                    long long  value;
+ 
+                     if (!parseNumberFromString(stringValue, &value).isOK()) {
+                         value = 0;
+@@ -272,7 +272,7 @@ Status parseProcStat(const std::vector<StringData>& keys,
+             } else {
+                 StringData stringValue((*partIt).begin(), (*partIt).end() - (*partIt).begin());
+ 
+-                uint64_t value;
++                long long value;
+ 
+                 if (!parseNumberFromString(stringValue, &value).isOK()) {
+                     value = 0;
+@@ -365,7 +365,7 @@ Status parseProcMemInfo(const std::vector<StringData>& keys,
+ 
+             StringData stringValue((*partIt).begin(), (*partIt).end());
+ 
+-            uint64_t value;
++            long long value;
+ 
+             if (!parseNumberFromString(stringValue, &value).isOK()) {
+                 value = 0;
+@@ -426,7 +426,7 @@ Status parseProcDiskStats(const std::vector<StringData>& disks,
+                           StringData data,
+                           BSONObjBuilder* builder) {
+     bool foundKeys = false;
+-    std::vector<uint64_t> stats;
++    std::vector<long long> stats;
+     stats.reserve(kDiskFieldCount);
+ 
+     using string_split_iterator = boost::split_iterator<StringData::const_iterator>;
+@@ -501,7 +501,7 @@ Status parseProcDiskStats(const std::vector<StringData>& disks,
+ 
+                 StringData stringValue((*partIt).begin(), (*partIt).end());
+ 
+-                uint64_t value;
++                long long value;
+ 
+                 if (!parseNumberFromString(stringValue, &value).isOK()) {
+                     value = 0;
+-- 
+2.14.1
+
diff --git a/meta-oe/recipes-support/mongodb/mongodb_git.bb b/meta-oe/recipes-support/mongodb/mongodb_git.bb
index b38641cff..1f7af2228 100644
--- a/meta-oe/recipes-support/mongodb/mongodb_git.bb
+++ b/meta-oe/recipes-support/mongodb/mongodb_git.bb
@@ -13,6 +13,8 @@  SRC_URI = "git://github.com/mongodb/mongo.git;branch=v3.4 \
            file://0001-Tell-scons-to-use-build-settings-from-environment-va.patch \
            file://0001-mongo-Add-using-std-string.patch \
            file://0002-d_state.cpp-Add-missing-dependenncy-on-local_shardin.patch \
+           file://0001-Use-long-long-instead-of-int64_t.patch \
+           file://0001-Use-__GLIBC__-to-control-use-of-gnu_get_libc_version.patch \
            "
 
 S = "${WORKDIR}/git"
@@ -28,6 +30,8 @@  PACKAGECONFIG_remove_armv6 = "tcmalloc"
 #std::current_exception is undefined for arm < v6
 COMPATIBLE_MACHINE_armv4 = "(!.*armv4).*"
 COMPATIBLE_MACHINE_armv5 = "(!.*armv5).*"
+COMPATIBLE_MACHINE_armv7a = "(!.*armv7a).*"
+COMPATIBLE_MACHINE_armv7ve = "(!.*armv7ve).*"
 COMPATIBLE_MACHINE_mips64 = "(!.*mips64).*"
 COMPATIBLE_MACHINE_powerpc = "(!.*ppc).*"
 
@@ -48,6 +52,10 @@  EXTRA_OESCONS = "--prefix=${D}${prefix} \
                  ${PACKAGECONFIG_CONFARGS} \
                  mongod mongos"
 
+do_configure_prepend() {
+        # tests use hex floats, not supported in plain C++
+        sed -e 's|-std=c++11|-std=gnu++11|g' -i ${S}/SConstruct
+}
 scons_do_compile() {
         ${STAGING_BINDIR_NATIVE}/scons ${PARALLEL_MAKE} ${EXTRA_OESCONS} || \
         die "scons build execution failed."