Bug 1457482 Add a LTO Clang Toolchain draft
authorTom Ritter <tom@mozilla.com>
Fri, 13 Apr 2018 15:22:57 -0500
changeset 789167 8c937ff5f6289e898136870cb39948f14baddebf
parent 789020 d2d518b1f8730eb61554df7179ef9a2aeed4d843
child 789168 b328964fe03864f799d9ee4898efe5277b12b5c5
child 789219 2dda3a41e4dac6b3ae69346e5d519ed7836a3b0e
push id108208
push userbmo:tom@mozilla.com
push dateFri, 27 Apr 2018 18:43:07 +0000
bugs1457482
milestone61.0a1
Bug 1457482 Add a LTO Clang Toolchain MozReview-Commit-ID: KYY0DqFxbDE
build/build-clang/clang-6-pre-linux64-lto.json
taskcluster/ci/toolchain/linux.yml
taskcluster/scripts/misc/build-clang-6-lto-pre-linux.sh
new file mode 100644
--- /dev/null
+++ b/build/build-clang/clang-6-pre-linux64-lto.json
@@ -0,0 +1,21 @@
+{
+    "llvm_revision": "317840",
+    "stages": "3",
+    "build_libcxx": true,
+    "build_type": "Release",
+    "assertions": false,
+    "llvm_repo": "https://llvm.org/svn/llvm-project/llvm/trunk",
+    "clang_repo": "https://llvm.org/svn/llvm-project/cfe/trunk",
+    "lld_repo": "https://llvm.org/svn/llvm-project/lld/trunk",
+    "compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/trunk",
+    "libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/trunk",
+    "libcxxabi_repo": "https://llvm.org/svn/llvm-project/libcxxabi/trunk",
+    "python_path": "/usr/bin/python2.7",
+    "gcc_dir": "/builds/worker/workspace/build/src/gcc",
+    "cc": "/builds/worker/workspace/build/src/gcc/bin/gcc",
+    "cxx": "/builds/worker/workspace/build/src/gcc/bin/g++",
+    "as": "/builds/worker/workspace/build/src/gcc/bin/gcc",
+    "patches": [
+      "find_symbolizer_linux.patch"
+    ]
+}
--- a/taskcluster/ci/toolchain/linux.yml
+++ b/taskcluster/ci/toolchain/linux.yml
@@ -86,16 +86,37 @@ linux64-clang-6-pre:
         resources:
             - 'build/build-clang/build-clang.py'
             - 'build/build-clang/clang-6-pre-linux64.json'
             - 'taskcluster/scripts/misc/tooltool-download.sh'
         toolchain-artifact: public/build/clang.tar.xz
     toolchains:
         - linux64-gcc-4.9
 
+linux64-clang-6-lto-pre:
+    description: "Clang 6 LTO Pre toolchain build"
+    treeherder:
+        kind: build
+        platform: toolchains/opt
+        symbol: TL(clang6ltop)
+        tier: 1
+    worker-type: aws-provisioner-v1/gecko-{level}-b-linux-xlarge
+    worker:
+        max-run-time: 7200
+    run:
+        using: toolchain-script
+        script: build-clang-6-lto-pre-linux.sh
+        resources:
+            - 'build/build-clang/build-clang.py'
+            - 'build/build-clang/clang-6-pre-linux64-lto.json'
+            - 'taskcluster/scripts/misc/tooltool-download.sh'
+        toolchain-artifact: public/build/clang.tar.xz
+    toolchains:
+        - linux64-gcc-4.9
+
 linux64-clang-6-pre-macosx-cross:
     description: "Clang 6 Pre toolchain build with MacOS Compiler RT libs"
     treeherder:
         kind: build
         platform: toolchains/opt
         symbol: TL(clang6p-macosx-cross)
         tier: 1
     worker-type: aws-provisioner-v1/gecko-{level}-b-linux
new file mode 100755
--- /dev/null
+++ b/taskcluster/scripts/misc/build-clang-6-lto-pre-linux.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+set -x -e -v
+
+# This script is for building clang for Linux.
+
+WORKSPACE=$HOME/workspace
+HOME_DIR=$WORKSPACE/build
+UPLOAD_DIR=$HOME/artifacts
+
+cd $HOME_DIR/src
+
+. taskcluster/scripts/misc/tooltool-download.sh
+
+# gets a bit too verbose here
+set +x
+
+cd build/build-clang
+# |mach python| sets up a virtualenv for us!
+../../mach python ./build-clang.py -c clang-6-pre-linux64-lto.json
+
+set -x
+
+# Put a tarball in the artifacts dir
+mkdir -p $UPLOAD_DIR
+cp clang.tar.* $UPLOAD_DIR