diff options
author | mtklein <mtklein@chromium.org> | 2016-09-07 12:26:53 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-09-07 12:26:53 -0700 |
commit | 1a9466799ecde49f6231c9b79f4745fb789836c2 (patch) | |
tree | d25406759dea4401c98d3445d90af380a4674209 /infra/bots/assets | |
parent | 600c737b64eae2c7379442ae2c852853cce3a278 (diff) |
clang_linux: also build an MSAN libc++
This will be used by MSAN bots: build with -stdlib=libc++,
then run with LD_LIBRARY_PATH=/path/to/clang_linux/msan.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2324503002
Review-Url: https://codereview.chromium.org/2324503002
Diffstat (limited to 'infra/bots/assets')
-rw-r--r-- | infra/bots/assets/clang_linux/VERSION | 2 | ||||
-rwxr-xr-x | infra/bots/assets/clang_linux/create.py | 18 |
2 files changed, 16 insertions, 4 deletions
diff --git a/infra/bots/assets/clang_linux/VERSION b/infra/bots/assets/clang_linux/VERSION index e440e5c842..bf0d87ab1b 100644 --- a/infra/bots/assets/clang_linux/VERSION +++ b/infra/bots/assets/clang_linux/VERSION @@ -1 +1 @@ -3
\ No newline at end of file +4
\ No newline at end of file diff --git a/infra/bots/assets/clang_linux/create.py b/infra/bots/assets/clang_linux/create.py index ace0d6c957..a7c2484433 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() |