summaryrefslogtreecommitdiffstats
path: root/base/allocator
diff options
context:
space:
mode:
authorbrettw <brettw@chromium.org>2015-11-12 12:11:39 -0800
committerCommit bot <commit-bot@chromium.org>2015-11-12 20:12:26 +0000
commit46c86d0ba1f6bf1abea78629ccb099eb8285ea7e (patch)
treef37e8d143971c2931099aaa3b8575f401c53566d /base/allocator
parentc4f7330abe94c5b80ec82ae9c312ad7ae52318b0 (diff)
downloadchromium_src-46c86d0ba1f6bf1abea78629ccb099eb8285ea7e.zip
chromium_src-46c86d0ba1f6bf1abea78629ccb099eb8285ea7e.tar.gz
chromium_src-46c86d0ba1f6bf1abea78629ccb099eb8285ea7e.tar.bz2
Roll buildtools 4a95614772..3ba3ca22ec
In order to roll GN c51453e958..d6763a7390 (r358852:r358968) and pick up the following changes: d6763a7 Support script response files in GN. 9eca8d0 include what you use: errno.h in exec_process.cc Adds shell=True to the message compiler wrapper script. This is required for the new way that GN sets the environment on actions, and matches how it used to run (gyp-win-tool used to set this). Do the same plus set the environment for the prep_libc step. TBR=dpranke@chromium.org CQ_EXTRA_TRYBOTS=tryserver.chromium.mac:mac_chromium_gn_dbg;tryserver.chromium.win:win8_chromium_gn_dbg,win_chromium_gn_x64_rel Review URL: https://codereview.chromium.org/1433093002 Cr-Commit-Position: refs/heads/master@{#359365}
Diffstat (limited to 'base/allocator')
-rw-r--r--base/allocator/BUILD.gn6
-rwxr-xr-xbase/allocator/prep_libc.py29
2 files changed, 29 insertions, 6 deletions
diff --git a/base/allocator/BUILD.gn b/base/allocator/BUILD.gn
index 32e5e6c..1d0ba62 100644
--- a/base/allocator/BUILD.gn
+++ b/base/allocator/BUILD.gn
@@ -71,6 +71,12 @@ if (is_win) {
visual_studio_path + "/vc/lib",
rebase_path("$target_gen_dir/allocator"),
current_cpu,
+
+ # The environment file in the build directory. This is required because
+ # the Windows toolchain setup saves the VC paths and such so that
+ # running "mc.exe" will work with the configured toolchain. This file
+ # is in the root build dir.
+ "environment.$current_cpu",
]
}
diff --git a/base/allocator/prep_libc.py b/base/allocator/prep_libc.py
index 079297b..a88d3bd 100755
--- a/base/allocator/prep_libc.py
+++ b/base/allocator/prep_libc.py
@@ -7,24 +7,34 @@
# This script takes libcmt.lib for VS2013 and removes the allocation related
# functions from it.
#
-# Usage: prep_libc.py <VCLibDir> <OutputDir> <arch>
+# Usage: prep_libc.py <VCLibDir> <OutputDir> <arch> [<environment_file>]
#
# 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 one of: 'ia32', 'x86' or 'x64'. ia32 and x86 are synonyms.
+#
+# If the environment_file argument is set, the environment variables in the
+# given file will be used to execute the VC tools. This file is in the same
+# format as the environment block passed to CreateProcess.
import os
import shutil
import subprocess
import sys
-def run(command):
+def run(command, env_dict):
"""Run |command|. If any lines that match an error condition then
- terminate."""
+ terminate.
+
+ The env_dict, will be used for the environment. None can be used to get the
+ default environment."""
error = 'cannot find member object'
+ # Need shell=True to search the path in env_dict for the executable.
popen = subprocess.Popen(
- command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+ command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True,
+ env=env_dict)
out, _ = popen.communicate()
for line in out.splitlines():
print line
@@ -41,6 +51,13 @@ def main():
bindir = 'SELF_64_amd64'
objdir = 'amd64'
vs_install_dir = os.path.join(vs_install_dir, 'amd64')
+
+ if len(sys.argv) == 5:
+ env_pairs = open(sys.argv[4]).read()[:-2].split('\0')
+ env_dict = dict([item.split('=', 1) for item in env_pairs])
+ else:
+ env_dict = None # Use the default environment.
+
output_lib = os.path.join(outdir, 'libcmt.lib')
shutil.copyfile(os.path.join(vs_install_dir, 'libcmt.lib'), output_lib)
shutil.copyfile(os.path.join(vs_install_dir, 'libcmt.pdb'),
@@ -57,11 +74,11 @@ def main():
for obj in cobjfiles:
cmd = ('lib /nologo /ignore:4006,4221 /remove:%s%s.obj %s' %
(cvspath, obj, output_lib))
- run(cmd)
+ run(cmd, env_dict)
for obj in cppobjfiles:
cmd = ('lib /nologo /ignore:4006,4221 /remove:%s%s.obj %s' %
(cppvspath, obj, output_lib))
- run(cmd)
+ run(cmd, env_dict)
if __name__ == "__main__":
sys.exit(main())