summaryrefslogtreecommitdiffstats
path: root/base/allocator
diff options
context:
space:
mode:
authorscottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-22 18:38:21 +0000
committerscottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-22 18:38:21 +0000
commit9052d3e7a45550de5d230fc0fdf6c8bdfe92667f (patch)
tree8f2e643e75320d8cb0c3d4d13d9af0f2b7731bde /base/allocator
parentacc2ce5513c06f13def84465501f7a30df2037a0 (diff)
downloadchromium_src-9052d3e7a45550de5d230fc0fdf6c8bdfe92667f.zip
chromium_src-9052d3e7a45550de5d230fc0fdf6c8bdfe92667f.tar.gz
chromium_src-9052d3e7a45550de5d230fc0fdf6c8bdfe92667f.tar.bz2
GN win: prep_libc and fix tcmalloc linkage
On top of https://codereview.chromium.org/290633012/ R=brettw@chromium.org Review URL: https://codereview.chromium.org/290713002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@272249 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/allocator')
-rw-r--r--base/allocator/BUILD.gn34
-rwxr-xr-xbase/allocator/prep_libc.py2
2 files changed, 34 insertions, 2 deletions
diff --git a/base/allocator/BUILD.gn b/base/allocator/BUILD.gn
index ac29edf..e598f8f 100644
--- a/base/allocator/BUILD.gn
+++ b/base/allocator/BUILD.gn
@@ -14,6 +14,29 @@ group("allocator") {
}
}
+# This config and libc modification are only used on Windows.
+if (is_win) {
+ import("//build/config/win/visual_studio_version.gni")
+
+ config("nocmt") {
+ ldflags = [
+ "/NODEFAULTLIB:libcmt",
+ "/NODEFAULTLIB:libcmtd",
+ ]
+ libs = [ rebase_path("$target_gen_dir/allocator/libcmt.lib") ]
+ }
+
+ action("prep_libc") {
+ script = "prep_libc.py"
+ outputs = [ "$target_gen_dir/allocator/libcmt.lib" ]
+ args = [
+ visual_studio_path + "/vc/lib",
+ rebase_path("$target_gen_dir/allocator"),
+ cpu_arch,
+ ]
+ }
+}
+
if (!is_android) {
# tcmalloc currently won't compile on Android.
source_set("tcmalloc") {
@@ -125,6 +148,8 @@ if (!is_android) {
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
+ deps = []
+
if (is_win) {
sources -= [
"$tcmalloc_dir/src/base/elf_mem_image.cc",
@@ -152,7 +177,14 @@ if (!is_android) {
"$tcmalloc_dir/src/profiler.cc",
]
defines += [ "PERFTOOLS_DLL_DECL=" ]
+
+ direct_dependent_configs = [ ":nocmt" ]
+
+ deps += [
+ ":prep_libc",
+ ]
}
+
if (is_linux || is_android) {
sources -= [
"$tcmalloc_dir/src/system-alloc.h",
@@ -191,7 +223,7 @@ if (!is_android) {
configs += [ "//build/config/compiler:optimize_max" ]
}
- deps = [
+ deps += [
"//base/third_party/dynamic_annotations",
]
diff --git a/base/allocator/prep_libc.py b/base/allocator/prep_libc.py
index ba25cea0..471140c 100755
--- a/base/allocator/prep_libc.py
+++ b/base/allocator/prep_libc.py
@@ -12,7 +12,7 @@
# VCLibDir is the path where VC is installed, something like:
# C:\Program Files\Microsoft Visual Studio 8\VC\lib
# OutputDir is the directory where the modified libcmt file should be stored.
-# arch is either 'ia32' or 'x64'
+# arch is one of: 'ia32', 'x86' or 'x64'. ia32 and x86 are synonyms.
import os
import shutil