gecko-dev/taskcluster/scripts/misc/build-clang-linux-win-cross.sh
Mike Hommey 6508a7f411 Bug 1621880 - Create a linux64-clang-win-cross toolchain. r=dmajor
This creates a new toolchain artifact that repacks a combination of the
linux64-clang compiler along with parts of the win64-clang-cl compiler.

This has multiple advantages:
- It removes some convoluted parts of build task definitions (limiting
that to only occur on the win-cross toolchain itself).
- It simplifies the build setup by not requiring to prepare for where
clang-cl.exe is.
- It speeds up getting compiler artifacts because the win64-clang-cl
artifact is very large (due to there not being a llvm shared library)
and bzipped, which is slow to decompress. Here, we only take what we
need for the cross builds.
- It adds the runtime files that e.g. PGO will require, and that
linux clang-cl insists lives in the clang directory, not the
win64-clang-cl one, and that would require some convoluted setup to make
it work with the two separate toolchains.

Differential Revision: https://phabricator.services.mozilla.com/D66543

--HG--
extra : moz-landing-system : lando
2020-03-12 21:05:28 +00:00

18 lines
559 B
Bash
Executable file

#!/bin/bash
set -x -e -v
# This script is to repack a linux clang with Windows clang-cl.exe and compiler runtime.
cd $MOZ_FETCHES_DIR
# We already have the Linux clang extracted in $MOZ_FETCHES_DIR/clang by fetch-content
# We have a non-extracted clang.tar.bz2 for Windows clang-cl that we need to extract
# files from.
tar -jxf clang.tar.bz2 --wildcards clang/lib/clang/*/lib/windows clang/bin/clang-cl.exe
chmod +x clang/bin/clang-cl.exe
tar -Jcf clang.tar.xz clang
# Put a tarball in the artifacts dir
mkdir -p $UPLOAD_DIR
cp clang.tar.xz $UPLOAD_DIR