From 1219bf8a90a7bf8cd3a5363551ef635d51e8fc8e Mon Sep 17 00:00:00 2001 From: Tudor Florea Date: Thu, 8 Oct 2015 22:51:41 +0200 Subject: initial commit for Enea Linux 5.0 arm Signed-off-by: Tudor Florea --- ...Make-it-possible-to-disable-the-use-of-v8.patch | 50 ++++++++ ...02-Fix-linking-when-scripting-is-disabled.patch | 25 ++++ ...d-mongo-binary-when-scripting-is-disabled.patch | 64 +++++++++++ ...ce-os.uname-with-os.getenv-OE_TARGET_ARCH.patch | 50 ++++++++ ...ports-atomic-ops-for-armv5-and-up-but-onl.patch | 127 +++++++++++++++++++++ 5 files changed, 316 insertions(+) create mode 100644 meta-oe/recipes-support/mongodb/mongodb/0001-Make-it-possible-to-disable-the-use-of-v8.patch create mode 100644 meta-oe/recipes-support/mongodb/mongodb/0002-Fix-linking-when-scripting-is-disabled.patch create mode 100644 meta-oe/recipes-support/mongodb/mongodb/0003-Do-not-build-mongo-binary-when-scripting-is-disabled.patch create mode 100644 meta-oe/recipes-support/mongodb/mongodb/0004-replace-os.uname-with-os.getenv-OE_TARGET_ARCH.patch create mode 100644 meta-oe/recipes-support/mongodb/mongodb/0005-GCC-4.7-supports-atomic-ops-for-armv5-and-up-but-onl.patch (limited to 'meta-oe/recipes-support/mongodb/mongodb') 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 new file mode 100644 index 000000000..650389e16 --- /dev/null +++ b/meta-oe/recipes-support/mongodb/mongodb/0001-Make-it-possible-to-disable-the-use-of-v8.patch @@ -0,0 +1,50 @@ +From f1bd00e7f54aad6479bc809c27d5cd3c2fb993eb Mon Sep 17 00:00:00 2001 +From: Michael Hudson-Doyle +Date: Fri, 20 Dec 2013 11:10:43 +1300 +Subject: [PATCH 1/5] Make it possible to disable the use of v8. + +Currently v8 is always built in, no matter what you pass to scons. + +This removes the (useless) --usev8 flag for scons and replaces it with a +--disable-scripting option instead. +--- + SConstruct | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/SConstruct b/SConstruct +index 3886d1b..6e0ef3b 100644 +--- a/SConstruct ++++ b/SConstruct +@@ -225,7 +225,7 @@ add_option( "asio" , "Use Asynchronous IO (NOT READY YET)" , 0 , True ) + add_option( "ssl" , "Enable SSL" , 0 , True ) + + # library choices +-add_option( "usev8" , "use v8 for javascript" , 0 , True ) ++add_option( "disable-scripting" , "do not build support for javascript" , 0 , True ) + add_option( "libc++", "use libc++ (experimental, requires clang)", 0, True ) + + # mongo feature options +@@ -442,7 +442,7 @@ static = has_option( "static" ) + + noshell = has_option( "noshell" ) + +-usev8 = has_option( "usev8" ) ++disable_scripting = has_option( "disable-scripting" ) + + asio = has_option( "asio" ) + +@@ -600,7 +600,10 @@ if has_option( "durableDefaultOn" ): + if has_option( "durableDefaultOff" ): + env.Append( CPPDEFINES=[ "_DURABLEDEFAULTOFF" ] ) + +-usev8 = True ++if disable_scripting or justClientLib: ++ usev8 = False ++else: ++ usev8 = True + + extraLibPlaces = [] + +-- +1.9.0 + 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 new file mode 100644 index 000000000..b4388d8f0 --- /dev/null +++ b/meta-oe/recipes-support/mongodb/mongodb/0002-Fix-linking-when-scripting-is-disabled.patch @@ -0,0 +1,25 @@ +From 5b22f64a2e2237082d2733698b07147d27b09ad2 Mon Sep 17 00:00:00 2001 +From: Michael Hudson-Doyle +Date: Fri, 20 Dec 2013 12:28:27 +1300 +Subject: [PATCH 2/5] Fix linking when scripting is disabled. + +--- + src/mongo/scripting/engine_none.cpp | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/mongo/scripting/engine_none.cpp b/src/mongo/scripting/engine_none.cpp +index f5c7109..9ae9d57 100644 +--- a/src/mongo/scripting/engine_none.cpp ++++ b/src/mongo/scripting/engine_none.cpp +@@ -33,4 +33,8 @@ namespace mongo { + void ScriptEngine::setup() { + // noop + } ++ ++ std::string ScriptEngine::getInterpreterVersionString() { ++ return "none"; ++ } + } +-- +1.9.0 + 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 new file mode 100644 index 000000000..016ac3584 --- /dev/null +++ b/meta-oe/recipes-support/mongodb/mongodb/0003-Do-not-build-mongo-binary-when-scripting-is-disabled.patch @@ -0,0 +1,64 @@ +From eab4316597a8e9e7bbf845a054564c6daa4a95b7 Mon Sep 17 00:00:00 2001 +From: Michael Hudson-Doyle +Date: Wed, 22 Jan 2014 13:53:10 +1300 +Subject: [PATCH 3/5] * Do not build 'mongo' binary when scripting is disabled + * Do not build the jstests when scripting is disabled + +--- + SConstruct | 8 ++++++-- + src/mongo/SConscript | 4 +++- + 2 files changed, 9 insertions(+), 3 deletions(-) + +diff --git a/SConstruct b/SConstruct +index 6e0ef3b..c84a669 100644 +--- a/SConstruct ++++ b/SConstruct +@@ -440,10 +440,13 @@ else: + + static = has_option( "static" ) + +-noshell = has_option( "noshell" ) +- + disable_scripting = has_option( "disable-scripting" ) + ++if not disable_scripting: ++ noshell = has_option( "noshell" ) ++else: ++ noshell = True ++ + asio = has_option( "asio" ) + + usePCH = has_option( "usePCH" ) +@@ -1662,6 +1665,7 @@ Export("get_option") + Export("has_option use_system_version_of_library") + Export("mongoCodeVersion") + Export("usev8") ++Export("disable_scripting") + Export("darwin windows solaris linux freebsd nix") + Export('module_sconscripts') + Export("debugBuild optBuild") +diff --git a/src/mongo/SConscript b/src/mongo/SConscript +index 58f8406..b4379e7 100644 +--- a/src/mongo/SConscript ++++ b/src/mongo/SConscript +@@ -6,6 +6,7 @@ import os + import itertools + from buildscripts import utils + ++Import("disable_scripting") + Import("env") + Import("shellEnv") + Import("testEnv") +@@ -1043,7 +1044,8 @@ test = testEnv.Install( + [ f for f in Glob("dbtests/*.cpp") + if not str(f).endswith('framework.cpp') and + not str(f).endswith('framework_options.cpp') and +- not str(f).endswith('framework_options_init.cpp') ], ++ not str(f).endswith('framework_options_init.cpp') and ++ not (str(f).endswith('jstests.cpp') and disable_scripting)], + LIBDEPS = [ + "mutable_bson_test_utils", + "mongocommon", +-- +1.9.0 + diff --git a/meta-oe/recipes-support/mongodb/mongodb/0004-replace-os.uname-with-os.getenv-OE_TARGET_ARCH.patch b/meta-oe/recipes-support/mongodb/mongodb/0004-replace-os.uname-with-os.getenv-OE_TARGET_ARCH.patch new file mode 100644 index 000000000..ade7ec02a --- /dev/null +++ b/meta-oe/recipes-support/mongodb/mongodb/0004-replace-os.uname-with-os.getenv-OE_TARGET_ARCH.patch @@ -0,0 +1,50 @@ +From d02f33d860f2d11f71e9056782a2e75603d6ec25 Mon Sep 17 00:00:00 2001 +From: Koen Kooi +Date: Tue, 4 Feb 2014 10:56:35 +0100 +Subject: [PATCH 4/5] replace os.uname with os.getenv(OE_TARGET_ARCH) + +This fixes crosscompilation + +Signed-off-by: Koen Kooi +Upstream-Status: Inappropiate [OE specific] +--- + SConstruct | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/SConstruct b/SConstruct +index c84a669..05e2ea0 100644 +--- a/SConstruct ++++ b/SConstruct +@@ -257,9 +257,9 @@ add_option( "pch" , "use precompiled headers to speed up the build (experimental + add_option( "distcc" , "use distcc for distributing builds" , 0 , False ) + + # debugging/profiling help +-if os.sys.platform.startswith("linux") and (os.uname()[-1] == 'x86_64'): ++if os.sys.platform.startswith("linux") and (os.getenv("OE_TARGET_ARCH") == 'x86_64'): + defaultAllocator = 'tcmalloc' +-elif (os.sys.platform == "darwin") and (os.uname()[-1] == 'x86_64'): ++elif (os.sys.platform == "darwin") and (os.getenv("OE_TARGET_ARCH") == 'x86_64'): + defaultAllocator = 'tcmalloc' + else: + defaultAllocator = 'system' +@@ -633,7 +633,7 @@ if has_option( "extralib" ): + # ---- other build setup ----- + + if "uname" in dir(os): +- processor = os.uname()[4] ++ processor = os.getenv("OE_TARGET_ARCH") + else: + processor = "i386" + +@@ -662,7 +662,7 @@ elif linux: + + env.Append( LIBS=['m'] ) + +- if os.uname()[4] == "x86_64" and not force32: ++ if os.getenv("OE_TARGET_ARCH") == "x86_64" and not force32: + linux64 = True + nixLibPrefix = "lib64" + env.Append( EXTRALIBPATH=["/usr/lib64" , "/lib64" ] ) +-- +1.9.0 + 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 @@ +From e31f85e6915d4bf6ed76c5da71c235525fa4ecc3 Mon Sep 17 00:00:00 2001 +From: Koen Kooi +Date: Mon, 14 Apr 2014 10:29:42 +0200 +Subject: [PATCH 5/5] GCC 4.7+ supports atomic ops for armv5 and up, but only + exports the functions for armv6 and up. This patch works around the linker + problems associated with that. + +Forward ported from http://pkgs.fedoraproject.org/cgit/mongodb.git/tree/mongodb-2.4.5-atomics.patch + +Upstream-status: pending +--- + src/mongo/bson/util/atomic_int.h | 26 ++++++++++++ + src/mongo/platform/atomic_intrinsics_gcc_generic.h | 47 ++++++++++++++++++++++ + 2 files changed, 73 insertions(+) + +diff --git a/src/mongo/bson/util/atomic_int.h b/src/mongo/bson/util/atomic_int.h +index 0b85363..ed02c23 100644 +--- a/src/mongo/bson/util/atomic_int.h ++++ b/src/mongo/bson/util/atomic_int.h +@@ -24,6 +24,10 @@ + + #include "mongo/platform/compiler.h" + ++#define GCC_VERSION (__GNUC__ * 10000 \ ++ + __GNUC_MINOR__ * 100 \ ++ + __GNUC_PATCHLEVEL__) ++ + namespace mongo { + + /** +@@ -72,6 +76,28 @@ namespace mongo { + InterlockedAdd((volatile long *)&x,by); + } + # endif ++#elif defined(GCC_VERSION) && GCC_VERSION >= 40700 ++// in GCC version >= 4.7.0 we can use the built-in atomic operations ++ ++ inline void AtomicUInt::set(unsigned newX) { ++ __atomic_store_n (&x, newX, __ATOMIC_SEQ_CST); ++ } ++ AtomicUInt AtomicUInt::operator++() { // ++prefix ++ return __atomic_add_fetch(&x, 1, __ATOMIC_SEQ_CST); ++ } ++ AtomicUInt AtomicUInt::operator++(int) { // postfix++ ++ return __atomic_fetch_add(&x, 1, __ATOMIC_SEQ_CST); ++ } ++ AtomicUInt AtomicUInt::operator--() { // --prefix ++ return __atomic_add_fetch(&x, -1, __ATOMIC_SEQ_CST); ++ } ++ AtomicUInt AtomicUInt::operator--(int) { // postfix-- ++ return __atomic_fetch_add(&x, -1, __ATOMIC_SEQ_CST); ++ } ++ void AtomicUInt::signedAdd(int by) { ++ __atomic_fetch_add(&x, by, __ATOMIC_SEQ_CST); ++ } ++ + #elif defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4) + // this is in GCC >= 4.1 + inline void AtomicUInt::set(unsigned newX) { __sync_synchronize(); x = newX; } +diff --git a/src/mongo/platform/atomic_intrinsics_gcc_generic.h b/src/mongo/platform/atomic_intrinsics_gcc_generic.h +index 64a2499..b7cc176 100644 +--- a/src/mongo/platform/atomic_intrinsics_gcc_generic.h ++++ b/src/mongo/platform/atomic_intrinsics_gcc_generic.h +@@ -22,8 +22,53 @@ + + #include + ++#define GCC_VERSION (__GNUC__ * 10000 \ ++ + __GNUC_MINOR__ * 100 \ ++ + __GNUC_PATCHLEVEL__) ++ + namespace mongo { + ++// If GCC version >= 4.7.0, we can use the built-in atomic operations ++#if defined(GCC_VERSION) && GCC_VERSION >= 40700 ++ ++ /** ++ * Instantiation of AtomicIntrinsics<>. ++ */ ++ template ++ class AtomicIntrinsics { ++ public: ++ ++ static T compareAndSwap(volatile T* dest, T expected, T newValue) { ++ return __atomic_compare_exchange_n (dest, &expected, newValue, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); ++ } ++ ++ static T swap(volatile T* dest, T newValue) { ++ return __atomic_exchange_n (dest, newValue, __ATOMIC_SEQ_CST); ++ } ++ ++ static T load(volatile const T* value) { ++ return __atomic_load_n (value, __ATOMIC_SEQ_CST); ++ } ++ ++ static T loadRelaxed(volatile const T* value) { ++ return *value; ++ } ++ ++ static void store(volatile T* dest, T newValue) { ++ __atomic_store_n (dest, newValue, __ATOMIC_SEQ_CST); ++ } ++ ++ static T fetchAndAdd(volatile T* dest, T increment) { ++ return __atomic_fetch_add (dest, increment, __ATOMIC_SEQ_CST); ++ } ++ ++ private: ++ AtomicIntrinsics(); ++ ~AtomicIntrinsics(); ++ }; ++ ++#else // GCC version < 4.7, so we must use legacy (platform-specific) atomic operations ++ + /** + * Instantiation of AtomicIntrinsics<> for all word types T. + */ +@@ -67,4 +112,6 @@ namespace mongo { + ~AtomicIntrinsics(); + }; + ++#endif // GCC_VERSION >= 40700 ++ + } // namespace mongo +-- +1.9.0 + -- cgit v1.2.3-54-g00ecf