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
This commit is contained in:
Mike Hommey 2020-03-12 21:05:28 +00:00
Родитель 3aec963bb6
Коммит 6508a7f411
6 изменённых файлов: 47 добавлений и 57 удалений

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

@ -23,12 +23,8 @@ export UPX="${MOZ_FETCHES_DIR}/upx-3.95-win64/upx.exe"
if [ -f "${UPX}" ]; then
chmod +x "${UPX}"
fi
CLANG_CL_EXE_DIR="${MOZ_FETCHES_DIR}/clang-cl/clang/bin"
if [ -d "${CLANG_CL_EXE_DIR}" ]; then
chmod +x "${CLANG_CL_EXE_DIR}/clang-cl.exe"
fi
export WINE=${MOZ_FETCHES_DIR}/wine/bin/wine64
mk_add_options "export PATH=${VSPATH}/VC/bin/Hostx64/x86:${MOZ_FETCHES_DIR}/nsis-3.01:${CLANG_CL_EXE_DIR}:${PATH}"
mk_add_options "export PATH=${VSPATH}/VC/bin/Hostx64/x86:${MOZ_FETCHES_DIR}/nsis-3.01:${PATH}"
unset VC_PATH

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

@ -23,12 +23,8 @@ export UPX="${MOZ_FETCHES_DIR}/upx-3.95-win64/upx.exe"
if [ -f "${UPX}" ]; then
chmod +x "${UPX}"
fi
CLANG_CL_EXE_DIR="${MOZ_FETCHES_DIR}/clang-cl/clang/bin"
if [ -d "${CLANG_CL_EXE_DIR}" ]; then
chmod +x "${CLANG_CL_EXE_DIR}/clang-cl.exe"
fi
export WINE=${MOZ_FETCHES_DIR}/wine/bin/wine64
mk_add_options "export PATH=${VSPATH}/VC/bin/Hostx64/arm64:${MOZ_FETCHES_DIR}/nsis-3.01:${CLANG_CL_EXE_DIR}:${PATH}"
mk_add_options "export PATH=${VSPATH}/VC/bin/Hostx64/arm64:${MOZ_FETCHES_DIR}/nsis-3.01:${PATH}"
mk_add_options "export WINEPATH=${VSPATH}/VC/bin/Hostx64/x64"
unset VC_PATH

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

@ -23,12 +23,8 @@ export UPX="${MOZ_FETCHES_DIR}/upx-3.95-win64/upx.exe"
if [ -f "${UPX}" ]; then
chmod +x "${UPX}"
fi
CLANG_CL_EXE_DIR="${MOZ_FETCHES_DIR}/clang-cl/clang/bin"
if [ -d "${CLANG_CL_EXE_DIR}" ]; then
chmod +x "${CLANG_CL_EXE_DIR}/clang-cl.exe"
fi
export WINE=${MOZ_FETCHES_DIR}/wine/bin/wine64
mk_add_options "export PATH=${VSPATH}/VC/bin/Hostx64/x64:${MOZ_FETCHES_DIR}/nsis-3.01:${CLANG_CL_EXE_DIR}:${PATH}"
mk_add_options "export PATH=${VSPATH}/VC/bin/Hostx64/x64:${MOZ_FETCHES_DIR}/nsis-3.01:${PATH}"
unset VC_PATH

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

