You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

344 lines
12 KiB

Index: SConstruct
--- SConstruct.orig 2018-06-21 21:46:07.000000000 +0200
+++ SConstruct 2018-06-28 20:26:14.474953000 +0200
@@ -598,7 +598,6 @@
def variable_tools_converter(val):
tool_list = shlex.split(val)
return tool_list + [
- "distsrc",
"gziptool",
'idl_tool',
"jsheader",
@@ -994,9 +993,9 @@
print(env_vars.GenerateHelpText(env))
Exit(0)
-unknown_vars = env_vars.UnknownVariables()
-if unknown_vars:
- env.FatalError("Unknown variables specified: {0}", ", ".join(unknown_vars.keys()))
+# unknown_vars = env_vars.UnknownVariables()
+# if unknown_vars:
+# env.FatalError("Unknown variables specified: {0}", ", ".join(unknown_vars.keys()))
def set_config_header_define(env, varname, varval = 1):
env['CONFIG_HEADER_DEFINES'][varname] = varval
@@ -1701,21 +1700,19 @@
# If runtime hardening is requested, then build anything
# destined for an executable with the necessary flags for PIE.
env.AppendUnique(
- PROGCCFLAGS=['-fPIE'],
+ PROGCCFLAGS=['-fpic'],
PROGLINKFLAGS=['-pie'],
)
# -Winvalid-pch Warn if a precompiled header (see Precompiled Headers) is found in the search path but can't be used.
env.Append( CCFLAGS=["-fno-omit-frame-pointer",
"-fno-strict-aliasing",
- "-ggdb",
"-pthread",
- "-Wall",
"-Wsign-compare",
"-Wno-unknown-pragmas",
"-Winvalid-pch"] )
# env.Append( " -Wconversion" ) TODO: this doesn't really work yet
- if env.TargetOSIs('linux', 'darwin', 'solaris'):
+ if env.TargetOSIs('linux', 'darwin', 'solaris', 'freebsd'):
if not has_option("disable-warnings-as-errors"):
env.Append( CCFLAGS=["-Werror"] )
@@ -1751,21 +1748,12 @@
env.Append( LINKFLAGS=["-fprofile-arcs", "-ftest-coverage"] )
if optBuild and not optBuildForSize:
- env.Append( CCFLAGS=["-O2"] )
+ env.Append( CCFLAGS=["-O1"] )
elif optBuild and optBuildForSize:
env.Append( CCFLAGS=["-Os"] )
else:
env.Append( CCFLAGS=["-O0"] )
- # Promote linker warnings into errors. We can't yet do this on OS X because its linker considers
- # noall_load obsolete and warns about it.
- if not has_option("disable-warnings-as-errors"):
- env.Append(
- LINKFLAGS=[
- '-Wl,-fatal_warnings' if env.TargetOSIs('darwin') else "-Wl,--fatal-warnings",
- ]
- )
-
mmapv1 = False
if get_option('mmapv1') == 'auto':
# The mmapv1 storage engine is only supported on x86
@@ -2679,7 +2667,7 @@
}}
"""
context.Message('Checking for storage class thread_local ')
- ret = context.TryLink(textwrap.dedent(test_body), ".cpp")
+ ret = context.TryCompile(textwrap.dedent(test_body), ".cpp")
context.Result(ret)
return ret
@@ -3009,7 +2997,7 @@
if not env.TargetOSIs("windows") \
and free_monitoring == "on" \
and not conf.CheckLibWithHeader(
- "curl",
+ [ "nghttp2", "ssl", "crypto", "z", "curl" ],
["curl/curl.h"], "C",
"curl_global_init(0);",
autoadd=False):
@@ -3458,8 +3446,6 @@
)
)
-env.AddDistSrcCallback(add_version_to_distsrc)
-
env['SERVER_DIST_BASENAME'] = env.subst('mongodb-%s-$MONGO_DISTNAME' % (getSystemInstallName()))
module_sconscripts = moduleconfig.get_module_sconscripts(mongo_modules)
@@ -3504,17 +3490,9 @@
vcxprojFile = env.Command(
"mongodb.vcxproj",
compileCommands,
- r"$PYTHON buildscripts\make_vcxproj.py mongodb")
+ r"$PYTHON buildscripts/make_vcxproj.py mongodb")
vcxproj = env.Alias("vcxproj", vcxprojFile)
-env.Alias("distsrc-tar", env.DistSrc("mongodb-src-${MONGO_VERSION}.tar"))
-env.Alias("distsrc-tgz", env.GZip(
- target="mongodb-src-${MONGO_VERSION}.tgz",
- source=["mongodb-src-${MONGO_VERSION}.tar"])
-)
-env.Alias("distsrc-zip", env.DistSrc("mongodb-src-${MONGO_VERSION}.zip"))
-env.Alias("distsrc", "distsrc-tgz")
-
# Do this as close to last as possible before reading SConscripts, so
# that any tools that may have injected other things via emitters are included
# among the side effect adornments.
@@ -3562,7 +3540,7 @@
variant_dir='$BUILD_DIR',
)
-all = env.Alias('all', ['core', 'tools', 'dbtest', 'unittests', 'integration_tests', 'benchmarks'])
+all = env.Alias('all', ['core', 'tools'])
# run the Dagger tool if it's installed
if should_dagger:
Index: site_scons/site_tools/mongo_integrationtest.py
--- site_scons/site_tools/mongo_integrationtest.py.orig 2018-06-21 21:46:07.000000000 +0200
+++ site_scons/site_tools/mongo_integrationtest.py 2018-06-28 20:26:14.475119000 +0200
@@ -7,9 +7,7 @@
_integration_tests = []
def register_integration_test(env, test):
- installed_test = env.Install("#/build/integration_tests/", test)
- _integration_tests.append(installed_test[0].path)
- env.Alias('$INTEGRATION_TEST_ALIAS', installed_test)
+ return True
def integration_test_list_builder_action(env, target, source):
ofile = open(str(target[0]), 'wb')
@@ -21,15 +19,7 @@
ofile.close()
def build_cpp_integration_test(env, target, source, **kwargs):
- libdeps = kwargs.get('LIBDEPS', [])
- libdeps.append( '$BUILD_DIR/mongo/unittest/integration_test_main' )
-
- kwargs['LIBDEPS'] = libdeps
- kwargs['INSTALL_ALIAS'] = ['tests']
-
- result = env.Program(target, source, **kwargs)
- env.RegisterIntegrationTest(result[0])
- return result
+ return True
def generate(env):
env.Command('$INTEGRATION_TEST_LIST', env.Value(_integration_tests),
Index: site_scons/site_tools/mongo_unittest.py
--- site_scons/site_tools/mongo_unittest.py.orig 2018-06-21 21:46:07.000000000 +0200
+++ site_scons/site_tools/mongo_unittest.py 2018-06-28 20:26:14.475246000 +0200
@@ -7,8 +7,7 @@
_unittests = []
def register_unit_test(env, test):
- _unittests.append(test.path)
- env.Alias('$UNITTEST_ALIAS', test)
+ return True
def unit_test_list_builder_action(env, target, source):
ofile = open(str(target[0]), 'wb')
@@ -20,18 +19,7 @@
ofile.close()
def build_cpp_unit_test(env, target, source, **kwargs):
- libdeps = kwargs.get('LIBDEPS', [])
- libdeps.append( '$BUILD_DIR/mongo/unittest/unittest_main' )
-
- kwargs['LIBDEPS'] = libdeps
- kwargs['INSTALL_ALIAS'] = ['tests']
-
- result = env.Program(target, source, **kwargs)
- env.RegisterUnitTest(result[0])
- hygienic = env.GetOption('install-mode') == 'hygienic'
- if not hygienic:
- env.Install("#/build/unittests/", result[0])
- return result
+ return True
def generate(env):
env.Command('$UNITTEST_LIST', env.Value(_unittests),
Index: src/mongo/SConscript
--- src/mongo/SConscript.orig 2018-06-21 21:46:07.000000000 +0200
+++ src/mongo/SConscript 2018-06-28 20:26:14.475456000 +0200
@@ -29,7 +29,6 @@
'embedded',
'executor',
'idl',
- 'installer',
'logger',
'platform',
'rpc',
Index: src/mongo/base/secure_allocator.cpp
--- src/mongo/base/secure_allocator.cpp.orig 2018-06-21 21:46:07.000000000 +0200
+++ src/mongo/base/secure_allocator.cpp 2018-06-28 23:36:34.462220000 +0200
@@ -240,11 +240,13 @@
fassertFailed(28831);
}
+#ifndef __FreeBSD__
if (mlock(ptr, bytes) != 0) {
auto str = errnoWithPrefix("Failed to mlock");
severe() << str;
fassertFailed(28832);
}
+#endif
#if defined(MADV_DONTDUMP)
// We deliberately ignore the return value since if the Linux version is < 3.4, madvise
@@ -261,10 +263,12 @@
(void)madvise(ptr, bytes, MADV_DODUMP);
#endif
+#ifndef __FreeBSD__
if (munlock(ptr, bytes) != 0) {
severe() << errnoWithPrefix("Failed to munlock");
fassertFailed(28833);
}
+#endif
if (munmap(ptr, bytes) != 0) {
severe() << errnoWithPrefix("Failed to munmap");
Index: src/mongo/crypto/SConscript
--- src/mongo/crypto/SConscript.orig 2018-06-21 21:46:07.000000000 +0200
+++ src/mongo/crypto/SConscript 2018-06-28 20:26:14.475595000 +0200
@@ -2,6 +2,10 @@
Import("env")
+def has_option(name):
+ optval = GetOption(name)
+ return True if optval == () else bool(optval)
+
env = env.Clone()
env.Library('sha1_block',
@@ -46,7 +50,7 @@
]
)
-else:
+elif has_option("ssl"):
env.Library('sha_block_${MONGO_CRYPTO}',
source=[
'sha_block_${MONGO_CRYPTO}.cpp'
Index: src/mongo/db/pipeline/document_source_bucket_auto.cpp
--- src/mongo/db/pipeline/document_source_bucket_auto.cpp.orig 2018-06-21 21:46:07.000000000 +0200
+++ src/mongo/db/pipeline/document_source_bucket_auto.cpp 2018-06-28 20:26:14.475827000 +0200
@@ -167,7 +167,7 @@
// Calculate the approximate bucket size. We attempt to fill each bucket with this many
// documents.
- long long approxBucketSize = std::round(double(_nDocuments) / double(_nBuckets));
+ long long approxBucketSize = round(double(_nDocuments) / double(_nBuckets));
if (approxBucketSize < 1) {
// If the number of buckets is larger than the number of documents, then we try to make as
Index: src/mongo/db/pipeline/expression.cpp
--- src/mongo/db/pipeline/expression.cpp.orig 2018-06-21 21:46:07.000000000 +0200
+++ src/mongo/db/pipeline/expression.cpp 2018-06-28 20:26:14.476627000 +0200
@@ -35,6 +35,7 @@
#include <boost/algorithm/string.hpp>
#include <cstdio>
#include <vector>
+#include <cmath>
#include "mongo/db/commands/feature_compatibility_version_documentation.h"
#include "mongo/db/jsobj.h"
@@ -4762,7 +4763,7 @@
return Value(numericArg.getDecimal().quantize(Decimal128::kNormalizedZero,
Decimal128::kRoundTowardZero));
case NumberDouble:
- return Value(std::trunc(numericArg.getDouble()));
+ return Value(trunc(numericArg.getDouble()));
default:
return numericArg;
}
Index: src/mongo/db/pipeline/granularity_rounder_powers_of_two.cpp
--- src/mongo/db/pipeline/granularity_rounder_powers_of_two.cpp.orig 2018-06-21 21:46:07.000000000 +0200
+++ src/mongo/db/pipeline/granularity_rounder_powers_of_two.cpp 2018-06-28 20:26:14.476776000 +0200
@@ -67,7 +67,7 @@
Value exp;
if (value.getType() == BSONType::NumberDouble) {
- exp = Value(static_cast<int>(std::floor(std::log2(value.getDouble())) + 1.0));
+ exp = Value(static_cast<int>(std::floor(log2(value.getDouble())) + 1.0));
} else if (value.getType() == BSONType::NumberDecimal) {
Decimal128 input = value.getDecimal();
exp = Value(Decimal128(
@@ -92,7 +92,7 @@
Value exp;
if (value.getType() == BSONType::NumberDouble) {
- exp = Value(static_cast<int>(std::ceil(std::log2(value.getDouble())) - 1.0));
+ exp = Value(static_cast<int>(std::ceil(log2(value.getDouble())) - 1.0));
} else if (value.getType() == BSONType::NumberDecimal) {
Decimal128 input = value.getDecimal();
exp = Value(Decimal128(
Index: src/mongo/util/represent_as.h
--- src/mongo/util/represent_as.h.orig 2018-06-21 21:46:07.000000000 +0200
+++ src/mongo/util/represent_as.h 2018-06-28 20:26:14.476992000 +0200
@@ -202,7 +202,7 @@
// If Output is integral and number is a non-integral floating point value,
// return a disengaged optional.
if (std::is_floating_point<Input>::value && std::is_integral<Output>::value) {
- if (!(std::trunc(number) == number)) {
+ if (!(trunc(number) == number)) {
return {};
}
}
Index: src/mongo/util/summation.h
--- src/mongo/util/summation.h.orig 2018-06-21 21:46:07.000000000 +0200
+++ src/mongo/util/summation.h 2018-06-28 20:26:14.477123000 +0200
@@ -104,7 +104,7 @@
* Returns whether the accumulated sum has a fractional part.
*/
bool isInteger() const {
- return std::trunc(_sum) == _sum && std::trunc(_addend) == _addend;
+ return trunc(_sum) == _sum && trunc(_addend) == _addend;
}
/**
Index: src/third_party/SConscript
--- src/third_party/SConscript.orig 2018-06-21 21:46:07.000000000 +0200
+++ src/third_party/SConscript 2018-06-28 20:26:14.477283000 +0200
@@ -128,8 +128,8 @@
if use_system_version_of_library("pcre"):
pcreEnv = env.Clone(
SYSLIBDEPS=[
- env['LIBDEPS_PCRE_SYSLIBDEP'],
env['LIBDEPS_PCRECPP_SYSLIBDEP'],
+ env['LIBDEPS_PCRE_SYSLIBDEP'],
])
else:
pcreEnv = env.Clone()