Bug 1430315 - Add a toolchain job to build llvm-dsymutil independently. r=rillian draft
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 16 Jan 2018 16:23:33 +0900
changeset 721290 67310f08ef07e885c717293beea66e8edd266aa7
parent 720739 a3887394965f161d011eebc74e8987a653366e4b
child 721291 1d8b6c0b84feebb96df75827ffaf6f0abffb5968
push id95780
push userbmo:mh+mozilla@glandium.org
push dateTue, 16 Jan 2018 23:45:45 +0000
reviewersrillian
bugs1430315, 1409265, 1410148
milestone59.0a1
Bug 1430315 - Add a toolchain job to build llvm-dsymutil independently. r=rillian We've had problems with crashes in llvm-dsymutil for a while, and while they are, in essence, due to the fact that rustc produces bad debug info, they are a hurdle to our builds. The tool comes along clang, and updating clang is not necessarily easy (witness bug 1409265), so, so far, we've relied on backporting fixes, which can be time confusing (witness bug 1410148). OTOH, llvm-dsymutil is a rather specific tool, that doesn't strictly need to be tied to clang. It's only tied to it because it uses the llvm code to do some of the things it does, and it's part of the llvm source tree. But it could just as well be a separate tool, like it was(is?) on OSX. So, we add a toolchain job to build it from the llvm source, independently from clang, so that we can update it separately, if we hit new crashes that happen to already be fixed on llvm trunk. It will also allow to more easily update after upstream fixes crashes after we report them.
taskcluster/ci/toolchain/linux.yml
taskcluster/scripts/misc/build-llvm-dsymutil.sh
--- a/taskcluster/ci/toolchain/linux.yml
+++ b/taskcluster/ci/toolchain/linux.yml
@@ -166,16 +166,33 @@ linux64-sixgill:
         script: build-gcc-sixgill-plugin-linux.sh
         resources:
             - 'build/unix/build-gcc/build-gcc.sh'
             - 'taskcluster/scripts/misc/build-gcc-sixgill-plugin-linux.sh'
         toolchain-artifact: public/build/sixgill.tar.xz
     toolchains:
         - linux64-gcc-4.9
 
+linux64-llvm-dsymutil:
+    description: "llvm-dsymutil toolchain build"
+    treeherder:
+        kind: build
+        platform: toolchains/opt
+        symbol: TL(dsymutil)
+        tier: 1
+    worker-type: aws-provisioner-v1/gecko-{level}-b-linux
+    worker:
+        max-run-time: 1800
+    run:
+        using: toolchain-script
+        script: build-llvm-dsymutil.sh
+        toolchain-artifact: public/build/llvm-dsymutil.tar.xz
+    toolchains:
+        - linux64-gcc-4.9
+
 linux64-binutils:
     description: "Binutils toolchain build"
     treeherder:
         kind: build
         platform: toolchains/opt
         symbol: TL(binutil)
         tier: 1
     worker-type: aws-provisioner-v1/gecko-{level}-b-linux
new file mode 100755
--- /dev/null
+++ b/taskcluster/scripts/misc/build-llvm-dsymutil.sh
@@ -0,0 +1,38 @@
+#!/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
+
+git clone -n https://github.com/llvm-mirror/llvm
+
+cd llvm
+git checkout 4727bc748a48e46824eae55a81ae890cd25c3a34
+
+mkdir build
+cd build
+
+cmake \
+  -GNinja \
+  -DCMAKE_BUILD_TYPE=Release \
+  -DLLVM_TARGETS_TO_BUILD=X86 \
+  -DCMAKE_C_COMPILER=$HOME_DIR/src/gcc/bin/gcc \
+  ..
+
+export LD_LIBRARY_PATH=$HOME_DIR/src/gcc/lib64
+
+ninja llvm-dsymutil
+
+strip bin/llvm-dsymutil
+
+tar --xform='s,^,llvm-dsymutil/,' -Jcf llvm-dsymutil.tar.xz bin/llvm-dsymutil
+
+mkdir -p $UPLOAD_DIR
+cp llvm-dsymutil.tar.xz $UPLOAD_DIR