aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRenato Golin <rengolin@gmail.com>2016-04-21 19:04:28 +0100
committerRenato Golin <rengolin@gmail.com>2016-04-21 19:04:28 +0100
commitac5aa74c6587bbbcef4875c2f7bc48ae7b2c2b93 (patch)
tree2b855f85b59c514cfb47e09f5a38f62e8691ac31
parent214719cba7639ae6f8b21a10c80c00deda6906c9 (diff)
[ZORG] Update ClangBuilder to build libc++ with clanglinaro-local/fullbot
This change makes the Clang builder checkout libc++/abi and build on stage 2 of a selfhosting build (since we can't guarantee the host compiler will be able to build it).
-rw-r--r--zorg/buildbot/builders/ClangBuilder.py45
1 files changed, 44 insertions, 1 deletions
diff --git a/zorg/buildbot/builders/ClangBuilder.py b/zorg/buildbot/builders/ClangBuilder.py
index 027c8a19..96f0f18f 100644
--- a/zorg/buildbot/builders/ClangBuilder.py
+++ b/zorg/buildbot/builders/ClangBuilder.py
@@ -3,6 +3,7 @@ import buildbot.process.factory
import copy
import os
from datetime import datetime
+import copy
from buildbot.process.properties import WithProperties, Property
from buildbot.steps.shell import Configure, ShellCommand, SetProperty
@@ -363,6 +364,7 @@ def getClangBuildFactory(
def addSVNUpdateSteps(f,
checkout_clang_tools_extra,
checkout_compiler_rt,
+ checkout_libcxx,
checkout_test_suite):
# We *must* checkout at least Clang+LLVM
f.addStep(SVN(name='svn-llvm',
@@ -518,7 +520,9 @@ def getClangCMakeBuildFactory(
# Extra repositories
checkout_clang_tools_extra=True,
- checkout_compiler_rt=True):
+ checkout_compiler_rt=True,
+ checkout_libcxx=True):
+
return _getClangCMakeBuildFactory(
clean=clean, test=test, cmake=cmake, jobs=jobs, vs=vs,
vs_target_arch=vs_target_arch, useTwoStage=useTwoStage,
@@ -559,6 +563,7 @@ def _getClangCMakeBuildFactory(
# Extra repositories
checkout_clang_tools_extra=True,
checkout_compiler_rt=True,
+ checkout_libcxx=True,
# Upload artifacts to Google Cloud Storage (for the llvmbisect tool)
stage1_upload_directory=None,
@@ -572,6 +577,7 @@ def _getClangCMakeBuildFactory(
addSVNUpdateSteps(f,
checkout_clang_tools_extra=checkout_clang_tools_extra,
checkout_compiler_rt=checkout_compiler_rt,
+ checkout_libcxx=checkout_libcxx,
checkout_test_suite=runTestSuite)
# If jobs not defined, Ninja will choose a suitable value
@@ -597,6 +603,10 @@ def _getClangCMakeBuildFactory(
stage2_build = 'stage2'
stage2_install = 'stage2.install'
+ # LibUnwind extra CMake argument
+ if checkout_libcxx:
+ extra_cmake_args.extend(["-DLIBCXXABI_USE_LLVM_UNWINDER=True", "-DCMAKE_CXX_FLAGS=-std=c++11"])
+
# Set up VS environment, if appropriate.
if vs:
f.addStep(SetProperty(
@@ -622,6 +632,14 @@ def _getClangCMakeBuildFactory(
flunkOnFailure=False,
property="exists_ninja_1"))
+ # Make sure libcxx/cxxabi/unwind are not present for stage 1
+ f.addStep(ShellCommand(name='clean libcxx for stage 1',
+ command=['rm','-f','libcxx','libcxxabi','libunwind'],
+ warnOnFailure=True,
+ description='cleaning libcxx for stage 1',
+ descriptionDone='clean',
+ workdir='llvm/projects',
+ env=env))
############# STAGE 1
f.addStep(ShellCommand(name='cmake stage 1',
@@ -689,6 +707,30 @@ def _getClangCMakeBuildFactory(
workdir='.',
env=env))
+ # If we checked out libcxx, link it here
+ if checkout_libcxx:
+ f.addStep(ShellCommand(name='setup libcxx',
+ command=['ln','-s','../../libcxx'],
+ warnOnFailure=True,
+ description='linking libcxx into projects',
+ descriptionDone='libcxx set up',
+ workdir='llvm/projects',
+ env=env))
+ f.addStep(ShellCommand(name='setup libcxxabi',
+ command=['ln','-s','../../libcxxabi'],
+ warnOnFailure=True,
+ description='linking libcxxabi into projects',
+ descriptionDone='libcxxabi set up',
+ workdir='llvm/projects',
+ env=env))
+ f.addStep(ShellCommand(name='setup libunwind',
+ command=['ln','-s','../../libunwind'],
+ warnOnFailure=True,
+ description='linking libunwind into projects',
+ descriptionDone='libunwind set up',
+ workdir='llvm/projects',
+ env=env))
+
# Set the compiler using the CC and CXX environment variables to work around
# backslash string escaping bugs somewhere between buildbot and cmake. The
# env.exe helper is required to run the tests, so hopefully it's already on
@@ -752,6 +794,7 @@ def _getClangCMakeBuildFactory(
cxx = WithProperties('%(workdir)s/'+compiler_path+'/bin/'+cxx)
# LNT Command line
+ # FIXME: If twoStage && libcxx, add --std=libc++ flags.
if jobs is None:
jobs = 1
test_suite_cmd = [python, lnt, 'runtest', 'nt',