mongodb: fix crossbuild, add archlinuxarm patches.

This commit is contained in:
Enno Boland 2016-01-14 05:36:19 +01:00
parent 275909fab4
commit 42a8c37587
6 changed files with 2219 additions and 3 deletions

View File

@ -0,0 +1,25 @@
From b552e3b3fa87e3f374d603e065785734c5b36e55 Mon Sep 17 00:00:00 2001
From: Kevin Mihelich <kevin@archlinuxarm.org>
Date: Mon, 28 Dec 2015 13:39:06 -0700
Subject: [PATCH 5/5] fix options_parser segfault
---
src/mongo/util/options_parser/option_section.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git src/mongo/util/options_parser/option_section.cpp src/mongo/util/options_parser/option_section.cpp
index b499025..d9f5046 100644
--- src/mongo/util/options_parser/option_section.cpp
+++ src/mongo/util/options_parser/option_section.cpp
@@ -484,7 +484,7 @@ Status OptionSection::getDefaults(std::map<Key, Value>* values) const {
std::list<OptionDescription>::const_iterator oditerator;
for (oditerator = _options.begin(); oditerator != _options.end(); oditerator++) {
if (!oditerator->_default.isEmpty()) {
- (*values)[oditerator->_dottedName] = oditerator->_default;
+ (*((values->insert(make_pair(oditerator->_dottedName, std::map<Key, Value>::mapped_type()))).first)).second = oditerator->_default;
}
}
--
2.6.4

View File

@ -0,0 +1,34 @@
From b54faf431153535ddfa047f3ed45780b7cac5781 Mon Sep 17 00:00:00 2001
From: Aliaksey Kandratsenka <alk@tut.by>
Date: Sat, 13 Jun 2015 21:28:28 -0700
Subject: [PATCH 2/5] issue-693: convert sys_futex to it's 6-arg form
Because sys_futex actually takes 6 args in more recent kernels (even
though last two args are unused for FUTEX_{WAKE,WAIT}.
This is patch contributed by user spotrh.
---
src/third_party/gperftools-2.2/src/base/linux_syscall_support.h | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git src/third_party/gperftools-2.2/src/base/linux_syscall_support.h src/third_party/gperftools-2.2/src/base/linux_syscall_support.h
index 9b6c35d..c8f8f59 100644
--- src/third_party/gperftools-2.2/src/base/linux_syscall_support.h
+++ src/third_party/gperftools-2.2/src/base/linux_syscall_support.h
@@ -2094,9 +2094,11 @@ struct kernel_stat {
int, c, long, a)
LSS_INLINE _syscall2(int, fstat, int, f,
struct kernel_stat*, b)
- LSS_INLINE _syscall4(int, futex, int*, a,
+ LSS_INLINE _syscall6(int, futex, int*, a,
int, o, int, v,
- struct kernel_timespec*, t)
+ struct kernel_timespec*, t,
+ int*, a2,
+ int, v3)
#ifdef __NR_getdents64
LSS_INLINE _syscall3(int, getdents64, int, f,
struct kernel_dirent64*, d, int, c)
--
2.6.4

View File

@ -0,0 +1,68 @@
From 00c5a75b1dd59f27c18fa04ad911b56b9c6ac17e Mon Sep 17 00:00:00 2001
From: Aliaksey Kandratsenka <alk@tut.by>
Date: Sat, 13 Jun 2015 21:35:06 -0700
Subject: [PATCH 3/5] issue-693: enable futex usage on arm
This patch was contributed by user spotrh.
---
.../gperftools-2.2/src/base/linux_syscall_support.h | 1 -
.../gperftools-2.2/src/base/spinlock_linux-inl.h | 15 ++++++---------
2 files changed, 6 insertions(+), 10 deletions(-)
diff --git src/third_party/gperftools-2.2/src/base/linux_syscall_support.h src/third_party/gperftools-2.2/src/base/linux_syscall_support.h
index c8f8f59..56b8fac 100644
--- src/third_party/gperftools-2.2/src/base/linux_syscall_support.h
+++ src/third_party/gperftools-2.2/src/base/linux_syscall_support.h
@@ -83,7 +83,6 @@
* sys_fcntl(
* sys_fstat(
* sys_futex(
- * sys_futex1(
* sys_getcpu(
* sys_getdents64(
* sys_getppid(
diff --git src/third_party/gperftools-2.2/src/base/spinlock_linux-inl.h src/third_party/gperftools-2.2/src/base/spinlock_linux-inl.h
index 86d4d04..aadf62a 100644
--- src/third_party/gperftools-2.2/src/base/spinlock_linux-inl.h
+++ src/third_party/gperftools-2.2/src/base/spinlock_linux-inl.h
@@ -51,15 +51,10 @@ static struct InitModule {
int x = 0;
// futexes are ints, so we can use them only when
// that's the same size as the lockword_ in SpinLock.
-#ifdef __arm__
- // ARM linux doesn't support sys_futex1(void*, int, int, struct timespec*);
- have_futex = 0;
-#else
have_futex = (sizeof (Atomic32) == sizeof (int) &&
- sys_futex(&x, FUTEX_WAKE, 1, 0) >= 0);
-#endif
+ sys_futex(&x, FUTEX_WAKE, 1, NULL, NULL, 0) >= 0);
if (have_futex &&
- sys_futex(&x, FUTEX_WAKE | futex_private_flag, 1, 0) < 0) {
+ sys_futex(&x, FUTEX_WAKE | futex_private_flag, 1, NULL, NULL, 0) < 0) {
futex_private_flag = 0;
}
}
@@ -85,7 +80,8 @@ void SpinLockDelay(volatile Atomic32 *w, int32 value, int loop) {
tm.tv_nsec *= 16; // increase the delay; we expect explicit wakeups
sys_futex(reinterpret_cast<int *>(const_cast<Atomic32 *>(w)),
FUTEX_WAIT | futex_private_flag,
- value, reinterpret_cast<struct kernel_timespec *>(&tm));
+ value, reinterpret_cast<struct kernel_timespec *>(&tm),
+ NULL, 0);
} else {
nanosleep(&tm, NULL);
}
@@ -96,7 +92,8 @@ void SpinLockDelay(volatile Atomic32 *w, int32 value, int loop) {
void SpinLockWake(volatile Atomic32 *w, bool all) {
if (have_futex) {
sys_futex(reinterpret_cast<int *>(const_cast<Atomic32 *>(w)),
- FUTEX_WAKE | futex_private_flag, all? INT_MAX : 1, 0);
+ FUTEX_WAKE | futex_private_flag, all? INT_MAX : 1,
+ NULL, NULL, 0);
}
}
--
2.6.4

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,26 @@
From 4ed0f5103bd25f5bdaca5b11bb69e87cd9746f9f Mon Sep 17 00:00:00 2001
From: Kevin Mihelich <kevin@archlinuxarm.org>
Date: Sun, 27 Dec 2015 09:13:09 -0700
Subject: [PATCH 4/5] use gnu++11 instead of c++11
---
src/third_party/gperftools-2.2/SConscript | 3 +++
1 file changed, 3 insertions(+)
diff --git src/third_party/gperftools-2.2/SConscript src/third_party/gperftools-2.2/SConscript
index 2948eaa..f6d5c9e 100644
--- src/third_party/gperftools-2.2/SConscript
+++ src/third_party/gperftools-2.2/SConscript
@@ -102,6 +102,9 @@ def removeIfPresent(lst, item):
for to_remove in ['-Werror', "-Wsign-compare","-Wall"]:
removeIfPresent(env['CCFLAGS'], to_remove)
+removeIfPresent(env['CXXFLAGS'], "-std=c++11")
+env.Append( CXXFLAGS=["-std=gnu++11"] )
+
env.Library(
target='tcmalloc_minimal',
source=files,
--
2.6.4

View File

@ -1,7 +1,7 @@
# Template file for 'mongodb'
pkgname=mongodb
version=3.2.0
revision=3
revision=4
hostmakedepends="scons"
makedepends="boost-devel pcre-devel snappy-devel libressl-devel libpcap-devel
gperftools-devel libsasl-devel yaml-cpp-devel valgrind-devel"
@ -29,12 +29,13 @@ _scons_args=" --use-system-boost \
--nostrip \
--disable-warnings-as-errors"
case "$XBPS_TARGET_MACHINE" in
i686*) _scons_args+=" --wiredtiger=off";;
x86_64*|aarch64*) _scons_args+=" --wiredtiger=on";;
*) _scons_args+=" --wiredtiger=off";;
esac
# ETOOHUGE
nodebug=1
nocross="http://build.voidlinux.eu/builders/armv7l_builder/builds/10684/steps/shell_3/logs/stdio"
#nocross="http://build.voidlinux.eu/builders/armv7l_builder/builds/10684/steps/shell_3/logs/stdio"
do_configure() {
find . -name SConstruct -print0 | xargs -0 sed -i "s/-Werror/-Wno-error/g"