mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-12 22:28:59 +02:00
The cctools-port build scripts were pulling and building the master branch of the cctools-port repo, which means they'd build whatever was there when they get triggered. I think this was copied from my build-cctools script which did the same thing, so it's my fault in the end! This patch pins a revision in the script so we'll build the same thing until we explicitly update. I also fixed the scripts to use git instead of tc-vcs, since tc-vcs prints misleading error messages, and nothing else uses that anymore. Finally, I removed the build-cctools script, since all the builds are using cctools-port now so it doesn't serve any useful purpose. MozReview-Commit-ID: 5myqHS4duor --HG-- extra : rebase_source : 11231cbe49c7ba830a880bfa4600f0a24d61471d
55 lines
2 KiB
Bash
Executable file
55 lines
2 KiB
Bash
Executable file
#!/bin/bash
|
|
set -x -e -v
|
|
|
|
# This script is for building cctools (Apple's binutils) for Linux using
|
|
# cctools-port (https://github.com/tpoechtrager/cctools-port).
|
|
|
|
WORKSPACE=$HOME/workspace
|
|
UPLOAD_DIR=$WORKSPACE/artifacts
|
|
|
|
# Repository info
|
|
: CROSSTOOL_PORT_REPOSITORY ${CROSSTOOL_PORT_REPOSITORY:=https://github.com/tpoechtrager/cctools-port}
|
|
: CROSSTOOL_PORT_REV ${CROSSTOOL_PORT_REV:=8e9c3f2506b51cf56725eaa60b6e90e240e249ca}
|
|
|
|
# Set some crosstools-port directories
|
|
CROSSTOOLS_SOURCE_DIR=$WORKSPACE/crosstools-port
|
|
CROSSTOOLS_CCTOOLS_DIR=$CROSSTOOLS_SOURCE_DIR/cctools
|
|
CROSSTOOLS_BUILD_DIR=$WORKSPACE/cctools
|
|
CLANG_DIR=$WORKSPACE/clang
|
|
|
|
# Create our directories
|
|
mkdir -p $CROSSTOOLS_BUILD_DIR
|
|
|
|
git clone --no-checkout $CROSSTOOL_PORT_REPOSITORY $CROSSTOOLS_SOURCE_DIR
|
|
cd $CROSSTOOLS_SOURCE_DIR
|
|
git checkout $CROSSTOOL_PORT_REV
|
|
echo "Building from commit hash `git rev-parse $CROSSTOOL_PORT_REV`..."
|
|
|
|
# Fetch clang from tooltool
|
|
cd $WORKSPACE
|
|
wget -O tooltool.py https://raw.githubusercontent.com/mozilla/build-tooltool/master/tooltool.py
|
|
chmod +x tooltool.py
|
|
: TOOLTOOL_CACHE ${TOOLTOOL_CACHE:=/home/worker/tooltool-cache}
|
|
export TOOLTOOL_CACHE
|
|
|
|
wget ${GECKO_HEAD_REPOSITORY}/raw-file/${GECKO_HEAD_REV}/browser/config/tooltool-manifests/linux64/clang.manifest
|
|
|
|
python tooltool.py -v --manifest=clang.manifest fetch
|
|
|
|
# Configure crosstools-port
|
|
cd $CROSSTOOLS_CCTOOLS_DIR
|
|
export CC=$CLANG_DIR/bin/clang
|
|
export CXX=$CLANG_DIR/bin/clang++
|
|
export LDFLAGS=/lib64/libpthread.so.0
|
|
./autogen.sh
|
|
./configure --prefix=$CROSSTOOLS_BUILD_DIR --target=x86_64-apple-darwin11 --with-llvm-config=$CLANG_DIR/bin/llvm-config
|
|
|
|
# Build cctools
|
|
make -j `nproc --all` install
|
|
strip $CROSSTOOLS_BUILD_DIR/bin/*
|
|
# cctools-port doesn't include dsymutil but clang will need to find it.
|
|
cp $CLANG_DIR/bin/llvm-dsymutil $CROSSTOOLS_BUILD_DIR/bin/x86_64-apple-darwin11-dsymutil
|
|
|
|
# Put a tarball in the artifacts dir
|
|
mkdir -p $UPLOAD_DIR
|
|
tar cJf $UPLOAD_DIR/cctools.tar.xz -C $CROSSTOOLS_BUILD_DIR/.. `basename $CROSSTOOLS_BUILD_DIR`
|