Bug 1272629 - Add taskcluster task to build binutils package
MozReview-Commit-ID: HxM7MzUDG5j
new file mode 100755
--- /dev/null
+++ b/build/unix/build-binutils/build-binutils.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+binutils_version=2.25.1
+make_flags='-j12'
+
+root_dir="$1"
+if [ -z "$root_dir" -o ! -d "$root_dir" ]; then
+ root_dir=$(mktemp -d)
+fi
+cd $root_dir
+
+if test -z $TMPDIR; then
+ TMPDIR=/tmp/
+fi
+
+# Download the source of the specified version of binutils
+wget -c -P $TMPDIR ftp://ftp.gnu.org/gnu/binutils/binutils-${binutils_version}.tar.bz2 || exit 1
+tar xjf $TMPDIR/binutils-${binutils_version}.tar.bz2
+
+# Build binutils
+mkdir binutils-objdir
+cd binutils-objdir
+
+../binutils-$binutils_version/configure --prefix /tools/binutils/ --enable-gold --enable-plugins --disable-nls || exit 1
+make $make_flags || exit 1
+make install $make_flags DESTDIR=$root_dir || exit 1
+
+cd ..
+
+# Make a package of the built binutils
+cd $root_dir/tools
+tar caf $root_dir/binutils.tar.xz binutils/
--- a/taskcluster/ci/legacy/tasks/branches/base_jobs.yml
+++ b/taskcluster/ci/legacy/tasks/branches/base_jobs.yml
@@ -800,8 +800,15 @@ tasks:
- 'taskcluster/scripts/misc/build-gcc-linux.sh'
linux64-clang:
task: tasks/builds/linux64_clang.yml
root: true
when:
file_patterns:
- 'build/build-clang/**'
- 'taskcluster/scripts/misc/build-clang-linux.sh'
+ linux64-binutils:
+ task: tasks/builds/linux64_binutils.yml
+ root: true
+ when:
+ file_patterns:
+ - 'build/unix/build-binutils/**'
+ - 'taskcluster/scripts/misc/build-binutils-linux.sh'
new file mode 100644
--- /dev/null
+++ b/taskcluster/ci/legacy/tasks/builds/linux64_binutils.yml
@@ -0,0 +1,45 @@
+$inherits:
+ from: 'tasks/builds/firefox_docker_base.yml'
+ variables:
+ build_name: 'linux64-binutils'
+ build_type: 'opt'
+task:
+ metadata:
+ name: '[TC] binutils'
+ description: 'binutils'
+
+ workerType: opt-linux64
+
+ routes:
+ - 'index.buildbot.branches.{{project}}.binutils'
+ - 'index.buildbot.revisions.{{head_rev}}.{{project}}.binutils'
+
+ payload:
+ env:
+ MOZHARNESS_DISABLE: 'true'
+ TOOLS_DISABLE: 'true'
+
+ maxRunTime: 36000
+
+ command: ["/bin/bash", "-c", "cd /home/worker/ && ./bin/checkout-sources.sh && ./workspace/build/src/taskcluster/scripts/misc/build-binutils-linux.sh" ]
+
+ artifacts:
+ 'public/binutils.tar.xz':
+ type: file
+ path: '/home/worker/workspace/artifacts/binutils.tar.xz'
+ expires:
+ relative-datestamp: "1 year"
+
+ extra:
+ treeherderEnv:
+ - staging
+ - production
+ treeherder:
+ groupSymbol: Cc
+ groupName: Compilers, submitted by taskcluster
+ symbol: binutils
+ machine:
+ platform: linux64
+ locations:
+ build: null
+ tests: null
new file mode 100755
--- /dev/null
+++ b/taskcluster/scripts/misc/build-binutils-linux.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+set -x -e -v
+
+# This script is for building binutils for Linux.
+
+WORKSPACE=$HOME/workspace
+HOME_DIR=$WORKSPACE/build
+UPLOAD_DIR=$WORKSPACE/artifacts
+
+cd $HOME_DIR/src
+
+build/unix/build-binutils/build-binutils.sh $HOME_DIR
+
+# Put a tarball in the artifacts dir
+mkdir -p $UPLOAD_DIR
+cp $HOME_DIR/binutils.tar.* $UPLOAD_DIR