@ -44,12 +44,10 @@ win32/debug:
env:
LD_PRELOAD: "/builds/worker/fetches/liblowercase/liblowercase.so"
LOWERCASE_DIRS: "/builds/worker/checkouts/gecko/vs2017_15.8.4"
dependencies:
win64-clang-cl: toolchain-win64-clang-cl
fetches:
toolchain:
- linux64-binutils
- linux64-clang
- linux64-clang-win-cross
- linux64-rust-cross-1.41
- linux64-rust-size
- linux64-nasm
@ -62,10 +60,6 @@ win32/debug:
fetch:
- nsis-3.01-win
- upx-3.95-win
win64-clang-cl:
- artifact: clang.tar.bz2
extract: true
dest: clang-cl
win32/opt:
description: "Win32 Opt"
@ -101,12 +95,10 @@ win32/opt:
LD_PRELOAD: "/builds/worker/fetches/liblowercase/liblowercase.so"
LOWERCASE_DIRS: "/builds/worker/checkouts/gecko/vs2017_15.8.4"
run-on-projects: ['mozilla-central', 'try']
dependencies:
win64-clang-cl: toolchain-win64-clang-cl
fetches:
toolchain:
- linux64-binutils
- linux64-clang
- linux64-clang-win-cross
- linux64-rust-cross-1.41
- linux64-rust-size
- linux64-nasm
@ -119,10 +111,6 @@ win32/opt:
fetch:
- nsis-3.01-win
- upx-3.95-win
win64-clang-cl:
- artifact: clang.tar.bz2
extract: true
dest: clang-cl
win64/debug:
description: "Win64 Debug"
@ -158,12 +146,10 @@ win64/debug:
env:
LD_PRELOAD: "/builds/worker/fetches/liblowercase/liblowercase.so"
LOWERCASE_DIRS: "/builds/worker/checkouts/gecko/vs2017_15.8.4"
dependencies:
win64-clang-cl: toolchain-win64-clang-cl
fetches:
toolchain:
- linux64-binutils
- linux64-clang
- linux64-clang-win-cross
- linux64-rust-cross-1.41
- linux64-rust-size
- linux64-nasm
@ -176,10 +162,6 @@ win64/debug:
fetch:
- nsis-3.01-win
- upx-3.95-win
win64-clang-cl:
- artifact: clang.tar.bz2
extract: true
dest: clang-cl
win64-fuzzing/debug:
description: "Win64 Fuzzing Debug"
@ -295,13 +277,11 @@ win64/opt:
# another.
LD_PRELOAD: "/builds/worker/fetches/liblowercase/liblowercase.so"
LOWERCASE_DIRS: "/builds/worker/checkouts/gecko/vs2017_15.8.4"
dependencies:
win64-clang-cl: toolchain-win64-clang-cl
run-on-projects: ['mozilla-central', 'try']
fetches:
toolchain:
- linux64-binutils
- linux64-clang
- linux64-clang-win-cross
- linux64-rust-cross-1.41
- linux64-rust-size
- linux64-nasm
@ -314,10 +294,6 @@ win64/opt:
fetch:
- nsis-3.01-win
- upx-3.95-win
win64-clang-cl:
- artifact: clang.tar.bz2
extract: true
dest: clang-cl
win64-plain/opt:
description: "Win64 Opt Plain"
@ -1088,12 +1064,10 @@ win64-aarch64/debug:
LD_PRELOAD: "/builds/worker/fetches/liblowercase/liblowercase.so"
LOWERCASE_DIRS: "/builds/worker/checkouts/gecko/vs2017_15.9.6"
mozconfig-variant: debug
dependencies:
win64-clang-cl: toolchain-win64-clang-cl
fetches:
toolchain:
- linux64-binutils
- linux64-clang
- linux64-clang-win-cross
- linux64-rust-cross-1.41
- linux64-rust-size
- linux64-nasm
@ -1106,10 +1080,6 @@ win64-aarch64/debug:
fetch:
- nsis-3.01-win
- upx-3.95-win
win64-clang-cl:
- artifact: clang.tar.bz2
extract: true
dest: clang-cl
win64-aarch64/opt:
description: "AArch64 Win64 Opt"
@ -1149,12 +1119,10 @@ win64-aarch64/opt:
env:
LD_PRELOAD: "/builds/worker/fetches/liblowercase/liblowercase.so"
LOWERCASE_DIRS: "/builds/worker/checkouts/gecko/vs2017_15.9.6"
dependencies:
win64-clang-cl: toolchain-win64-clang-cl
fetches:
toolchain:
- linux64-binutils
- linux64-clang
- linux64-clang-win-cross
- linux64-rust-cross-1.41
- linux64-rust-size
- linux64-nasm
@ -1167,10 +1135,6 @@ win64-aarch64/opt:
fetch:
- nsis-3.01-win
- upx-3.95-win
win64-clang-cl:
- artifact: clang.tar.bz2
extract: true
dest: clang-cl
win64-aarch64-eme/opt:
description: "AArch64 Win64 Opt w/ EME"

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

@ -208,6 +208,26 @@ linux64-clang-9-macosx-cross:
- linux64-clang-9
- linux64-gcc-7
linux64-clang-9-win-cross:
description: "Clang 9 toolchain build with Windows Compiler RT libs"
treeherder:
symbol: TL(clang9-win-cross)
worker-type: b-linux
worker:
max-run-time: 600
run:
script: build-clang-linux-win-cross.sh
toolchain-alias: linux64-clang-win-cross
toolchain-artifact: public/build/clang.tar.xz
dependencies:
win64-clang-cl: toolchain-win64-clang-cl
fetches:
toolchain:
- linux64-clang-9
win64-clang-cl:
- artifact: clang.tar.bz2
extract: false
macosx64-clang:
description: "Clang toolchain build"
treeherder:

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

@ -0,0 +1,18 @@
#!/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