summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/mongodb
diff options
context:
space:
mode:
authorKoen Kooi <koen.kooi@linaro.org>2014-04-14 15:04:18 +0200
committerMartin Jansa <Martin.Jansa@gmail.com>2014-04-20 11:24:20 +0200
commit4aa1d4c173f36a7b4c46d11e66c40728a6f276e5 (patch)
tree86c4eebcbcbc00779ee30dc70fad2ef76118a2b7 /meta-oe/recipes-support/mongodb
parent615f805ca0f322dcbe2659fcd942e4c2dba4c4a3 (diff)
downloadmeta-openembedded-4aa1d4c173f36a7b4c46d11e66c40728a6f276e5.tar.gz
mongodb: update to 2.6
Also fix build on armv5 Signed-off-by: Koen Kooi <koen.kooi@linaro.org> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe/recipes-support/mongodb')
-rw-r--r--meta-oe/recipes-support/mongodb/mongodb/0001-Make-it-possible-to-disable-the-use-of-v8.patch23
-rw-r--r--meta-oe/recipes-support/mongodb/mongodb/0002-Fix-linking-when-scripting-is-disabled.patch6
-rw-r--r--meta-oe/recipes-support/mongodb/mongodb/0003-Do-not-build-mongo-binary-when-scripting-is-disabled.patch18
-rw-r--r--meta-oe/recipes-support/mongodb/mongodb/0004-replace-os.uname-with-os.getenv-OE_TARGET_ARCH.patch (renamed from meta-oe/recipes-support/mongodb/mongodb/0001-replace-os.uname-with-os.getenv-TARGET_ARCH.patch)14
-rw-r--r--meta-oe/recipes-support/mongodb/mongodb/0005-GCC-4.7-supports-atomic-ops-for-armv5-and-up-but-onl.patch127
-rw-r--r--meta-oe/recipes-support/mongodb/mongodb_git.bb9
6 files changed, 163 insertions, 34 deletions
diff --git a/meta-oe/recipes-support/mongodb/mongodb/0001-Make-it-possible-to-disable-the-use-of-v8.patch b/meta-oe/recipes-support/mongodb/mongodb/0001-Make-it-possible-to-disable-the-use-of-v8.patch
index 311ac6cad..650389e16 100644
--- a/meta-oe/recipes-support/mongodb/mongodb/0001-Make-it-possible-to-disable-the-use-of-v8.patch
+++ b/meta-oe/recipes-support/mongodb/mongodb/0001-Make-it-possible-to-disable-the-use-of-v8.patch
@@ -1,21 +1,21 @@
1From bffde38f3b3d6285019e38a30c4573326e1dd2ea Mon Sep 17 00:00:00 2001 1From f1bd00e7f54aad6479bc809c27d5cd3c2fb993eb Mon Sep 17 00:00:00 2001
2From: Michael Hudson-Doyle <michael.hudson@linaro.org> 2From: Michael Hudson-Doyle <michael.hudson@linaro.org>
3Date: Fri, 20 Dec 2013 11:10:43 +1300 3Date: Fri, 20 Dec 2013 11:10:43 +1300
4Subject: [PATCH 1/3] Make it possible to disable the use of v8. 4Subject: [PATCH 1/5] Make it possible to disable the use of v8.
5 5
6Currently v8 is always built in, no matter what you pass to scons. 6Currently v8 is always built in, no matter what you pass to scons.
7 7
8This removes the (useless) --usev8 flag for scons and replaces it with a 8This removes the (useless) --usev8 flag for scons and replaces it with a
9--disable-scripting option instead. 9--disable-scripting option instead.
10--- 10---
11 SConstruct | 8 +++++--- 11 SConstruct | 9 ++++++---
12 1 file changed, 5 insertions(+), 3 deletions(-) 12 1 file changed, 6 insertions(+), 3 deletions(-)
13 13
14diff --git a/SConstruct b/SConstruct 14diff --git a/SConstruct b/SConstruct
15index fd92fe4..1f14083 100644 15index 3886d1b..6e0ef3b 100644
16--- a/SConstruct 16--- a/SConstruct
17+++ b/SConstruct 17+++ b/SConstruct
18@@ -222,7 +222,7 @@ add_option( "asio" , "Use Asynchronous IO (NOT READY YET)" , 0 , True ) 18@@ -225,7 +225,7 @@ add_option( "asio" , "Use Asynchronous IO (NOT READY YET)" , 0 , True )
19 add_option( "ssl" , "Enable SSL" , 0 , True ) 19 add_option( "ssl" , "Enable SSL" , 0 , True )
20 20
21 # library choices 21 # library choices
@@ -24,7 +24,7 @@ index fd92fe4..1f14083 100644
24 add_option( "libc++", "use libc++ (experimental, requires clang)", 0, True ) 24 add_option( "libc++", "use libc++ (experimental, requires clang)", 0, True )
25 25
26 # mongo feature options 26 # mongo feature options
27@@ -439,7 +439,7 @@ static = has_option( "static" ) 27@@ -442,7 +442,7 @@ static = has_option( "static" )
28 28
29 noshell = has_option( "noshell" ) 29 noshell = has_option( "noshell" )
30 30
@@ -33,17 +33,18 @@ index fd92fe4..1f14083 100644
33 33
34 asio = has_option( "asio" ) 34 asio = has_option( "asio" )
35 35
36@@ -599,7 +599,9 @@ if has_option( "durableDefaultOn" ): 36@@ -600,7 +600,10 @@ if has_option( "durableDefaultOn" ):
37 if has_option( "durableDefaultOff" ): 37 if has_option( "durableDefaultOff" ):
38 env.Append( CPPDEFINES=[ "_DURABLEDEFAULTOFF" ] ) 38 env.Append( CPPDEFINES=[ "_DURABLEDEFAULTOFF" ] )
39 39
40-if ( not ( usev8 or justClientLib) ): 40-usev8 = True
41+if disable_scripting or justClientLib: 41+if disable_scripting or justClientLib:
42+ usev8 = False 42+ usev8 = False
43+else: 43+else:
44 usev8 = True 44+ usev8 = True
45 45
46 extraLibPlaces = [] 46 extraLibPlaces = []
47
47-- 48--
481.8.4.2 491.9.0
49 50
diff --git a/meta-oe/recipes-support/mongodb/mongodb/0002-Fix-linking-when-scripting-is-disabled.patch b/meta-oe/recipes-support/mongodb/mongodb/0002-Fix-linking-when-scripting-is-disabled.patch
index d8d5a3bf7..b4388d8f0 100644
--- a/meta-oe/recipes-support/mongodb/mongodb/0002-Fix-linking-when-scripting-is-disabled.patch
+++ b/meta-oe/recipes-support/mongodb/mongodb/0002-Fix-linking-when-scripting-is-disabled.patch
@@ -1,7 +1,7 @@
1From 52d68642205626cad3bac3a53e269c765ccff676 Mon Sep 17 00:00:00 2001 1From 5b22f64a2e2237082d2733698b07147d27b09ad2 Mon Sep 17 00:00:00 2001
2From: Michael Hudson-Doyle <michael.hudson@linaro.org> 2From: Michael Hudson-Doyle <michael.hudson@linaro.org>
3Date: Fri, 20 Dec 2013 12:28:27 +1300 3Date: Fri, 20 Dec 2013 12:28:27 +1300
4Subject: [PATCH 2/3] Fix linking when scripting is disabled. 4Subject: [PATCH 2/5] Fix linking when scripting is disabled.
5 5
6--- 6---
7 src/mongo/scripting/engine_none.cpp | 4 ++++ 7 src/mongo/scripting/engine_none.cpp | 4 ++++
@@ -21,5 +21,5 @@ index f5c7109..9ae9d57 100644
21+ } 21+ }
22 } 22 }
23-- 23--
241.8.4.2 241.9.0
25 25
diff --git a/meta-oe/recipes-support/mongodb/mongodb/0003-Do-not-build-mongo-binary-when-scripting-is-disabled.patch b/meta-oe/recipes-support/mongodb/mongodb/0003-Do-not-build-mongo-binary-when-scripting-is-disabled.patch
index 5c314b189..016ac3584 100644
--- a/meta-oe/recipes-support/mongodb/mongodb/0003-Do-not-build-mongo-binary-when-scripting-is-disabled.patch
+++ b/meta-oe/recipes-support/mongodb/mongodb/0003-Do-not-build-mongo-binary-when-scripting-is-disabled.patch
@@ -1,7 +1,7 @@
1From 1f8e10747af3988e8ddee609bea990f622dd746a Mon Sep 17 00:00:00 2001 1From eab4316597a8e9e7bbf845a054564c6daa4a95b7 Mon Sep 17 00:00:00 2001
2From: Michael Hudson-Doyle <michael.hudson@linaro.org> 2From: Michael Hudson-Doyle <michael.hudson@linaro.org>
3Date: Wed, 22 Jan 2014 13:53:10 +1300 3Date: Wed, 22 Jan 2014 13:53:10 +1300
4Subject: [PATCH 3/3] * Do not build 'mongo' binary when scripting is disabled 4Subject: [PATCH 3/5] * Do not build 'mongo' binary when scripting is disabled
5 * Do not build the jstests when scripting is disabled 5 * Do not build the jstests when scripting is disabled
6 6
7--- 7---
@@ -10,10 +10,10 @@ Subject: [PATCH 3/3] * Do not build 'mongo' binary when scripting is disabled
10 2 files changed, 9 insertions(+), 3 deletions(-) 10 2 files changed, 9 insertions(+), 3 deletions(-)
11 11
12diff --git a/SConstruct b/SConstruct 12diff --git a/SConstruct b/SConstruct
13index 1f14083..a69cf0a 100644 13index 6e0ef3b..c84a669 100644
14--- a/SConstruct 14--- a/SConstruct
15+++ b/SConstruct 15+++ b/SConstruct
16@@ -437,10 +437,13 @@ else: 16@@ -440,10 +440,13 @@ else:
17 17
18 static = has_option( "static" ) 18 static = has_option( "static" )
19 19
@@ -29,16 +29,16 @@ index 1f14083..a69cf0a 100644
29 asio = has_option( "asio" ) 29 asio = has_option( "asio" )
30 30
31 usePCH = has_option( "usePCH" ) 31 usePCH = has_option( "usePCH" )
32@@ -1671,6 +1674,7 @@ Export("get_option") 32@@ -1662,6 +1665,7 @@ Export("get_option")
33 Export("has_option use_system_version_of_library") 33 Export("has_option use_system_version_of_library")
34 Export("installSetup mongoCodeVersion") 34 Export("mongoCodeVersion")
35 Export("usev8") 35 Export("usev8")
36+Export("disable_scripting") 36+Export("disable_scripting")
37 Export("darwin windows solaris linux freebsd nix") 37 Export("darwin windows solaris linux freebsd nix")
38 Export('module_sconscripts') 38 Export('module_sconscripts')
39 Export("debugBuild optBuild") 39 Export("debugBuild optBuild")
40diff --git a/src/mongo/SConscript b/src/mongo/SConscript 40diff --git a/src/mongo/SConscript b/src/mongo/SConscript
41index d84267e..dc0ca3a 100644 41index 58f8406..b4379e7 100644
42--- a/src/mongo/SConscript 42--- a/src/mongo/SConscript
43+++ b/src/mongo/SConscript 43+++ b/src/mongo/SConscript
44@@ -6,6 +6,7 @@ import os 44@@ -6,6 +6,7 @@ import os
@@ -49,7 +49,7 @@ index d84267e..dc0ca3a 100644
49 Import("env") 49 Import("env")
50 Import("shellEnv") 50 Import("shellEnv")
51 Import("testEnv") 51 Import("testEnv")
52@@ -1022,7 +1023,8 @@ test = testEnv.Install( 52@@ -1043,7 +1044,8 @@ test = testEnv.Install(
53 [ f for f in Glob("dbtests/*.cpp") 53 [ f for f in Glob("dbtests/*.cpp")
54 if not str(f).endswith('framework.cpp') and 54 if not str(f).endswith('framework.cpp') and
55 not str(f).endswith('framework_options.cpp') and 55 not str(f).endswith('framework_options.cpp') and
@@ -60,5 +60,5 @@ index d84267e..dc0ca3a 100644
60 "mutable_bson_test_utils", 60 "mutable_bson_test_utils",
61 "mongocommon", 61 "mongocommon",
62-- 62--
631.8.4.2 631.9.0
64 64
diff --git a/meta-oe/recipes-support/mongodb/mongodb/0001-replace-os.uname-with-os.getenv-TARGET_ARCH.patch b/meta-oe/recipes-support/mongodb/mongodb/0004-replace-os.uname-with-os.getenv-OE_TARGET_ARCH.patch
index 547c3bd48..ade7ec02a 100644
--- a/meta-oe/recipes-support/mongodb/mongodb/0001-replace-os.uname-with-os.getenv-TARGET_ARCH.patch
+++ b/meta-oe/recipes-support/mongodb/mongodb/0004-replace-os.uname-with-os.getenv-OE_TARGET_ARCH.patch
@@ -1,7 +1,7 @@
1From ef482650fb6d990e4953104d7141d9a0fa4c872f Mon Sep 17 00:00:00 2001 1From d02f33d860f2d11f71e9056782a2e75603d6ec25 Mon Sep 17 00:00:00 2001
2From: Koen Kooi <koen.kooi@linaro.org> 2From: Koen Kooi <koen.kooi@linaro.org>
3Date: Tue, 4 Feb 2014 10:56:35 +0100 3Date: Tue, 4 Feb 2014 10:56:35 +0100
4Subject: [PATCH] replace os.uname with os.getenv(OE_TARGET_ARCH) 4Subject: [PATCH 4/5] replace os.uname with os.getenv(OE_TARGET_ARCH)
5 5
6This fixes crosscompilation 6This fixes crosscompilation
7 7
@@ -12,10 +12,10 @@ Upstream-Status: Inappropiate [OE specific]
12 1 file changed, 4 insertions(+), 4 deletions(-) 12 1 file changed, 4 insertions(+), 4 deletions(-)
13 13
14diff --git a/SConstruct b/SConstruct 14diff --git a/SConstruct b/SConstruct
15index 4f26be7..a353323 100644 15index c84a669..05e2ea0 100644
16--- a/SConstruct 16--- a/SConstruct
17+++ b/SConstruct 17+++ b/SConstruct
18@@ -265,9 +265,9 @@ add_option( "pch" , "use precompiled headers to speed up the build (experimental 18@@ -257,9 +257,9 @@ add_option( "pch" , "use precompiled headers to speed up the build (experimental
19 add_option( "distcc" , "use distcc for distributing builds" , 0 , False ) 19 add_option( "distcc" , "use distcc for distributing builds" , 0 , False )
20 20
21 # debugging/profiling help 21 # debugging/profiling help
@@ -27,7 +27,7 @@ index 4f26be7..a353323 100644
27 defaultAllocator = 'tcmalloc' 27 defaultAllocator = 'tcmalloc'
28 else: 28 else:
29 defaultAllocator = 'system' 29 defaultAllocator = 'system'
30@@ -673,7 +673,7 @@ if has_option( "full" ): 30@@ -633,7 +633,7 @@ if has_option( "extralib" ):
31 # ---- other build setup ----- 31 # ---- other build setup -----
32 32
33 if "uname" in dir(os): 33 if "uname" in dir(os):
@@ -36,7 +36,7 @@ index 4f26be7..a353323 100644
36 else: 36 else:
37 processor = "i386" 37 processor = "i386"
38 38
39@@ -702,7 +702,7 @@ elif linux: 39@@ -662,7 +662,7 @@ elif linux:
40 40
41 env.Append( LIBS=['m'] ) 41 env.Append( LIBS=['m'] )
42 42
@@ -46,5 +46,5 @@ index 4f26be7..a353323 100644
46 nixLibPrefix = "lib64" 46 nixLibPrefix = "lib64"
47 env.Append( EXTRALIBPATH=["/usr/lib64" , "/lib64" ] ) 47 env.Append( EXTRALIBPATH=["/usr/lib64" , "/lib64" ] )
48-- 48--
491.8.4.2 491.9.0
50 50
diff --git a/meta-oe/recipes-support/mongodb/mongodb/0005-GCC-4.7-supports-atomic-ops-for-armv5-and-up-but-onl.patch b/meta-oe/recipes-support/mongodb/mongodb/0005-GCC-4.7-supports-atomic-ops-for-armv5-and-up-but-onl.patch
new file mode 100644
index 000000000..490d56485
--- /dev/null
+++ b/meta-oe/recipes-support/mongodb/mongodb/0005-GCC-4.7-supports-atomic-ops-for-armv5-and-up-but-onl.patch
@@ -0,0 +1,127 @@
1From e31f85e6915d4bf6ed76c5da71c235525fa4ecc3 Mon Sep 17 00:00:00 2001
2From: Koen Kooi <koen.kooi@linaro.org>
3Date: Mon, 14 Apr 2014 10:29:42 +0200
4Subject: [PATCH 5/5] GCC 4.7+ supports atomic ops for armv5 and up, but only
5 exports the functions for armv6 and up. This patch works around the linker
6 problems associated with that.
7
8Forward ported from http://pkgs.fedoraproject.org/cgit/mongodb.git/tree/mongodb-2.4.5-atomics.patch
9
10Upstream-status: pending
11---
12 src/mongo/bson/util/atomic_int.h | 26 ++++++++++++
13 src/mongo/platform/atomic_intrinsics_gcc_generic.h | 47 ++++++++++++++++++++++
14 2 files changed, 73 insertions(+)
15
16diff --git a/src/mongo/bson/util/atomic_int.h b/src/mongo/bson/util/atomic_int.h
17index 0b85363..ed02c23 100644
18--- a/src/mongo/bson/util/atomic_int.h
19+++ b/src/mongo/bson/util/atomic_int.h
20@@ -24,6 +24,10 @@
21
22 #include "mongo/platform/compiler.h"
23
24+#define GCC_VERSION (__GNUC__ * 10000 \
25+ + __GNUC_MINOR__ * 100 \
26+ + __GNUC_PATCHLEVEL__)
27+
28 namespace mongo {
29
30 /**
31@@ -72,6 +76,28 @@ namespace mongo {
32 InterlockedAdd((volatile long *)&x,by);
33 }
34 # endif
35+#elif defined(GCC_VERSION) && GCC_VERSION >= 40700
36+// in GCC version >= 4.7.0 we can use the built-in atomic operations
37+
38+ inline void AtomicUInt::set(unsigned newX) {
39+ __atomic_store_n (&x, newX, __ATOMIC_SEQ_CST);
40+ }
41+ AtomicUInt AtomicUInt::operator++() { // ++prefix
42+ return __atomic_add_fetch(&x, 1, __ATOMIC_SEQ_CST);
43+ }
44+ AtomicUInt AtomicUInt::operator++(int) { // postfix++
45+ return __atomic_fetch_add(&x, 1, __ATOMIC_SEQ_CST);
46+ }
47+ AtomicUInt AtomicUInt::operator--() { // --prefix
48+ return __atomic_add_fetch(&x, -1, __ATOMIC_SEQ_CST);
49+ }
50+ AtomicUInt AtomicUInt::operator--(int) { // postfix--
51+ return __atomic_fetch_add(&x, -1, __ATOMIC_SEQ_CST);
52+ }
53+ void AtomicUInt::signedAdd(int by) {
54+ __atomic_fetch_add(&x, by, __ATOMIC_SEQ_CST);
55+ }
56+
57 #elif defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)
58 // this is in GCC >= 4.1
59 inline void AtomicUInt::set(unsigned newX) { __sync_synchronize(); x = newX; }
60diff --git a/src/mongo/platform/atomic_intrinsics_gcc_generic.h b/src/mongo/platform/atomic_intrinsics_gcc_generic.h
61index 64a2499..b7cc176 100644
62--- a/src/mongo/platform/atomic_intrinsics_gcc_generic.h
63+++ b/src/mongo/platform/atomic_intrinsics_gcc_generic.h
64@@ -22,8 +22,53 @@
65
66 #include <boost/utility.hpp>
67
68+#define GCC_VERSION (__GNUC__ * 10000 \
69+ + __GNUC_MINOR__ * 100 \
70+ + __GNUC_PATCHLEVEL__)
71+
72 namespace mongo {
73
74+// If GCC version >= 4.7.0, we can use the built-in atomic operations
75+#if defined(GCC_VERSION) && GCC_VERSION >= 40700
76+
77+ /**
78+ * Instantiation of AtomicIntrinsics<>.
79+ */
80+ template <typename T>
81+ class AtomicIntrinsics {
82+ public:
83+
84+ static T compareAndSwap(volatile T* dest, T expected, T newValue) {
85+ return __atomic_compare_exchange_n (dest, &expected, newValue, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST);
86+ }
87+
88+ static T swap(volatile T* dest, T newValue) {
89+ return __atomic_exchange_n (dest, newValue, __ATOMIC_SEQ_CST);
90+ }
91+
92+ static T load(volatile const T* value) {
93+ return __atomic_load_n (value, __ATOMIC_SEQ_CST);
94+ }
95+
96+ static T loadRelaxed(volatile const T* value) {
97+ return *value;
98+ }
99+
100+ static void store(volatile T* dest, T newValue) {
101+ __atomic_store_n (dest, newValue, __ATOMIC_SEQ_CST);
102+ }
103+
104+ static T fetchAndAdd(volatile T* dest, T increment) {
105+ return __atomic_fetch_add (dest, increment, __ATOMIC_SEQ_CST);
106+ }
107+
108+ private:
109+ AtomicIntrinsics();
110+ ~AtomicIntrinsics();
111+ };
112+
113+#else // GCC version < 4.7, so we must use legacy (platform-specific) atomic operations
114+
115 /**
116 * Instantiation of AtomicIntrinsics<> for all word types T.
117 */
118@@ -67,4 +112,6 @@ namespace mongo {
119 ~AtomicIntrinsics();
120 };
121
122+#endif // GCC_VERSION >= 40700
123+
124 } // namespace mongo
125--
1261.9.0
127
diff --git a/meta-oe/recipes-support/mongodb/mongodb_git.bb b/meta-oe/recipes-support/mongodb/mongodb_git.bb
index f0fe2402f..d990da874 100644
--- a/meta-oe/recipes-support/mongodb/mongodb_git.bb
+++ b/meta-oe/recipes-support/mongodb/mongodb_git.bb
@@ -9,13 +9,14 @@ DEPENDS_append_x86-64 = " gperftools"
9 9
10inherit scons 10inherit scons
11 11
12PV = "2.5.5+git${SRCPV}" 12PV = "2.6.0+git${SRCPV}"
13SRCREV = "588dc81b0822ebb46f80e152b94527a882e6ea5e" 13SRCREV = "be1905c24c7e5ea258e537fbf0d2c502c4fc6de2"
14SRC_URI = "git://github.com/mongodb/mongo.git \ 14SRC_URI = "git://github.com/mongodb/mongo.git;branch=v2.6 \
15 file://0001-Make-it-possible-to-disable-the-use-of-v8.patch \ 15 file://0001-Make-it-possible-to-disable-the-use-of-v8.patch \
16 file://0002-Fix-linking-when-scripting-is-disabled.patch \ 16 file://0002-Fix-linking-when-scripting-is-disabled.patch \
17 file://0003-Do-not-build-mongo-binary-when-scripting-is-disabled.patch \ 17 file://0003-Do-not-build-mongo-binary-when-scripting-is-disabled.patch \
18 file://0001-replace-os.uname-with-os.getenv-TARGET_ARCH.patch \ 18 file://0004-replace-os.uname-with-os.getenv-OE_TARGET_ARCH.patch \
19 file://0005-GCC-4.7-supports-atomic-ops-for-armv5-and-up-but-onl.patch \
19 " 20 "
20 21
21S = "${WORKDIR}/git" 22S = "${WORKDIR}/git"