Bug 1421404: Add lld to the build-clang task. r=glandium
authorDavid Major <dmajor@mozilla.com>
Fri, 01 Dec 2017 11:12:07 -0500
changeset 394576 15fd03de877fbb3928d9d0743adb5c1f1eacd0f4
parent 394575 f5a3054a4c388c9e5782cac5154454c0be1c7847
child 394577 1355b9f0cfc11de7bbdb7f131149ccc7f8f8d6d3
push id33008
push useraciure@mozilla.com
push dateSat, 02 Dec 2017 09:47:20 +0000
treeherdermozilla-central@0a559782a53a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1421404
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1421404: Add lld to the build-clang task. r=glandium
build/build-clang/README
build/build-clang/build-clang.py
--- a/build/build-clang/README
+++ b/build/build-clang/README
@@ -27,16 +27,18 @@ Config file format
 ------------------
 
 build-clang.py accepts a JSON config format with the following fields:
 
 * llvm_revision: The LLVM SVN revision to build.
 * stages: Use 1, 2, or 3 to select different compiler stages.  The default is 3.
 * llvm_repo: SVN path to the LLVM repo.
 * clang_repo: SVN path to the Clang repo.
+* extra_repo: SVN path to the clang-tools-extra repo.
+* lld_repo: SVN path to the lld repo.
 * compiler_repo: SVN path to the compiler-rt repo.
 * libcxx_repo: SVN path to the libcxx repo.
 * libcxxabi_repo: SVN path to the libcxxabi repo.
 * python_path: Path to the Python 2.7 installation on the machine building clang.
 * gcc_dir: Path to the gcc toolchain installation, only required on Linux.
 * cc: Path to the bootsraping C Compiler.
 * cxx: Path to the bootsraping C++ Compiler.
 * as: Path to the assembler tool.
--- a/build/build-clang/build-clang.py
+++ b/build/build-clang/build-clang.py
@@ -338,16 +338,17 @@ if __name__ == "__main__":
         base_dir = os.path.join(os.getcwd(), 'llvm-sources')
 
     source_dir = base_dir + "/src"
     build_dir = base_dir + "/build"
 
     llvm_source_dir = source_dir + "/llvm"
     clang_source_dir = source_dir + "/clang"
     extra_source_dir = source_dir + "/extra"
+    lld_source_dir = source_dir + "/lld"
     compiler_rt_source_dir = source_dir + "/compiler-rt"
     libcxx_source_dir = source_dir + "/libcxx"
     libcxxabi_source_dir = source_dir + "/libcxxabi"
 
     if is_darwin():
         os.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.7'
 
     exe_ext = ""
@@ -374,16 +375,17 @@ if __name__ == "__main__":
     if args.clean:
         shutil.rmtree(build_dir)
         os.sys.exit(0)
 
     llvm_revision = config["llvm_revision"]
     llvm_repo = config["llvm_repo"]
     clang_repo = config["clang_repo"]
     extra_repo = config.get("extra_repo")
+    lld_repo = config.get("lld_repo")
     compiler_repo = config["compiler_repo"]
     libcxx_repo = config["libcxx_repo"]
     libcxxabi_repo = config.get("libcxxabi_repo")
     stages = 3
     if "stages" in config:
         stages = int(config["stages"])
         if stages not in (1, 2, 3):
             raise ValueError("We only know how to build 1, 2, or 3 stages")
@@ -444,27 +446,31 @@ if __name__ == "__main__":
             svn_update(checkout_dir, llvm_revision)
         else:
             svn_co(source_dir, repo, checkout_dir, llvm_revision)
 
     checkout_or_update(llvm_repo, llvm_source_dir)
     checkout_or_update(clang_repo, clang_source_dir)
     checkout_or_update(compiler_repo, compiler_rt_source_dir)
     checkout_or_update(libcxx_repo, libcxx_source_dir)
+    if lld_repo:
+        checkout_or_update(lld_repo, lld_source_dir)
     if libcxxabi_repo:
         checkout_or_update(libcxxabi_repo, libcxxabi_source_dir)
     if extra_repo:
         checkout_or_update(extra_repo, extra_source_dir)
     for p in config.get("patches", []):
         patch(p, source_dir)
 
     symlinks = [(clang_source_dir,
                  llvm_source_dir + "/tools/clang"),
                 (extra_source_dir,
                  llvm_source_dir + "/tools/clang/tools/extra"),
+                (lld_source_dir,
+                 llvm_source_dir + "/tools/lld"),
                 (compiler_rt_source_dir,
                  llvm_source_dir + "/projects/compiler-rt"),
                 (libcxx_source_dir,
                  llvm_source_dir + "/projects/libcxx"),
                 (libcxxabi_source_dir,
                  llvm_source_dir + "/projects/libcxxabi")]
     for l in symlinks:
         # On Windows, we have to re-copy the whole directory every time.