=== modified file debian/patches/0001-Add-option-to-disable-javascript.patch --- debian/patches/0001-Add-option-to-disable-javascript.patch 2014-01-22 14:52:36 +0000 +++ debian/patches/0001-Add-option-to-disable-javascript.patch 2015-11-25 22:11:59 +0000 @@ -1,126 +1,54 @@ Description: Add option to disable script integration Origin: https://github.com/mongodb/mongo/pull/591 ---- a/SConscript.buildinfo -+++ b/SConscript.buildinfo -@@ -8,7 +8,7 @@ import sys - - import buildscripts.utils - --Import('env windows usev8 usesm') -+Import('env windows usev8') - - def getSysInfo(): - if windows: -@@ -41,8 +41,6 @@ def generate_buildinfo(env, target, sour - - if usev8: - js_engine = "V8" -- elif usesm: -- js_engine = "SpiderMonkey" - else: - js_engine = "Unknown" - ---- a/SConstruct -+++ b/SConstruct -@@ -172,8 +172,7 @@ add_option( "asio" , "Use Asynchronous I - add_option( "ssl" , "Enable SSL" , 0 , True ) - - # library choices --add_option( "usesm" , "use spider monkey for javascript" , 0 , True ) --add_option( "usev8" , "use v8 for javascript" , 0 , True ) +Index: mongodb-2.6.10/SConstruct +=================================================================== +--- mongodb-2.6.10.orig/SConstruct ++++ mongodb-2.6.10/SConstruct +@@ -229,6 +229,9 @@ add_option( "ssl-fips-capability", "Enab + add_option( "usev8" , "use v8 for javascript" , 0 , True ) + add_option( "libc++", "use libc++ (experimental, requires clang)", 0, True ) + ++# disable scripting +add_option( "disable-scripting" , "do not build support for javascript" , 0 , True ) - ++ # mongo feature options add_option( "noshell", "don't build shell" , 0 , True ) -@@ -273,10 +272,10 @@ static = has_option( "static" ) - - debugBuild = has_option( "debugBuild" ) or has_option( "debugBuildAndLogging" ) - debugLogging = has_option( "debugBuildAndLogging" ) --noshell = has_option( "noshell" ) - --usesm = has_option( "usesm" ) --usev8 = has_option( "usev8" ) + add_option( "safeshell", "don't let shell scripts run programs (still, don't run untrusted scripts)" , 0 , True ) +@@ -447,6 +450,8 @@ noshell = has_option( "noshell" ) + + usev8 = has_option( "usev8" ) + +disable_scripting = has_option( "disable-scripting" ) + -+noshell = has_option( "noshell" ) - asio = has_option( "asio" ) -@@ -425,7 +424,9 @@ if boostVersion is None: - else: - boostVersion = "-" + boostVersion + usePCH = has_option( "usePCH" ) +@@ -606,7 +611,10 @@ if has_option( "durableDefaultOn" ): + if has_option( "durableDefaultOff" ): + env.Append( CPPDEFINES=[ "_DURABLEDEFAULTOFF" ] ) --if ( not ( usesm or usev8 or justClientLib) ): -+if disable_scripting or justClientLib: +-usev8 = True ++if disable_scripting: + usev8 = False +else: - usev8 = True - options_topass["usev8"] = True - -@@ -768,9 +769,6 @@ if nix: - print( "removing precompiled headers" ) - os.unlink( env.File("$BUILD_DIR/mongo/pch.h.$GCHSUFFIX").abspath ) # gcc uses the file if it exists - --if usesm: -- env.Append( CPPDEFINES=["JS_C_STRINGS_ARE_UTF8"] ) -- - if "uname" in dir(os): - hacks = buildscripts.findHacks( os.uname() ) - if hacks is not None: -@@ -1138,7 +1136,8 @@ Export("shellEnv") - Export("testEnv") ++ usev8 = True + + extraLibPlaces = [] + +@@ -1672,6 +1680,7 @@ Export("get_option") Export("has_option use_system_version_of_library") - Export("installSetup") --Export("usesm usev8") -+Export("usev8") + Export("mongoCodeVersion") + Export("usev8") +Export("disable_scripting") Export("darwin windows solaris linux freebsd nix") Export('module_sconscripts') - Export("debugBuild") ---- a/src/mongo/SConscript -+++ b/src/mongo/SConscript -@@ -6,11 +6,12 @@ import os - import itertools - from buildscripts import utils - -+Import("disable_scripting") - Import("env") - Import("shellEnv") - Import("testEnv") - Import("has_option") --Import("usesm usev8") -+Import("usev8") - Import("installSetup") - Import("enforce_glibc") - Import("darwin windows solaris linux nix") -@@ -310,11 +311,7 @@ env.StaticLibrary('bson_template_evaluat - env.CppUnitTest('bson_template_evaluator_test', ['scripting/bson_template_evaluator_test.cpp'], - LIBDEPS=['bson_template_evaluator']) - --if usesm: -- env.StaticLibrary('scripting', scripting_common_files + ['scripting/engine_spidermonkey.cpp', -- 'scripting/sm_db.cpp'], -- LIBDEPS=['$BUILD_DIR/third_party/js-1.7/js', 'bson_template_evaluator']) --elif usev8: -+if usev8: - env.StaticLibrary('scripting', scripting_common_files + ['scripting/engine_v8.cpp', - 'scripting/v8_db.cpp', - 'scripting/v8_utils.cpp', -@@ -676,7 +673,9 @@ env.StaticLibrary('mocklib', [ - test = testEnv.Install( - '#/', - testEnv.Program("test", -- [ f for f in Glob("dbtests/*.cpp") if not str(f).endswith('framework.cpp') ], -+ [ f for f in Glob("dbtests/*.cpp") -+ if not str(f).endswith('framework.cpp') and -+ not (str(f).endswith('jstests.cpp') and disable_scripting)], - LIBDEPS = [ - "mongocommon", - "serveronly", ---- a/src/mongo/scripting/engine_none.cpp -+++ b/src/mongo/scripting/engine_none.cpp -@@ -21,4 +21,8 @@ namespace mongo { + Export("debugBuild optBuild") +Index: mongodb-2.6.10/src/mongo/scripting/engine_none.cpp +=================================================================== +--- mongodb-2.6.10.orig/src/mongo/scripting/engine_none.cpp ++++ mongodb-2.6.10/src/mongo/scripting/engine_none.cpp +@@ -33,4 +33,8 @@ namespace mongo { void ScriptEngine::setup() { // noop } @@ -129,33 +57,26 @@ + return "none"; + } } ---- a/src/third_party/SConscript -+++ b/src/third_party/SConscript -@@ -1,6 +1,6 @@ - # -*- mode: python -*- - --Import("env use_system_version_of_library windows darwin usesm usev8") -+Import("env use_system_version_of_library windows darwin usev8") - - env.SConscript( [ - "murmurhash3/SConscript", -@@ -34,18 +34,7 @@ else: - env.SConscript('snappy/SConscript') - env.StaticLibrary('shim_snappy', ['shim_snappy.cpp'], LIBDEPS=['snappy/snappy']) - --if usesm: -- if use_system_version_of_library("sm"): -- env.StaticLibrary("shim_spidermonkey", ['shim_spidermonkey.cpp'], SYSLIBDEPS=['js']) -- else: -- if windows: -- env.Append(CPPDEFINES=['XP_WIN']) -- else: -- env.Append(CPPDEFINES=['XP_UNIX']) -- env.Append(CPPPATH='$BUILD_DIR/third_party/js-1.7') -- env.SConscript('js-1.7/SConscript') -- env.StaticLibrary('shim_spidermonkey', ['shim_spidermonkey.cpp'], LIBDEPS=['js-1.7/js']) --elif usev8: -+if usev8: - if use_system_version_of_library("v8"): - env.StaticLibrary("shim_v8", ['shim_v8.cpp'], SYSLIBDEPS=['v8']) - else: +Index: mongodb-2.6.10/src/mongo/SConscript +=================================================================== +--- mongodb-2.6.10.orig/src/mongo/SConscript ++++ mongodb-2.6.10/src/mongo/SConscript +@@ -12,6 +12,7 @@ Import("testEnv") + Import("has_option") + Import("get_option") + Import("usev8") ++Import("disable_scripting") + Import("enforce_glibc") + Import("darwin windows solaris linux nix") + +@@ -1065,7 +1066,9 @@ 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) and ++ not (str(f).endswith('matchertests.cpp') and disable_scripting) ], + LIBDEPS = [ + "mutable_bson_test_utils", + "mongocommon", === modified file debian/patches/0001-Create-kfreebsd-like-linux-in-most-respects.patch --- debian/patches/0001-Create-kfreebsd-like-linux-in-most-respects.patch 2013-12-05 16:07:10 +0000 +++ debian/patches/0001-Create-kfreebsd-like-linux-in-most-respects.patch 2015-11-25 22:11:59 +0000 @@ -6,11 +6,18 @@ SConstruct | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -diff --git a/SConstruct b/SConstruct -index 5fb0e83..f3ac3f9 100644 --- a/SConstruct +++ b/SConstruct -@@ -344,6 +344,8 @@ libdeps.setup_environment( env ) +@@ -66,7 +66,7 @@ solaris = False + if "darwin" == platform: + darwin = True + platform = "osx" # prettier than darwin +-elif platform.startswith("linux"): ++elif platform.startswith("linux") or platform.startswith("gnukfreebsd"): + linux = True + platform = "linux" + elif "sunos5" == platform: +@@ -526,6 +526,8 @@ libdeps.setup_environment( env ) if env['PYSYSPLATFORM'] == 'linux3': env['PYSYSPLATFORM'] = 'linux2' @@ -19,12 +26,3 @@ if 'freebsd' in env['PYSYSPLATFORM']: env['PYSYSPLATFORM'] = 'freebsd' -@@ -524,7 +526,7 @@ if "darwin" == os.sys.platform: - env.Append( EXTRACPPPATH=filterExists(["/sw/include" , "/opt/local/include"]) ) - env.Append( EXTRALIBPATH=filterExists(["/sw/lib/", "/opt/local/lib"]) ) - --elif os.sys.platform.startswith("linux"): -+elif os.sys.platform.startswith("linux") or os.sys.platform.startswith("gnukfreebsd"): - linux = True - platform = "linux" - === removed file debian/patches/0001-SERVER-12064-Atomic-operations-for-gcc-non-Intel-arc.patch --- debian/patches/0001-SERVER-12064-Atomic-operations-for-gcc-non-Intel-arc.patch 2014-01-07 16:47:27 +0000 +++ debian/patches/0001-SERVER-12064-Atomic-operations-for-gcc-non-Intel-arc.patch 1970-01-01 00:00:00 +0000 @@ -1,480 +1,0 @@ -From f625b0737634fa96ddfcf18d8316863ee1cf6cfa Mon Sep 17 00:00:00 2001 -From: Robie Basak -Date: Tue, 10 Dec 2013 12:57:01 +0000 -Subject: [PATCH 1/3] SERVER-12064 Atomic operations for gcc non-Intel - architectures - -Add support for non-Intel architectures by using gcc builtins where -possible, but only on non-Intel builds. This permits builds to continue -to work on Intel architectures even with older gcc versions that do not -have the builtins. - -atomic_intrinsics_gcc.h contains non-portable Intel assembly, so move it -to atomic_intrinsics_gcc_intel.h and add an -atomic_intrinsics_gcc_generic.h equivalent that uses only modern gcc -builtins. - -Adjust atomic_intrinsics.h to use atomic_intrinsics_gcc_intel.h in the -Intel case, and atomic_instrinsics_gcc_generic.h in an additional -"otherwise" case. - -This does not change behaviour or compatibility in the common IA-32 and -x86_64 cases. The previously existing code will continue to be used in -these cases. An older gcc without the modern gcc builtins will continue -to be able to build on these architectures because the previously -existing assembly will be used. - -This does make this code fully portable to any architecture supported by -a modern gcc, since the new, generic code will be used in this case. - -(cherry picked from commit 5c26dfa8330bb048fb929f8332f1424c4e3b431d) ---- - src/mongo/platform/atomic_intrinsics.h | 6 +- - src/mongo/platform/atomic_intrinsics_gcc.h | 166 --------------------- - src/mongo/platform/atomic_intrinsics_gcc_generic.h | 70 +++++++++ - src/mongo/platform/atomic_intrinsics_gcc_intel.h | 166 +++++++++++++++++++++ - 4 files changed, 241 insertions(+), 167 deletions(-) - delete mode 100644 src/mongo/platform/atomic_intrinsics_gcc.h - create mode 100644 src/mongo/platform/atomic_intrinsics_gcc_generic.h - create mode 100644 src/mongo/platform/atomic_intrinsics_gcc_intel.h - -diff --git a/src/mongo/platform/atomic_intrinsics.h b/src/mongo/platform/atomic_intrinsics.h -index cee70db..23b7b6b 100644 ---- a/src/mongo/platform/atomic_intrinsics.h -+++ b/src/mongo/platform/atomic_intrinsics.h -@@ -43,7 +43,11 @@ - #if defined(_WIN32) - #include "mongo/platform/atomic_intrinsics_win32.h" - #elif defined(__GNUC__) --#include "mongo/platform/atomic_intrinsics_gcc.h" -+#if defined(__i386__) || defined(__x86_64__) -+#include "mongo/platform/atomic_intrinsics_gcc_intel.h" -+#else -+#include "mongo/platform/atomic_intrinsics_gcc_generic.h" -+#endif - #else - #error "Unsupported os/compiler family" - #endif -diff --git a/src/mongo/platform/atomic_intrinsics_gcc.h b/src/mongo/platform/atomic_intrinsics_gcc.h -deleted file mode 100644 -index f8f96f0..0000000 ---- a/src/mongo/platform/atomic_intrinsics_gcc.h -+++ /dev/null -@@ -1,166 +0,0 @@ --/* Copyright 2012 10gen Inc. -- * -- * Licensed under the Apache License, Version 2.0 (the "License"); -- * you may not use this file except in compliance with the License. -- * You may obtain a copy of the License at -- * -- * http://www.apache.org/licenses/LICENSE-2.0 -- * -- * Unless required by applicable law or agreed to in writing, software -- * distributed under the License is distributed on an "AS IS" BASIS, -- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- * See the License for the specific language governing permissions and -- * limitations under the License. -- */ -- --/** -- * Implementation of the AtomicIntrinsics::* operations for IA-32 and AMD64 systems using a -- * GCC-compatible compiler toolchain. -- */ -- --#pragma once -- --#include -- --namespace mongo { -- -- /** -- * Instantiation of AtomicIntrinsics<> for all word types T where sizeof <= sizeof(void *). -- * -- * On 32-bit systems, this handles 8-, 16- and 32-bit word types. On 64-bit systems, -- * it handles 8-, 16, 32- and 64-bit types. -- */ -- template -- class AtomicIntrinsics { -- public: -- -- static T compareAndSwap(volatile T* dest, T expected, T newValue) { -- -- T result; -- asm volatile ("lock cmpxchg %[src], %[dest]" -- : [dest] "+m" (*dest), -- "=a" (result) -- : [src] "r" (newValue), -- "a" (expected) -- : "memory", "cc"); -- return result; -- } -- -- static T swap(volatile T* dest, T newValue) { -- -- T result = newValue; -- // No need for "lock" prefix on "xchg". -- asm volatile ("xchg %[r], %[dest]" -- : [dest] "+m" (*dest), -- [r] "+r" (result) -- : -- : "memory"); -- return result; -- } -- -- static T load(volatile const T* value) { -- asm volatile ("mfence" ::: "memory"); -- T result = *value; -- asm volatile ("mfence" ::: "memory"); -- return result; -- } -- -- static T loadRelaxed(volatile const T* value) { -- return *value; -- } -- -- static void store(volatile T* dest, T newValue) { -- asm volatile ("mfence" ::: "memory"); -- *dest = newValue; -- asm volatile ("mfence" ::: "memory"); -- } -- -- static T fetchAndAdd(volatile T* dest, T increment) { -- -- T result = increment; -- asm volatile ("lock xadd %[src], %[dest]" -- : [dest] "+m" (*dest), -- [src] "+r" (result) -- : -- : "memory", "cc"); -- return result; -- } -- -- private: -- AtomicIntrinsics(); -- ~AtomicIntrinsics(); -- }; -- -- /** -- * Instantiation of AtomicIntrinsics where sizeof exceeds sizeof(void*). -- * -- * On 32-bit systems, this handles the 64-bit word type. Not used on 64-bit systems. -- * -- * Note that the implementations of swap, store and fetchAndAdd spin until they succeed. This -- * implementation is thread-safe, but may have poor performance in high-contention environments. -- * However, no superior solution exists for IA-32 (32-bit x86) systems. -- */ -- template -- class AtomicIntrinsics::type> { -- public: -- static T compareAndSwap(volatile T* dest, T expected, T newValue) { -- T result = expected; -- asm volatile ("push %%eax\n" -- "push %%ebx\n" -- "push %%ecx\n" -- "push %%edx\n" -- "mov (%%edx), %%ebx\n" -- "mov 4(%%edx), %%ecx\n" -- "mov (%%edi), %%eax\n" -- "mov 4(%%edi), %%edx\n" -- "lock cmpxchg8b (%%esi)\n" -- "mov %%eax, (%%edi)\n" -- "mov %%edx, 4(%%edi)\n" -- "pop %%edx\n" -- "pop %%ecx\n" -- "pop %%ebx\n" -- "pop %%eax\n" -- : -- : "S" (dest), -- "D" (&result), -- "d" (&newValue) -- : "memory", "cc"); -- return result; -- } -- -- static T swap(volatile T* dest, T newValue) { -- -- T expected; -- T actual; -- do { -- expected = *dest; -- actual = compareAndSwap(dest, expected, newValue); -- } while (actual != expected); -- return actual; -- } -- -- static T load(volatile const T* value) { -- return compareAndSwap(const_cast(value), T(0), T(0)); -- } -- -- static void store(volatile T* dest, T newValue) { -- swap(dest, newValue); -- } -- -- static T fetchAndAdd(volatile T* dest, T increment) { -- -- T expected; -- T actual; -- do { -- expected = load(dest); -- actual = compareAndSwap(dest, expected, expected + increment); -- } while (actual != expected); -- return actual; -- } -- -- private: -- AtomicIntrinsics(); -- ~AtomicIntrinsics(); -- }; -- --} // namespace mongo -diff --git a/src/mongo/platform/atomic_intrinsics_gcc_generic.h b/src/mongo/platform/atomic_intrinsics_gcc_generic.h -new file mode 100644 -index 0000000..64a2499 ---- /dev/null -+++ b/src/mongo/platform/atomic_intrinsics_gcc_generic.h -@@ -0,0 +1,70 @@ -+/* Copyright 2012 10gen Inc. -+ * -+ * Licensed under the Apache License, Version 2.0 (the "License"); -+ * you may not use this file except in compliance with the License. -+ * You may obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ */ -+ -+/** -+ * Implementation of the AtomicIntrinsics::* operations for systems on any -+ * architecture using a new enough GCC-compatible compiler toolchain. -+ */ -+ -+#pragma once -+ -+#include -+ -+namespace mongo { -+ -+ /** -+ * Instantiation of AtomicIntrinsics<> for all word types T. -+ */ -+ template -+ class AtomicIntrinsics { -+ public: -+ -+ static T compareAndSwap(volatile T* dest, T expected, T newValue) { -+ __atomic_compare_exchange(dest, &expected, &newValue, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); -+ return expected; -+ } -+ -+ static T swap(volatile T* dest, T newValue) { -+ T result; -+ __atomic_exchange(dest, &newValue, &result, __ATOMIC_SEQ_CST); -+ return result; -+ } -+ -+ static T load(volatile const T* value) { -+ T result; -+ __atomic_load(value, &result, __ATOMIC_SEQ_CST); -+ return result; -+ } -+ -+ static T loadRelaxed(volatile const T* value) { -+ T result; -+ __atomic_load(value, &result, __ATOMIC_RELAXED); -+ return result; -+ } -+ -+ static void store(volatile T* dest, T newValue) { -+ __atomic_store(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(); -+ }; -+ -+} // namespace mongo -diff --git a/src/mongo/platform/atomic_intrinsics_gcc_intel.h b/src/mongo/platform/atomic_intrinsics_gcc_intel.h -new file mode 100644 -index 0000000..f8f96f0 ---- /dev/null -+++ b/src/mongo/platform/atomic_intrinsics_gcc_intel.h -@@ -0,0 +1,166 @@ -+/* Copyright 2012 10gen Inc. -+ * -+ * Licensed under the Apache License, Version 2.0 (the "License"); -+ * you may not use this file except in compliance with the License. -+ * You may obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ */ -+ -+/** -+ * Implementation of the AtomicIntrinsics::* operations for IA-32 and AMD64 systems using a -+ * GCC-compatible compiler toolchain. -+ */ -+ -+#pragma once -+ -+#include -+ -+namespace mongo { -+ -+ /** -+ * Instantiation of AtomicIntrinsics<> for all word types T where sizeof <= sizeof(void *). -+ * -+ * On 32-bit systems, this handles 8-, 16- and 32-bit word types. On 64-bit systems, -+ * it handles 8-, 16, 32- and 64-bit types. -+ */ -+ template -+ class AtomicIntrinsics { -+ public: -+ -+ static T compareAndSwap(volatile T* dest, T expected, T newValue) { -+ -+ T result; -+ asm volatile ("lock cmpxchg %[src], %[dest]" -+ : [dest] "+m" (*dest), -+ "=a" (result) -+ : [src] "r" (newValue), -+ "a" (expected) -+ : "memory", "cc"); -+ return result; -+ } -+ -+ static T swap(volatile T* dest, T newValue) { -+ -+ T result = newValue; -+ // No need for "lock" prefix on "xchg". -+ asm volatile ("xchg %[r], %[dest]" -+ : [dest] "+m" (*dest), -+ [r] "+r" (result) -+ : -+ : "memory"); -+ return result; -+ } -+ -+ static T load(volatile const T* value) { -+ asm volatile ("mfence" ::: "memory"); -+ T result = *value; -+ asm volatile ("mfence" ::: "memory"); -+ return result; -+ } -+ -+ static T loadRelaxed(volatile const T* value) { -+ return *value; -+ } -+ -+ static void store(volatile T* dest, T newValue) { -+ asm volatile ("mfence" ::: "memory"); -+ *dest = newValue; -+ asm volatile ("mfence" ::: "memory"); -+ } -+ -+ static T fetchAndAdd(volatile T* dest, T increment) { -+ -+ T result = increment; -+ asm volatile ("lock xadd %[src], %[dest]" -+ : [dest] "+m" (*dest), -+ [src] "+r" (result) -+ : -+ : "memory", "cc"); -+ return result; -+ } -+ -+ private: -+ AtomicIntrinsics(); -+ ~AtomicIntrinsics(); -+ }; -+ -+ /** -+ * Instantiation of AtomicIntrinsics where sizeof exceeds sizeof(void*). -+ * -+ * On 32-bit systems, this handles the 64-bit word type. Not used on 64-bit systems. -+ * -+ * Note that the implementations of swap, store and fetchAndAdd spin until they succeed. This -+ * implementation is thread-safe, but may have poor performance in high-contention environments. -+ * However, no superior solution exists for IA-32 (32-bit x86) systems. -+ */ -+ template -+ class AtomicIntrinsics::type> { -+ public: -+ static T compareAndSwap(volatile T* dest, T expected, T newValue) { -+ T result = expected; -+ asm volatile ("push %%eax\n" -+ "push %%ebx\n" -+ "push %%ecx\n" -+ "push %%edx\n" -+ "mov (%%edx), %%ebx\n" -+ "mov 4(%%edx), %%ecx\n" -+ "mov (%%edi), %%eax\n" -+ "mov 4(%%edi), %%edx\n" -+ "lock cmpxchg8b (%%esi)\n" -+ "mov %%eax, (%%edi)\n" -+ "mov %%edx, 4(%%edi)\n" -+ "pop %%edx\n" -+ "pop %%ecx\n" -+ "pop %%ebx\n" -+ "pop %%eax\n" -+ : -+ : "S" (dest), -+ "D" (&result), -+ "d" (&newValue) -+ : "memory", "cc"); -+ return result; -+ } -+ -+ static T swap(volatile T* dest, T newValue) { -+ -+ T expected; -+ T actual; -+ do { -+ expected = *dest; -+ actual = compareAndSwap(dest, expected, newValue); -+ } while (actual != expected); -+ return actual; -+ } -+ -+ static T load(volatile const T* value) { -+ return compareAndSwap(const_cast(value), T(0), T(0)); -+ } -+ -+ static void store(volatile T* dest, T newValue) { -+ swap(dest, newValue); -+ } -+ -+ static T fetchAndAdd(volatile T* dest, T increment) { -+ -+ T expected; -+ T actual; -+ do { -+ expected = load(dest); -+ actual = compareAndSwap(dest, expected, expected + increment); -+ } while (actual != expected); -+ return actual; -+ } -+ -+ private: -+ AtomicIntrinsics(); -+ ~AtomicIntrinsics(); -+ }; -+ -+} // namespace mongo --- -1.8.5.2 - === removed file debian/patches/0002-SERVER-12065-Support-ARM-and-AArch64-builds.patch --- debian/patches/0002-SERVER-12065-Support-ARM-and-AArch64-builds.patch 2014-01-07 16:47:27 +0000 +++ debian/patches/0002-SERVER-12065-Support-ARM-and-AArch64-builds.patch 1970-01-01 00:00:00 +0000 @@ -1,32 +1,0 @@ -From 2baec7b9f63ada09dcb1488290064685e83d9d16 Mon Sep 17 00:00:00 2001 -From: Robie Basak -Date: Tue, 10 Dec 2013 14:05:01 +0000 -Subject: [PATCH 2/3] SERVER-12065 Support ARM and AArch64 builds - -Detect platforms that define __arm__ and __aarch64__ as 32-bit and -64-bit platforms respectively. - -(cherry picked from commit c777d0f6a803d3d1b6390fc2cb85d7c13318f030) ---- - src/mongo/platform/bits.h | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/mongo/platform/bits.h b/src/mongo/platform/bits.h -index 7afc428..860bfbd 100644 ---- a/src/mongo/platform/bits.h -+++ b/src/mongo/platform/bits.h -@@ -19,9 +19,9 @@ - - // figure out if we're on a 64 or 32 bit system - --#if defined(__x86_64__) || defined(__amd64__) || defined(_WIN64) -+#if defined(__x86_64__) || defined(__amd64__) || defined(_WIN64) || defined(__aarch64__) - #define MONGO_PLATFORM_64 --#elif defined(__i386__) || defined(_WIN32) -+#elif defined(__i386__) || defined(_WIN32) || defined(__arm__) - #define MONGO_PLATFORM_32 - #else - #error "unknown platform" --- -1.8.5.2 - === removed file debian/patches/0003-All-platforms-but-Windows-find-hash-in-std-tr1.patch --- debian/patches/0003-All-platforms-but-Windows-find-hash-in-std-tr1.patch 2013-12-05 16:07:10 +0000 +++ debian/patches/0003-All-platforms-but-Windows-find-hash-in-std-tr1.patch 1970-01-01 00:00:00 +0000 @@ -1,25 +1,0 @@ -From: Jeff Epler -Date: Fri, 19 Apr 2013 08:16:31 -0500 -Subject: All platforms but Windows find hash in std::tr1 - ---- - src/third_party/s2/hash.h | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/third_party/s2/hash.h b/src/third_party/s2/hash.h -index a255f2c..d399bb8 100644 ---- a/src/third_party/s2/hash.h -+++ b/src/third_party/s2/hash.h -@@ -7,10 +7,10 @@ - #include "mongo/platform/unordered_set.h" - #define hash_set mongo::unordered_set - --#if defined OS_LINUX || defined OS_MACOSX || defined __sunos__ || defined __freebsd__ -+#if ! defined OS_WINDOWS - #define HASH_NAMESPACE_START namespace std { namespace tr1 { - #define HASH_NAMESPACE_END }} --#elif defined OS_WINDOWS -+#else - #define HASH_NAMESPACE_START namespace std { - #define HASH_NAMESPACE_END } - #endif === removed file debian/patches/0005-ARM-support-for-ASM-operations-in-MongoDB.patch --- debian/patches/0005-ARM-support-for-ASM-operations-in-MongoDB.patch 2013-12-05 16:07:10 +0000 +++ debian/patches/0005-ARM-support-for-ASM-operations-in-MongoDB.patch 1970-01-01 00:00:00 +0000 @@ -1,181 +1,0 @@ -From: Robie Basak -Date: Sat, 20 Apr 2013 22:05:50 -0300 -Subject: ARM support for ASM operations in MongoDB - -This is a modified version of Jon Masters' ARM patch. I have replaced some of -the calls whose return value semantics didn't quite match the existing x86 -assembler. - -Original-Author: Jon Masters -Origin: http://lists.fedoraproject.org/pipermail/arm/2013-February/005388.html -Last-Update: 2013-03-15 ---- - src/mongo/platform/atomic_intrinsics_gcc.h | 69 +++++++++++++++++++++++++++++- - src/mongo/platform/bits.h | 2 +- - 2 files changed, 68 insertions(+), 3 deletions(-) - -diff --git a/src/mongo/platform/atomic_intrinsics_gcc.h b/src/mongo/platform/atomic_intrinsics_gcc.h -index f8f96f0..da36685 100644 ---- a/src/mongo/platform/atomic_intrinsics_gcc.h -+++ b/src/mongo/platform/atomic_intrinsics_gcc.h -@@ -14,14 +14,19 @@ - */ - - /** -- * Implementation of the AtomicIntrinsics::* operations for IA-32 and AMD64 systems using a -- * GCC-compatible compiler toolchain. -+ * Implementation of the AtomicIntrinsics::* operations for IA-32, AMD64, and 32-bit ARM -+ * systems using a GCC-compatible compiler toolchain. - */ - - #pragma once - - #include - -+#if defined(__arm__) -+typedef int (__kuser_cmpxchg_t)(int oldval, int newval, volatile int *ptr); -+#define __kuser_cmpxchg (*(__kuser_cmpxchg_t *)0xffff0fc0) -+#endif -+ - namespace mongo { - - /** -@@ -37,31 +42,58 @@ namespace mongo { - static T compareAndSwap(volatile T* dest, T expected, T newValue) { - - T result; -+ -+#if defined(__i386__) || defined(__x86_64__) - asm volatile ("lock cmpxchg %[src], %[dest]" - : [dest] "+m" (*dest), - "=a" (result) - : [src] "r" (newValue), - "a" (expected) - : "memory", "cc"); -+#endif -+ -+#if defined(__arm__) -+ result = __sync_val_compare_and_swap(dest, expected, newValue); -+#endif -+ - return result; - } - - static T swap(volatile T* dest, T newValue) { - - T result = newValue; -+ -+#if defined(__i386__) || defined(__x86_64__) - // No need for "lock" prefix on "xchg". - asm volatile ("xchg %[r], %[dest]" - : [dest] "+m" (*dest), - [r] "+r" (result) - : - : "memory"); -+#endif -+ -+#if defined(__arm__) -+ __sync_synchronize(); -+ result = __sync_lock_test_and_set(dest, newValue); -+#endif -+ - return result; - } - - static T load(volatile const T* value) { -+ -+#if defined(__i386__) || defined(__x86_64__) - asm volatile ("mfence" ::: "memory"); - T result = *value; - asm volatile ("mfence" ::: "memory"); -+#endif -+ -+#if defined(__arm__) -+ asm volatile("mcr p15, 0, r0, c7, c10, 5"); -+ T result = *value; -+ asm volatile("mcr p15, 0, r0, c7, c10, 5"); -+#endif -+ - return result; - } - -@@ -70,19 +102,44 @@ namespace mongo { - } - - static void store(volatile T* dest, T newValue) { -+ -+#if defined(__i386__) || defined(__x86_64__) - asm volatile ("mfence" ::: "memory"); - *dest = newValue; - asm volatile ("mfence" ::: "memory"); -+#endif -+ -+#if defined(__arm__) -+ asm volatile("mcr p15, 0, r0, c7, c10, 5"); -+ *dest = newValue; -+ asm volatile("mcr p15, 0, r0, c7, c10, 5"); -+#endif -+ - } - - static T fetchAndAdd(volatile T* dest, T increment) { - - T result = increment; -+ -+#if defined(__i386__) || defined(__x86_64__) - asm volatile ("lock xadd %[src], %[dest]" - : [dest] "+m" (*dest), - [src] "+r" (result) - : - : "memory", "cc"); -+#endif -+ -+#if defined(__arm__) -+ int old; -+ -+ do { -+ old = (int)(*dest); -+ } while(__kuser_cmpxchg((int)old, (int)(old+increment), -+ (volatile int *)dest)); -+ -+ result = old; -+#endif -+ - return result; - } - -@@ -105,6 +162,8 @@ namespace mongo { - public: - static T compareAndSwap(volatile T* dest, T expected, T newValue) { - T result = expected; -+ -+#if defined(__i386__) || defined(__x86_64__) - asm volatile ("push %%eax\n" - "push %%ebx\n" - "push %%ecx\n" -@@ -125,6 +184,12 @@ namespace mongo { - "D" (&result), - "d" (&newValue) - : "memory", "cc"); -+#endif -+ -+#if defined(__arm__) -+ result = __sync_val_compare_and_swap(dest, expected, newValue); -+#endif -+ - return result; - } - -diff --git a/src/mongo/platform/bits.h b/src/mongo/platform/bits.h -index 7afc428..75343dd 100644 ---- a/src/mongo/platform/bits.h -+++ b/src/mongo/platform/bits.h -@@ -21,7 +21,7 @@ - - #if defined(__x86_64__) || defined(__amd64__) || defined(_WIN64) - #define MONGO_PLATFORM_64 --#elif defined(__i386__) || defined(_WIN32) -+#elif defined(__i386__) || defined(_WIN32) || defined(__arm__) - #define MONGO_PLATFORM_32 - #else - #error "unknown platform" === modified file debian/patches/0006-Fix-ARM-alignment-problems.patch --- debian/patches/0006-Fix-ARM-alignment-problems.patch 2013-12-05 16:07:10 +0000 +++ debian/patches/0006-Fix-ARM-alignment-problems.patch 2015-11-25 22:11:59 +0000 @@ -11,8 +11,6 @@ src/mongo/db/key.cpp | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) -diff --git a/src/mongo/bson/bsonelement.h b/src/mongo/bson/bsonelement.h -index f094ab9..1ecb47f 100644 --- a/src/mongo/bson/bsonelement.h +++ b/src/mongo/bson/bsonelement.h @@ -17,7 +17,7 @@ @@ -24,7 +22,7 @@ #include #include -@@ -529,13 +529,27 @@ namespace mongo { +@@ -550,13 +550,27 @@ namespace mongo { } inline double BSONElement::numberDouble() const { @@ -52,11 +50,9 @@ default: return 0; } -diff --git a/src/mongo/db/key.cpp b/src/mongo/db/key.cpp -index 3d9eaa7..95959d8 100644 ---- a/src/mongo/db/key.cpp -+++ b/src/mongo/db/key.cpp -@@ -406,7 +406,7 @@ namespace mongo { +--- a/src/mongo/db/structure/btree/key.cpp ++++ b/src/mongo/db/structure/btree/key.cpp +@@ -418,7 +418,7 @@ namespace mongo { p += 8; break; case cdouble: === modified file debian/patches/0007-Use-TIME_UTC_-macro.patch --- debian/patches/0007-Use-TIME_UTC_-macro.patch 2013-12-05 16:07:10 +0000 +++ debian/patches/0007-Use-TIME_UTC_-macro.patch 2015-11-25 22:11:59 +0000 @@ -6,11 +6,9 @@ src/mongo/util/time_support.h | 4 ---- 1 file changed, 4 deletions(-) -diff --git a/src/mongo/util/time_support.h b/src/mongo/util/time_support.h -index 47c7d87..9df70e1 100644 --- a/src/mongo/util/time_support.h +++ b/src/mongo/util/time_support.h -@@ -96,10 +96,6 @@ namespace mongo { +@@ -150,11 +150,7 @@ namespace mongo { struct tm *gmtime(const time_t *timep); struct tm *localtime(const time_t *timep); @@ -21,3 +19,4 @@ -#endif } // namespace mongo + === removed file debian/patches/0008-Use-system-libstemmer.patch --- debian/patches/0008-Use-system-libstemmer.patch 2013-12-05 16:07:10 +0000 +++ debian/patches/0008-Use-system-libstemmer.patch 1970-01-01 00:00:00 +0000 @@ -1,20 +1,0 @@ -From: Antonin Kral -Date: Wed, 17 Jul 2013 19:35:02 +0200 -Subject: Use system libstemmer - ---- - SConstruct | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/SConstruct b/SConstruct -index f3ac3f9..2c888f3 100644 ---- a/SConstruct -+++ b/SConstruct -@@ -802,7 +802,6 @@ if not use_system_version_of_library("boost"): - CPPDEFINES=['BOOST_ALL_NO_LIB']) - - env.Prepend(CPPPATH=['$BUILD_DIR/third_party/s2']) --env.Prepend(CPPPATH=['$BUILD_DIR/third_party/libstemmer_c/include']) - - env.Append( CPPPATH=['$EXTRACPPPATH'], - LIBPATH=['$EXTRALIBPATH'] ) === modified file debian/patches/0009-ignore-unused-local-typedefs.patch --- debian/patches/0009-ignore-unused-local-typedefs.patch 2013-12-05 16:07:10 +0000 +++ debian/patches/0009-ignore-unused-local-typedefs.patch 2015-11-25 22:11:59 +0000 @@ -5,21 +5,11 @@ Author: James Page Origin: https://github.com/mongodb/mongo/commit/2d30f0b562c1925a52670e767c2c0222189fb8f0 ---- a/SConstruct -+++ b/SConstruct -@@ -715,6 +715,7 @@ if nix: - env.Append( CCFLAGS=["-Werror", "-pipe"] ) - if not has_option('clang'): - env.Append( CCFLAGS=["-fno-builtin-memcmp"] ) # glibc's memcmp is faster than gcc's -+ env.Append( CXXFLAGS=["-Wno-unused-local-typedefs"] ) # New in gcc 4.8 - - env.Append( CPPDEFINES=["_FILE_OFFSET_BITS=64"] ) - env.Append( CXXFLAGS=["-Wnon-virtual-dtor", "-Woverloaded-virtual"] ) --- a/src/third_party/v8/SConscript +++ b/src/third_party/v8/SConscript -@@ -51,7 +51,8 @@ LIBRARY_FLAGS = { - '-W', - '-Wno-unused-parameter', +@@ -48,7 +48,8 @@ LIBRARY_FLAGS = { + 'all': { + 'CCFLAGS': ['-Wno-unused-parameter', '-Woverloaded-virtual', - '-Wnon-virtual-dtor'] + '-Wnon-virtual-dtor', === modified file debian/patches/0010-fix-integer-signs.patch --- debian/patches/0010-fix-integer-signs.patch 2013-12-05 16:07:10 +0000 +++ debian/patches/0010-fix-integer-signs.patch 2015-11-25 22:11:59 +0000 @@ -6,20 +6,9 @@ --- ---- mongodb-2.4.6.orig/src/mongo/db/auth/privilege_set.cpp -+++ mongodb-2.4.6/src/mongo/db/auth/privilege_set.cpp -@@ -79,7 +79,7 @@ namespace mongo { - resourceSearchList[1] = nsToDatabaseSubstring(desiredPrivilege.getResource()); - - ActionSet unmetRequirements = desiredPrivilege.getActions(); -- for (int i = 0; i < boost::size(resourceSearchList); ++i) { -+ for (unsigned int i = 0; i < boost::size(resourceSearchList); ++i) { - ResourcePrivilegeCacheEntry* entry = _lookupEntry(resourceSearchList[i]); - if (NULL == entry) - continue; ---- mongodb-2.4.6.orig/src/mongo/db/cmdline_test.cpp -+++ mongodb-2.4.6/src/mongo/db/cmdline_test.cpp -@@ -71,7 +71,7 @@ namespace { +--- a/src/mongo/util/cmdline_utils/censor_cmdline_test.cpp ++++ b/src/mongo/util/cmdline_utils/censor_cmdline_test.cpp +@@ -85,7 +85,7 @@ namespace { "KEEP", "--servicePasswordFake=KEEP" }; @@ -28,7 +17,7 @@ testCensoringArgv(argv, argv, argc); } -@@ -88,7 +88,7 @@ namespace { +@@ -102,7 +102,7 @@ namespace { "--servicePassword", "get out of dodge" }; @@ -37,7 +26,7 @@ const char* const expected[] = { "first", -@@ -120,7 +120,7 @@ namespace { +@@ -134,7 +134,7 @@ namespace { "-servicePassword", "get out of dodge" }; @@ -46,7 +35,7 @@ const char* const expected[] = { "first", -@@ -152,7 +152,7 @@ namespace { +@@ -166,7 +166,7 @@ namespace { "KEEP", "--servicePasswordFake=KEEP" }; @@ -55,7 +44,7 @@ testCensoringVector(argv, argv, argc); } -@@ -169,7 +169,7 @@ namespace { +@@ -183,7 +183,7 @@ namespace { "--servicePassword", "get out of dodge" }; @@ -64,7 +53,7 @@ const char* const expected[] = { "first", -@@ -201,7 +201,7 @@ namespace { +@@ -215,7 +215,7 @@ namespace { "-servicePassword", "get out of dodge" }; === removed file debian/patches/0011-Use-a-signed-char-to-store-BSONType-enumerations.patch --- debian/patches/0011-Use-a-signed-char-to-store-BSONType-enumerations.patch 2013-12-05 16:07:10 +0000 +++ debian/patches/0011-Use-a-signed-char-to-store-BSONType-enumerations.patch 1970-01-01 00:00:00 +0000 @@ -1,35 +1,0 @@ -From a1689790db10139d09c4fb29f500470564faabde Mon Sep 17 00:00:00 2001 -From: Robie Basak -Date: Mon, 6 May 2013 23:01:56 +0100 -Subject: [PATCH] SERVER-9680 Use a signed char to store BSONType enumerations - -MinKey is defined as -1, so a signed char must be used to store BSONType -enumerations. Using a char to store a negative value results in -undefined behaviour. On i386 and amd64 architectures it happens to work -because on these platforms a char is generally signed, but this is not -guaranteed. - -This fixes a build failure on ARM, where chars are unsigned by default, -and using MinKey (defined as -1) results in a compiler error. ---- - src/mongo/bson/bson_validate.cpp | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/mongo/bson/bson_validate.cpp b/src/mongo/bson/bson_validate.cpp -index 9ac0bcb..88e6d48 100644 ---- a/src/mongo/bson/bson_validate.cpp -+++ b/src/mongo/bson/bson_validate.cpp -@@ -130,8 +130,8 @@ - Status validateElementInfo(Buffer* buffer, ValidationState::State* nextState) { - Status status = Status::OK(); - -- char type; -- if ( !buffer->readNumber(&type) ) -+ signed char type; -+ if ( !buffer->readNumber(&type) ) - return Status( ErrorCodes::InvalidBSON, "invalid bson" ); - - if ( type == EOO ) { --- -1.8.1.6 - === added file debian/patches/0012-support-gnu.patch --- debian/patches/0012-support-gnu.patch 1970-01-01 00:00:00 +0000 +++ debian/patches/0012-support-gnu.patch 2015-11-25 22:11:59 +0000 @@ -1,0 +1,31 @@ +--- a/SConstruct ++++ b/SConstruct +@@ -66,7 +66,7 @@ solaris = False + if "darwin" == platform: + darwin = True + platform = "osx" # prettier than darwin +-elif platform.startswith("linux") or platform.startswith("gnukfreebsd"): ++elif platform.startswith("linux") or platform.startswith("gnukfreebsd") or os.sys.platform.startswith("gnu0"): + linux = True + platform = "linux" + elif "sunos5" == platform: +@@ -535,6 +535,8 @@ if 'gnukfreebsd' in env['PYSYSPLATFORM'] + env['PYSYSPLATFORM'] = 'linux2' + if 'freebsd' in env['PYSYSPLATFORM']: + env['PYSYSPLATFORM'] = 'freebsd' ++if 'gnu0' in env['PYSYSPLATFORM']: ++ env['PYSYSPLATFORM'] = 'gnu' + + if os.sys.platform == 'win32': + env['OS_FAMILY'] = 'win' +--- a/src/mongo/platform/random.cpp ++++ b/src/mongo/platform/random.cpp +@@ -105,7 +105,7 @@ namespace mongo { + return new WinSecureRandom(); + } + +-#elif defined(__linux__) || defined(__sunos__) || defined(__APPLE__) || defined(__FreeBSD_kernel__) ++#elif defined(__linux__) || defined(__sunos__) || defined(__APPLE__) || defined(__FreeBSD_kernel__) || defined(__GNU__) + + class InputStreamSecureRandom : public SecureRandom { + public: === modified file debian/patches/0099-Pagesize-hacks.patch --- debian/patches/0099-Pagesize-hacks.patch 2014-03-27 00:47:53 +0000 +++ debian/patches/0099-Pagesize-hacks.patch 2015-11-25 22:11:59 +0000 @@ -1,8 +1,6 @@ -diff --git a/src/mongo/util/logfile.cpp b/src/mongo/util/logfile.cpp -index fa53690..28562b2 100644 --- a/src/mongo/util/logfile.cpp +++ b/src/mongo/util/logfile.cpp -@@ -26,6 +26,7 @@ +@@ -38,6 +38,7 @@ #include "mongo/util/startup_test.h" #include "mongo/util/text.h" @@ -10,7 +8,7 @@ using namespace mongoutils; -@@ -36,16 +41,16 @@ namespace mongo { +@@ -48,16 +49,16 @@ namespace mongo { if( 0 && debug ) { try { LogFile f("logfile_test"); @@ -33,15 +31,14 @@ free(p); } catch(DBException& e ) { -@@ -226,7 +231,11 @@ namespace mongo { +@@ -238,7 +239,11 @@ namespace mongo { fassert( 16144, charsToWrite >= 0 ); fassert( 16142, _fd >= 0 ); -- fassert( 16143, reinterpret_cast( buf ) % g_minOSPageSizeBytes == 0 ); // aligned + +// Disabling alignment test on PPC64 due to a 64kB page size on PPC64 instead of 4kB on x86 +#ifndef __PPC64__ -+ fassert( 16143, reinterpret_cast( buf ) % g_minOSPageSizeBytes == 0 ); // aligned + fassert( 16143, reinterpret_cast( buf ) % g_minOSPageSizeBytes == 0 ); // aligned +#endif #ifdef POSIX_FADV_DONTNEED === removed file debian/patches/00git_pymongo3.patch --- debian/patches/00git_pymongo3.patch 2015-08-11 10:57:23 +0000 +++ debian/patches/00git_pymongo3.patch 1970-01-01 00:00:00 +0000 @@ -1,80 +1,0 @@ -From a47efdc68977bd38161ebf91cf9b727612a6c9f3 Mon Sep 17 00:00:00 2001 -From: Jonathan Reams -Date: Fri, 17 Apr 2015 13:19:13 -0400 -Subject: [PATCH] SERVER-18073 Make smoke.py work with pymongo 3.0 - ---- - buildscripts/smoke.py | 21 +++++++++++++-------- - 1 file changed, 13 insertions(+), 8 deletions(-) - -Index: juju-mongodb-2.4.10/buildscripts/smoke.py -=================================================================== ---- juju-mongodb-2.4.10.orig/buildscripts/smoke.py -+++ juju-mongodb-2.4.10/buildscripts/smoke.py -@@ -49,8 +49,9 @@ from subprocess import (Popen, - import sys - import time - --from pymongo import Connection -+from pymongo import MongoClient - from pymongo.errors import OperationFailure -+from pymongo import ReadPreference - - import utils - -@@ -166,7 +167,7 @@ class mongod(object): - - def setup_admin_user(self, port=mongod_port): - try: -- Connection( "localhost" , int(port) ).admin.add_user("admin","password") -+ MongoClient( "localhost" , int(port) ).admin.add_user("admin","password") - except OperationFailure, e: - if e.message == 'need to login': - pass # SERVER-4225 -@@ -230,7 +231,8 @@ class mongod(object): - self.setup_admin_user(self.port) - - if self.slave: -- local = Connection(port=self.port, slave_okay=True).local -+ local = MongoClient(port=self.port, -+ read_preference=ReadPreference.SECONDARY_PREFERRED).local - synced = False - while not synced: - synced = True -@@ -289,7 +291,7 @@ class mongod(object): - sys.stdout.flush() - - def wait_for_repl(self): -- Connection(port=self.port).test.smokeWait.insert({}, w=2, wtimeout=5*60*1000) -+ MongoClient(port=self.port).test.smokeWait.insert({}, w=2, wtimeout=5*60*1000) - - class Bug(Exception): - def __str__(self): -@@ -325,7 +327,8 @@ def check_db_hashes(master, slave): - - # FIXME: maybe make this run dbhash on all databases? - for mongod in [master, slave]: -- mongod.dbhash = Connection(port=mongod.port, slave_okay=True).test.command("dbhash") -+ client = MongoClient(port=mongod.port, read_preference=ReadPreference.SECONDARY_PREFERRED) -+ mongod.dbhash = client.test.command("dbhash") - mongod.dict = mongod.dbhash["collections"] - - global lost_in_slave, lost_in_master, screwy_in_slave, replicated_collections -@@ -512,7 +515,7 @@ def runTest(test): - - if start_mongod: - try: -- c = Connection(host="127.0.0.1", port=int(mongod_port), ssl=use_ssl) -+ c = MongoClient(host="127.0.0.1", port=int(mongod_port), ssl=use_ssl) - except Exception,e: - print "Exception from pymongo: ", e - raise TestServerFailure(path) -@@ -550,7 +553,7 @@ def run_tests(tests): - auth=auth, - authMechanism=authMechanism, - use_ssl=use_ssl).__enter__() -- primary = Connection(port=master.port, slave_okay=True); -+ primary = MongoClient(port=master.port, slave_okay=True); - - primary.admin.command({'replSetInitiate' : {'_id' : 'foo', 'members' : [ - {'_id': 0, 'host':'localhost:%s' % master.port}, === added file debian/patches/disable-warnings.patch --- debian/patches/disable-warnings.patch 1970-01-01 00:00:00 +0000 +++ debian/patches/disable-warnings.patch 2015-11-25 22:11:59 +0000 @@ -1,0 +1,17 @@ +Description: Don't fail (-Werror) on "unused-variable" and "maybe-uninitialized" warnings. +Author: Martin Pitt +Bug-Ubuntu: https://launchpad.net/bugs/1483400 + +Index: mongodb-2.6.10/SConstruct +=================================================================== +--- mongodb-2.6.10.orig/SConstruct ++++ mongodb-2.6.10/SConstruct +@@ -835,6 +835,8 @@ if nix: + "-Wall", + "-Wsign-compare", + "-Wno-unused-function", ++ "-Wno-unused-variable", ++ "-Wno-maybe-uninitialized", + "-Wno-unknown-pragmas", + "-Winvalid-pch"] ) + # env.Append( " -Wconversion" ) TODO: this doesn't really work yet === added file debian/patches/fix-signed-checks.patch --- debian/patches/fix-signed-checks.patch 1970-01-01 00:00:00 +0000 +++ debian/patches/fix-signed-checks.patch 2015-11-25 22:11:59 +0000 @@ -1,0 +1,46 @@ +Description: Ensure comparisons are between identical types + gcc4.9/Ubuntu Utopic throws errors when signed and unsiged + int types are compared. + . + This patch ensures that type signing matches. +Author: James Page +Forwarded: no + +--- a/src/mongo/util/cmdline_utils/censor_cmdline_test.cpp ++++ b/src/mongo/util/cmdline_utils/censor_cmdline_test.cpp +@@ -116,7 +116,7 @@ namespace { + "--servicePassword", + "xxxxxxxxxxxxxxxx" + }; +- ASSERT_EQUALS(static_cast(boost::size(expected)), argc); ++ ASSERT_EQUALS(boost::size(expected), argc); + + testCensoringArgv(expected, argv, argc); + } +@@ -148,7 +148,7 @@ namespace { + "-servicePassword", + "xxxxxxxxxxxxxxxx" + }; +- ASSERT_EQUALS(static_cast(boost::size(expected)), argc); ++ ASSERT_EQUALS(boost::size(expected), argc); + + testCensoringArgv(expected, argv, argc); + } +@@ -197,7 +197,7 @@ namespace { + "--servicePassword", + "" + }; +- ASSERT_EQUALS(static_cast(boost::size(expected)), argc); ++ ASSERT_EQUALS(boost::size(expected), argc); + + testCensoringVector(expected, argv, argc); + } +@@ -229,7 +229,7 @@ namespace { + "-servicePassword", + "" + }; +- ASSERT_EQUALS(static_cast(boost::size(expected)), argc); ++ ASSERT_EQUALS(boost::size(expected), argc); + + testCensoringVector(expected, argv, argc); + } === added file debian/patches/fix-yaml-detection.patch --- debian/patches/fix-yaml-detection.patch 1970-01-01 00:00:00 +0000 +++ debian/patches/fix-yaml-detection.patch 2015-11-25 22:11:59 +0000 @@ -1,0 +1,18 @@ +Description: Fixup detection of yaml-cpp library + The --use-system-yaml flag incorrectly searches for 'yaml' not 'yaml-cpp'. + Update the search to look for the correct library name. +Author: James Page +Forwarded: https://github.com/mongodb/mongo/pull/707 +Bug: https://jira.mongodb.org/browse/SERVER-14388 + +--- a/SConstruct ++++ b/SConstruct +@@ -1359,7 +1359,7 @@ def doConfigure(myenv): + conf.FindSysLibDep("stemmer", ["stemmer"]) + + if use_system_version_of_library("yaml"): +- conf.FindSysLibDep("yaml", ["yaml"]) ++ conf.FindSysLibDep("yaml", ["yaml-cpp"]) + + if use_system_version_of_library("boost"): + if not conf.CheckCXXHeader( "boost/filesystem/operations.hpp" ): === modified file debian/patches/no-unused-function.patch --- debian/patches/no-unused-function.patch 2015-04-20 13:55:27 +0000 +++ debian/patches/no-unused-function.patch 2015-11-25 22:11:59 +0000 @@ -1,14 +1,14 @@ Description: Uses -Wno-unused-function to build Uses -Wno-unused-function to avoid FTBFS with -Werror=unused-function which is now the default in gcc-4.9. -Origin: https://bugs.debian.org/cgi-bin/bugreport.cgi?msg=12;filename=no-unused-function.patch;att=1;bug=746887 Author: Thomas Goirand Bug-Debian: http://bugs.debian.org/746887 Forwarded: no Last-Update: 2014-06-16 ---- a/SConstruct -+++ b/SConstruct -@@ -709,6 +709,7 @@ if nix: + +--- mongodb-2.4.10.orig/SConstruct ++++ mongodb-2.4.10/SConstruct +@@ -708,6 +708,7 @@ if nix: "-pthread", "-Wall", "-Wsign-compare", === removed file debian/patches/no-unused-variable.patch --- debian/patches/no-unused-variable.patch 2015-08-11 10:57:23 +0000 +++ debian/patches/no-unused-variable.patch 1970-01-01 00:00:00 +0000 @@ -1,16 +1,0 @@ -Description: Don't fail (-Werror) on "unused-variable" warning. -Author: Martin Pitt -Bug-Ubuntu: https://launchpad.net/bugs/1483400 - -Index: mongodb-2.6.10/SConstruct -=================================================================== ---- mongodb-2.6.10.orig/SConstruct -+++ mongodb-2.6.10/SConstruct -@@ -835,6 +835,7 @@ if nix: - "-Wall", - "-Wsign-compare", - "-Wno-unused-function", -+ "-Wno-unused-variable", - "-Wno-unknown-pragmas", - "-Winvalid-pch"] ) - # env.Append( " -Wconversion" ) TODO: this doesn't really work yet === modified file debian/patches/series --- debian/patches/series 2015-08-11 10:57:23 +0000 +++ debian/patches/series 2015-11-25 22:11:59 +0000 @@ -1,20 +1,17 @@ 00git_boost_1.56.patch -00git_pymongo3.patch 0001-Create-kfreebsd-like-linux-in-most-respects.patch 0002-kfreebsd-has-dev-urandom.patch -0003-All-platforms-but-Windows-find-hash-in-std-tr1.patch 0004-kfreebsd-does-not-have-sys-prctl.h.patch -#0005-ARM-support-for-ASM-operations-in-MongoDB.patch 0006-Fix-ARM-alignment-problems.patch 0007-Use-TIME_UTC_-macro.patch -#0008-Use-system-libstemmer.patch 0009-ignore-unused-local-typedefs.patch 0010-fix-integer-signs.patch -0011-Use-a-signed-char-to-store-BSONType-enumerations.patch +# Added for arm64 and ppc64el enablement 0001-Add-option-to-disable-javascript.patch -0001-SERVER-12064-Atomic-operations-for-gcc-non-Intel-arc.patch -0002-SERVER-12065-Support-ARM-and-AArch64-builds.patch 0004-Support-ppc64el-builds.patch 0099-Pagesize-hacks.patch +fix-yaml-detection.patch +0012-support-gnu.patch no-unused-function.patch -no-unused-variable.patch +fix-signed-checks.patch +disable-warnings.patch