diff options
author | Andrew Morrow <acm@mongodb.com> | 2015-03-29 19:35:27 -0400 |
---|---|---|
committer | Ramon Fernandez <ramon.fernandez@mongodb.com> | 2015-04-20 14:42:08 -0400 |
commit | c09d38c2de92bb0227cc273767ec4a9c22702cc0 (patch) | |
tree | c24f7efd2c1a79436275c10a2eb9dfd43017fba3 /src/mongo/SConscript | |
parent | ca9aed9d8ed7cba741064304038dc8d10752926f (diff) | |
download | mongo-c09d38c2de92bb0227cc273767ec4a9c22702cc0.tar.gz |
SERVER-17465 Do not attempt to use tcmalloc customizations with system tcmalloc
(cherry picked from commit 02a9fd0daf29dbd0557d51701444bd95a43868f1)
Diffstat (limited to 'src/mongo/SConscript')
-rw-r--r-- | src/mongo/SConscript | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/mongo/SConscript b/src/mongo/SConscript index 31a178eeda6..e0ac7b1c914 100644 --- a/src/mongo/SConscript +++ b/src/mongo/SConscript @@ -10,6 +10,7 @@ Import("env") Import("has_option") Import("get_option") Import("usev8") +Import("use_system_version_of_library") Import("v8suffix") Import("darwin windows solaris linux nix") Import("wiredtiger") @@ -451,7 +452,20 @@ env.CppUnitTest( ) if get_option('allocator') == 'tcmalloc': - env.Library('tcmalloc_set_parameter', + tcmspEnv = env.Clone() + + if not use_system_version_of_library('tcmalloc'): + + # Add in the include path for our vendored tcmalloc. + tcmspEnv.InjectThirdPartyIncludePaths('gperftools') + + # If our changes to tcmalloc are ever upstreamed, this should become set based on a top + # level configure check, though its effects should still be scoped just to these files. + tcmspEnv.Append( + CPPDEFINES=['MONGO_HAVE_GPERFTOOLS_GET_THREAD_CACHE_SIZE'] + ) + + tcmspEnv.Library('tcmalloc_set_parameter', [ 'util/tcmalloc_server_status_section.cpp', 'util/tcmalloc_set_parameter.cpp', @@ -874,6 +888,14 @@ env.CppUnitTest("fail_point_test", [ "util/fail_point_test.cpp" ], if has_option( 'use-cpu-profiler' ): serverOnlyFiles.append( 'db/commands/cpuprofile.cpp' ) env.Append(LIBS=['unwind']) + # If we are building with our internal gperftools, add the necessary include path. + # + # NOTE: This is pretty bad because it will spam this include path into many files that + # don't require it, but because of the way things are currently set up, it is not easy to + # scope it more narrowly. Better would be if the commands were a library, and could be + # conditionally made to depend on this file, as a library and then we could easily scope + # just to this file. + env.InjectThirdPartyIncludePaths('tcmalloc') env.Library("defaultversion", "s/default_version.cpp") |