Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(273)

Unified Diff: infra/bots/assets/clang_linux/create.py

Issue 2294353002: Add and use a clang_linux asset. (Closed)
Patch Set: SAN|Clang Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « infra/bots/assets/clang_linux/common.py ('k') | infra/bots/assets/clang_linux/create_and_upload.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: infra/bots/assets/clang_linux/create.py
diff --git a/infra/bots/assets/clang_linux/create.py b/infra/bots/assets/clang_linux/create.py
new file mode 100755
index 0000000000000000000000000000000000000000..c72261693c7b78a6cc9b4e3d3b9b09930ca27faf
--- /dev/null
+++ b/infra/bots/assets/clang_linux/create.py
@@ -0,0 +1,54 @@
+#!/usr/bin/env python
+#
+# Copyright 2016 Google Inc.
+#
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+
+"""Create a Clang toolchain for Linux hosts."""
+
+
+import argparse
+import os
+import subprocess
+import tempfile
+
+REPO = "https://llvm.googlesource.com/"
+BRANCH = "release_39"
+
+def create_asset(target_dir):
+ os.chdir(tempfile.mkdtemp())
+ subprocess.check_call(["git", "clone", "-b", BRANCH, REPO + "llvm"])
+ os.chdir("llvm/tools")
+ subprocess.check_call(["git", "clone", "-b", BRANCH, REPO + "clang"])
+ os.chdir("../projects")
+ subprocess.check_call(["git", "clone", "-b", BRANCH, REPO + "compiler-rt"])
+ subprocess.check_call(["git", "clone", "-b", BRANCH, REPO + "libcxx"])
+ subprocess.check_call(["git", "clone", "-b", BRANCH, REPO + "libcxxabi"])
+ os.chdir("..")
+ os.mkdir("out")
+ os.chdir("out")
+ subprocess.check_call(["cmake", "..", "-G", "Ninja",
+ "-DCMAKE_BUILD_TYPE=MinSizeRel",
+ "-DCMAKE_INSTALL_PREFIX=" + target_dir,
+ "-DLLVM_INSTALL_TOOLCHAIN_ONLY=ON",
+ "-DLLVM_ENABLE_TERMINFO=OFF"])
+ subprocess.check_call(["cmake", "--build", "."])
+ subprocess.check_call(["cmake", "--build", ".", "--target", "install"])
+ subprocess.check_call(["cp", "bin/llvm-symbolizer", target_dir + "/bin"])
+
+ libstdcpp = subprocess.check_output(["c++",
+ "-print-file-name=libstdc++.so.6"])
+ subprocess.check_call(["cp", libstdcpp.strip(), target_dir + "/lib"])
+
+
+def main():
+ parser = argparse.ArgumentParser()
+ parser.add_argument('--target_dir', '-t', required=True)
+ args = parser.parse_args()
+ create_asset(args.target_dir)
+
+
+if __name__ == '__main__':
+ main()
« no previous file with comments | « infra/bots/assets/clang_linux/common.py ('k') | infra/bots/assets/clang_linux/create_and_upload.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698