Reviewers: tandrii(chromium), Benedikt Meurer,
Message:
PTAL. Original CL + ignore windows...
https://codereview.chromium.org/1330623002/diff/1/build/download_gold_plugin.py
File build/download_gold_plugin.py (right):
https://codereview.chromium.org/1330623002/diff/1/build/download_gold_plugin.py#newcode18
build/download_gold_plugin.py:18: # Bail out on windows and cygwin.
This bailout is new compared to the original CL.
Description:
Reland Automatically download gold plugin for cfi builds.
This relands https://codereview.chromium.org/1303183005
BUG=chromium:515782
LOG=n
Please review this at https://codereview.chromium.org/1330623002/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+33, -0 lines):
M DEPS
M build/download_gold_plugin.py
Index: DEPS
diff --git a/DEPS b/DEPS
index
0c6cda6077c0d75680bd948bd9cc3ca1dea74742..c06da810796e4c0752daa9bdc4b1722ff26be7ed
100644
--- a/DEPS
+++ b/DEPS
@@ -103,6 +103,13 @@ hooks = [
],
},
{
+ # Pull gold plugin if needed or requested via GYP_DEFINES.
+ # Note: This must run before the clang update.
+ 'name': 'gold_plugin',
+ 'pattern': '.',
+ 'action': ['python', 'v8/build/download_gold_plugin.py'],
+ },
+ {
# Pull clang if needed or requested via GYP_DEFINES.
# Note: On Win, this should run after win_toolchain, as it may use it.
'name': 'clang',
Index: build/download_gold_plugin.py
diff --git a/build/download_gold_plugin.py b/build/download_gold_plugin.py
index
7a0c21b8d7077348f9ddbcdad6890e549d1b493c..ba9ae5ca7f78cc0e8c55893a0be8b6a43d491c68
100755
--- a/build/download_gold_plugin.py
+++ b/build/download_gold_plugin.py
@@ -8,11 +8,20 @@
import json
import os
+import re
+import platform
import shutil
import subprocess
import sys
import zipfile
+# Bail out on windows and cygwin.
+if "win" in platform.system().lower():
+ # Python 2.7.6 hangs at the second path.insert command on windows. Works
+ # with python 2.7.8.
+ print "Gold plugin download not supported on windows."
+ sys.exit(0)
+
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
CHROME_SRC = os.path.abspath(os.path.join(SCRIPT_DIR, os.pardir))
sys.path.insert(0, os.path.join(CHROME_SRC, 'tools'))
@@ -30,7 +39,24 @@ CLANG_REVISION = os.popen(CLANG_UPDATE_PY + '
--print-revision').read().rstrip()
CLANG_BUCKET = 'gs://chromium-browser-clang/Linux_x64'
+GOLD_PLUGIN_PATH = os.path.join(LLVM_BUILD_PATH, 'lib', 'LLVMgold.so')
+
+sys.path.insert(0, os.path.join(CHROME_SRC, 'tools', 'clang', 'scripts'))
+
+import update
+
def main():
+ if not re.search(r'cfi_vptr=1', os.environ.get('GYP_DEFINES', '')):
+ # Bailout if this is not a cfi build.
+ print 'Skipping gold plugin download for non-cfi build.'
+ return 0
+ if (os.path.exists(GOLD_PLUGIN_PATH) and
+ update.ReadStampFile().strip() == update.PACKAGE_VERSION):
+ # Bailout if clang is up-to-date. This requires the script to be run
before
+ # the clang update step! I.e. afterwards clang would always be
up-to-date.
+ print 'Skipping gold plugin download. File present and clang up to
date.'
+ return 0
+
targz_name = 'llvmgold-%s.tgz' % CLANG_REVISION
remote_path = '%s/%s' % (CLANG_BUCKET, targz_name)
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.