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

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

Issue 2324503002: clang_linux: also build an MSAN libc++ (Closed)
Patch Set: version Created 4 years, 3 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/VERSION ('k') | no next file » | 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
index ace0d6c957c0d0b431172a3bb174c1d110c6186b..a7c2484433c6723404e908c5f7bb8a413703c5a5 100755
--- a/infra/bots/assets/clang_linux/create.py
+++ b/infra/bots/assets/clang_linux/create.py
@@ -18,6 +18,7 @@ REPO = "https://llvm.googlesource.com/"
BRANCH = "release_39"
def create_asset(target_dir):
+ # Build Clang, lld, compiler-rt (sanitizer support) and libc++.
os.chdir(tempfile.mkdtemp())
subprocess.check_call(["git", "clone", "-b", BRANCH, REPO + "llvm"])
os.chdir("llvm/tools")
@@ -35,14 +36,25 @@ def create_asset(target_dir):
"-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"])
+ subprocess.check_call(["ninja", "install"])
+ # Copy a couple extra files we need.
+ 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"])
+ # Finally, build libc++ for MSAN bots using the Clang we just built.
+ os.mkdir("../msan_out")
+ os.chdir("../msan_out")
+ subprocess.check_call(["cmake", "..", "-G", "Ninja",
+ "-DCMAKE_BUILD_TYPE=MinSizeRel",
+ "-DCMAKE_C_COMPILER=" + target_dir + "/bin/clang",
+ "-DCMAKE_CXX_COMPILER=" + target_dir + "/bin/clang++",
+ "-DLLVM_USE_SANITIZER=MemoryWithOrigins"])
+ subprocess.check_call(["ninja", "cxx"])
+ subprocess.check_call(["cp", "-r", "lib", target_dir + "/msan"])
+
def main():
parser = argparse.ArgumentParser()
« no previous file with comments | « infra/bots/assets/clang_linux/VERSION ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698