Bug 1616694 - Turn the macosx-cross toolchain task into a mere repackage r=nalexander

Currently the macosx-cross toolchain build pulls in a linux64-clang toolchain, uses it to build a Mac native toolchain, and then clobbers the result with pieces of the Linux toolchain. This means that the same version of LLVM is used to build the Mac pieces and be part of the final artifact. This will become a problem with upcoming LLVM 11 where we'll want to build the Mac pieces with LLVM 9 but otherwise repackage an LLVM 11 Linux toolchain.

So this commit makes the macosx-cross workflow look more like the win-cross one: take two compilers built elsewhere and just merge them.

Differential Revision: https://phabricator.services.mozilla.com/D83378
This commit is contained in:
David Major 2020-07-14 11:33:50 +00:00
Родитель 9a66f3e9e3
Коммит 82ce441b57
2 изменённых файлов: 18 добавлений и 44 удалений

Просмотреть файл

@ -172,27 +172,20 @@ linux64-clang-9-macosx-cross:
symbol: TL(clang9-macosx-cross)
worker-type: b-linux
worker:
max-run-time: 3600
env:
TOOLTOOL_MANIFEST: "browser/config/tooltool-manifests/macosx64/cross-releng.manifest"
max-run-time: 600
run:
script: build-clang-linux-macosx-cross.sh
arguments:
- 'build/build-clang/clang-macosx64.json'
resources:
- 'build/build-clang/clang-macosx64.json'
- 'taskcluster/scripts/misc/tooltool-download.sh'
toolchain-alias: linux64-clang-macosx-cross
toolchain-artifact: public/build/clang.tar.zst
tooltool-downloads: internal
dependencies:
macosx64-clang-9: toolchain-macosx64-clang-9
fetches:
fetch:
- clang-9
toolchain:
- linux64-binutils
- linux64-cctools-port-clang-9
- linux64-clang-9
- linux64-gcc-7
macosx64-clang-9:
# Put this into a new directory so it doesn't conflict with the linux toolchain
- artifact: clang.tar.zst
dest: clang-mac
linux64-clang-9-win-cross:
description: "Clang 9 toolchain build with Windows Compiler RT libs"

Просмотреть файл

@ -4,34 +4,15 @@ set -x -e -v
# This script is for building clang for Mac OS X targets on a Linux host,
# including native Mac OS X Compiler-RT libraries and llvm-symbolizer.
cd $GECKO_PATH
. taskcluster/scripts/misc/tooltool-download.sh
# these variables are used in build-clang.py
export CROSS_CCTOOLS_PATH=$MOZ_FETCHES_DIR/cctools
export CROSS_SYSROOT=$(ls -d $MOZ_FETCHES_DIR/MacOSX10.*.sdk)
export PATH=$PATH:$CROSS_CCTOOLS_PATH/bin
# gets a bit too verbose here
set +x
cd $MOZ_FETCHES_DIR/llvm-project
python3 $GECKO_PATH/build/build-clang/build-clang.py -c $GECKO_PATH/$1 --skip-tar
# We now have a native macosx64 toolchain.
# What we want is a native linux64 toolchain which can target macosx64 and use the sanitizer dylibs.
# Overlay the linux64 toolchain that we used for this build (except llvm-symbolizer).
(
cd build/stage1
# Need the macosx64 native llvm-symbolizer since this gets shipped with sanitizer builds
mv clang/bin/llvm-symbolizer $MOZ_FETCHES_DIR/clang/bin/
cp --remove-destination -lr $MOZ_FETCHES_DIR/clang/* clang/
tar -c clang | $GECKO_PATH/taskcluster/scripts/misc/zstdpy > $MOZ_FETCHES_DIR/llvm-project/clang.tar.zst
)
set -x
# Put a tarball in the artifacts dir
mkdir -p $UPLOAD_DIR
cp clang.tar.* $UPLOAD_DIR
cd $MOZ_FETCHES_DIR
# We have a native linux64 toolchain in $MOZ_FETCHES_DIR/clang
# We have a native macosx64 toolchain in $MOZ_FETCHES_DIR/clang-mac/clang
# What we want is a mostly-linux64 toolchain but with a macosx64 llvm-symbolizer and runtime libraries
mv clang-mac/clang/bin/llvm-symbolizer clang/bin/
cp --remove-destination -lr clang/* clang-mac/clang/
cd clang-mac
tar -c clang | $GECKO_PATH/taskcluster/scripts/misc/zstdpy > $UPLOAD_DIR/clang.tar.zst