Bug 1755415 - Ship most compiler-rts alongside clang toolchains on all platforms. r=firefox-build-system-reviewers,mhentges

This improves out-of-the-box support for cross-compiles on tier-1 build
platforms, including for asan. This also reduces the number of different
*-cross toolchains we need for CI builds.

The linux clang is now also a repack, like the others, and the insertion
of the wasm compiler-rt is moved to the repack, which also allows to
remove that part of the build-clang.py script.

Differential Revision: https://phabricator.services.mozilla.com/D138749
This commit is contained in:
Mike Hommey 2022-02-17 03:44:39 +00:00
parent 6ae8fef73d
commit c10d0fa5e2
14 changed files with 78 additions and 126 deletions

View File

@ -674,7 +674,6 @@ def main():
stage1_inst_dir = stage1_dir + "/" + package_name
final_stage_dir = stage1_dir
final_inst_dir = stage1_inst_dir
if is_darwin():
extra_cflags = []
@ -775,7 +774,6 @@ def main():
stage2_dir = build_dir + "/stage2"
stage2_inst_dir = stage2_dir + "/" + package_name
final_stage_dir = stage2_dir
final_inst_dir = stage2_inst_dir
if skip_stages < 1:
cc = stage1_inst_dir + "/bin/%s%s" % (cc_name, exe_ext)
cxx = stage1_inst_dir + "/bin/%s%s" % (cxx_name, exe_ext)
@ -805,7 +803,6 @@ def main():
stage3_dir = build_dir + "/stage3"
stage3_inst_dir = stage3_dir + "/" + package_name
final_stage_dir = stage3_dir
final_inst_dir = stage3_inst_dir
if skip_stages < 2:
cc = stage2_inst_dir + "/bin/%s%s" % (cc_name, exe_ext)
cxx = stage2_inst_dir + "/bin/%s%s" % (cxx_name, exe_ext)
@ -843,9 +840,7 @@ def main():
if stages >= 4 and skip_stages < 4:
stage4_dir = build_dir + "/stage4"
stage4_inst_dir = stage4_dir + "/" + package_name
final_stage_dir = stage4_dir
final_inst_dir = stage4_inst_dir
profile = None
if pgo:
if skip_stages == 3:
@ -883,21 +878,6 @@ def main():
os.path.join(final_stage_dir, package_name), osx_cross_compile
)
# Copy the wasm32 builtins to the final_inst_dir if the archive is present.
if "wasi-compiler-rt" in config:
compiler_rt = config["wasi-compiler-rt"].format(**os.environ)
if os.path.isdir(compiler_rt):
for libdir in glob.glob(
os.path.join(final_inst_dir, "lib", "clang", "*", "lib")
):
srcdir = os.path.join(compiler_rt, "lib", "wasi")
print("Copying from wasi-compiler-rt srcdir %s" % srcdir)
# Copy the contents of the "lib/wasi" subdirectory to the
# appropriate location in final_inst_dir.
destdir = os.path.join(libdir, "wasi")
mkdir_p(destdir)
copy_tree(srcdir, destdir)
if not args.skip_tar:
build_tar_package("%s.tar.zst" % package_name, final_stage_dir, package_name)

View File

@ -3,7 +3,6 @@
"cxx": "/usr/bin/g++",
"as": "/usr/bin/gcc",
"build_wasm": false,
"wasi-compiler-rt": null,
"patches": [
"profile-g4a10504e1f70c.patch"
]

View File

@ -2,6 +2,5 @@
"build_wasm": true,
"cc": "/usr/lib/llvm-11/bin/clang",
"cxx": "/usr/lib/llvm-11/bin/clang++",
"as": "/usr/lib/llvm-11/bin/clang",
"wasi-compiler-rt": "{MOZ_FETCHES_DIR}/compiler-rt-wasm32-wasi"
"as": "/usr/lib/llvm-11/bin/clang"
}

View File

@ -7,6 +7,5 @@
"ar": "{MOZ_FETCHES_DIR}/cctools/bin/x86_64-apple-darwin-ar",
"ranlib": "{MOZ_FETCHES_DIR}/cctools/bin/x86_64-apple-darwin-ranlib",
"libtool": "{MOZ_FETCHES_DIR}/cctools/bin/x86_64-apple-darwin-libtool",
"ld": "{MOZ_FETCHES_DIR}/clang/bin/clang",
"wasi-compiler-rt": "{MOZ_FETCHES_DIR}/compiler-rt-wasm32-wasi"
"ld": "{MOZ_FETCHES_DIR}/clang/bin/clang"
}

View File

@ -2,6 +2,5 @@
"build_wasm": true,
"cc": "cl.exe",
"cxx": "cl.exe",
"ml": "ml64.exe",
"wasi-compiler-rt": "{MOZ_FETCHES_DIR}/compiler-rt-wasm32-wasi"
"ml": "ml64.exe"
}

View File

@ -68,7 +68,7 @@ android-x86_64-asan-fuzzing/opt:
use-sccache: true
fetches:
toolchain:
- linux64-clang-android-cross
- linux64-clang
- linux64-sccache
- android-gradle-dependencies
optimization:

View File

@ -1654,7 +1654,7 @@ linux64-aarch64/opt:
fetches:
toolchain:
- linux64-binutils
- linux64-clang-aarch64-cross
- linux64-clang
- linux64-rust
- linux64-rust-size
- linux64-cbindgen

View File

@ -51,7 +51,7 @@ macosx64/debug:
fetches:
toolchain:
- linux64-cctools-port
- linux64-clang-macosx-cross
- linux64-clang
- linux64-sccache
- macosx64-sdk-10.12
- sysroot-wasm32-wasi
@ -80,7 +80,7 @@ macosx64-hybrid/plain:
fetches:
toolchain:
- linux64-cctools-port
- linux64-clang-macosx-cross
- linux64-clang
- linux64-sccache
- macosx64-sdk-10.12
- sysroot-wasm32-wasi
@ -109,7 +109,7 @@ macosx64/opt:
fetches:
toolchain:
- linux64-cctools-port
- linux64-clang-macosx-cross
- linux64-clang
- linux64-sccache
- macosx64-sdk-10.12
- sysroot-wasm32-wasi
@ -139,7 +139,7 @@ macosx64-asan-fuzzing/opt:
fetches:
toolchain:
- linux64-cctools-port
- linux64-clang-macosx-cross
- linux64-clang
- linux64-sccache
- macosx64-llvm-symbolizer
- macosx64-sdk-10.12
@ -173,7 +173,7 @@ macosx64-fuzzing/debug:
fetches:
toolchain:
- linux64-cctools-port
- linux64-clang-macosx-cross
- linux64-clang
- linux64-sccache
- macosx64-sdk-10.12
- sysroot-wasm32-wasi
@ -212,7 +212,7 @@ macosx64-x64-devedition/opt:
fetches:
toolchain:
- linux64-cctools-port
- linux64-clang-macosx-cross
- linux64-clang
- macosx64-sdk-10.12
- sysroot-wasm32-wasi
@ -250,7 +250,7 @@ macosx64-aarch64-devedition/opt:
fetches:
toolchain:
- linux64-cctools-port
- linux64-clang-macosx-cross
- linux64-clang
- macosx64-sdk-11.0
- sysroot-wasm32-wasi
@ -415,7 +415,7 @@ macosx64-noopt/debug:
fetches:
toolchain:
- linux64-cctools-port
- linux64-clang-macosx-cross
- linux64-clang
- linux64-sccache
- macosx64-sdk-10.12
- sysroot-wasm32-wasi
@ -446,7 +446,7 @@ macosx64-aarch64-noopt/debug:
fetches:
toolchain:
- linux64-cctools-port
- linux64-clang-macosx-cross
- linux64-clang
- linux64-sccache
- macosx64-sdk-11.0
- sysroot-wasm32-wasi
@ -472,7 +472,7 @@ macosx64-add-on-devel/opt:
fetches:
toolchain:
- linux64-cctools-port
- linux64-clang-macosx-cross
- linux64-clang
- linux64-sccache
- macosx64-sdk-10.12
- sysroot-wasm32-wasi
@ -505,7 +505,7 @@ macosx64-x64-shippable/opt:
fetches:
toolchain:
- linux64-cctools-port
- linux64-clang-macosx-cross
- linux64-clang
- macosx64-sdk-10.12
- sysroot-wasm32-wasi
@ -540,7 +540,7 @@ macosx64-aarch64-shippable/opt:
fetches:
toolchain:
- linux64-cctools-port
- linux64-clang-macosx-cross
- linux64-clang
- macosx64-sdk-11.0
- sysroot-wasm32-wasi
@ -706,7 +706,7 @@ macosx64-ccov/opt:
fetches:
toolchain:
- linux64-cctools-port
- linux64-clang-macosx-cross
- linux64-clang
- linux64-sccache
- macosx64-sdk-10.12
- sysroot-wasm32-wasi
@ -736,7 +736,7 @@ macosx64-gcp/debug:
fetches:
toolchain:
- linux64-cctools-port
- linux64-clang-macosx-cross
- linux64-clang
- linux64-sccache
- macosx64-sdk-10.12
- sysroot-wasm32-wasi
@ -767,7 +767,7 @@ macosx64-gcp/opt:
fetches:
toolchain:
- linux64-cctools-port
- linux64-clang-macosx-cross
- linux64-clang
- linux64-sccache
- macosx64-sdk-10.12
- sysroot-wasm32-wasi

View File

@ -48,7 +48,7 @@ win32/debug:
fetches:
toolchain:
- linux64-binutils
- linux64-clang-win-cross
- linux64-clang
- linux64-rust-cross
- linux64-rust-size
- linux64-nasm
@ -158,7 +158,7 @@ win64/debug:
fetches:
toolchain:
- linux64-binutils
- linux64-clang-win-cross
- linux64-clang
- linux64-rust-cross
- linux64-rust-size
- linux64-nasm
@ -265,7 +265,7 @@ win64-fuzzing/debug:
fetches:
toolchain:
- linux64-binutils
- linux64-clang-win-cross
- linux64-clang
- linux64-rust-cross
- linux64-rust-size
- linux64-nasm
@ -1027,7 +1027,7 @@ win64-asan/debug:
fetches:
toolchain:
- linux64-binutils
- linux64-clang-win-cross
- linux64-clang
- linux64-rust-cross
- linux64-rust-size
- linux64-nasm
@ -1083,7 +1083,7 @@ win64-asan/opt:
fetches:
toolchain:
- linux64-binutils
- linux64-clang-win-cross
- linux64-clang
- linux64-rust-cross
- linux64-rust-size
- linux64-nasm
@ -1149,7 +1149,7 @@ win64-asan-reporter-shippable/opt:
fetches:
toolchain:
- linux64-binutils
- linux64-clang-win-cross
- linux64-clang
- linux64-rust-cross
- linux64-rust-size
- linux64-nasm
@ -1200,7 +1200,7 @@ win64-asan-fuzzing/opt:
fetches:
toolchain:
- linux64-binutils
- linux64-clang-win-cross
- linux64-clang
- linux64-rust-cross
- linux64-rust-size
- linux64-nasm
@ -1385,7 +1385,7 @@ win64-aarch64/debug:
fetches:
toolchain:
- linux64-binutils
- linux64-clang-win-cross
- linux64-clang
- linux64-rust-cross
- linux64-rust-size
- linux64-nasm

View File

@ -122,7 +122,7 @@ jobs:
toolchain:
- linux64-binutils
- linux64-cctools-port
- linux64-clang-macosx-cross
- linux64-clang
- linux64-hfsplus
- linux64-libdmg
- linux64-rust-macos
@ -181,7 +181,7 @@ jobs:
- linux64-jdk
# Workaround issues in binutils from the ndk with the compiler-rt from clang-13
- linux64-binutils
- linux64-clang-android-cross
- linux64-clang
- linux64-rust-android
- linux64-rust-size
- linux64-cbindgen
@ -235,7 +235,7 @@ jobs:
- android-ndk-linux
- android-sdk-linux
- linux64-jdk
- linux64-clang-android-cross
- linux64-clang
- linux64-rust-android
- linux64-rust-size
- linux64-cbindgen
@ -274,7 +274,7 @@ jobs:
fetches:
toolchain:
- linux64-binutils
- linux64-clang-win-cross
- linux64-clang
- linux64-rust-cross
- linux64-rust-size
- linux64-nasm
@ -319,7 +319,7 @@ jobs:
fetches:
toolchain:
- linux64-binutils
- linux64-clang-win-cross
- linux64-clang
- linux64-rust-cross
- linux64-rust-size
- linux64-nasm

View File

@ -88,7 +88,7 @@ jobs:
toolchain:
- linux64-binutils
- linux64-cctools-port
- linux64-clang-macosx-cross
- linux64-clang
- linux64-hfsplus
- linux64-libdmg
- linux64-nasm
@ -135,7 +135,7 @@ jobs:
fetches:
toolchain:
- linux64-binutils
- linux64-clang-win-cross
- linux64-clang
- linux64-rust-cross
- linux64-rust-size
- linux64-nasm

View File

@ -60,7 +60,7 @@ macosx64-clang-tidy:
fetches:
toolchain:
- linux64-cctools-port
- linux64-clang-13-macosx-cross
- linux64-clang-13
- macosx64-sdk-11.0
macosx64-arch64-clang-tidy:
@ -83,7 +83,7 @@ macosx64-arch64-clang-tidy:
fetches:
toolchain:
- linux64-cctools-port
- linux64-clang-13-macosx-cross
- linux64-clang-13
- macosx64-sdk-11.0
win64-clang-tidy:

View File

@ -152,15 +152,11 @@ linux64-clang-13-profile:
- linux64-x64-compiler-rt-13
- linux64-toolchain-sysroot
linux64-clang-13:
linux64-clang-13-raw:
description: "Clang 13 toolchain build"
attributes:
local-toolchain: true
treeherder:
symbol: TL(clang13)
run-on-projects: [trunk]
symbol: TL(clang13-raw)
run:
using: toolchain-script
script: build-clang.sh
arguments:
- 'build/build-clang/linux64.json'
@ -172,8 +168,6 @@ linux64-clang-13:
- 'build/build-clang/clang-13.json'
- 'build/build-clang/skip-3-stages.json'
- 'build/build-clang/4stages-pgo.json'
toolchain-alias:
- linux64-clang
toolchain-artifact: public/build/clang.tar.zst
fetches:
fetch:
@ -182,73 +176,36 @@ linux64-clang-13:
- linux64-clang-13-stage1
- linux64-clang-13-profile
- linux64-toolchain-sysroot
- wasm32-wasi-compiler-rt-13
linux64-clang-13-android-cross:
linux64-clang-13:
description: "Clang 13 toolchain build"
attributes:
local-toolchain: true
treeherder:
symbol: TL(clang13-android)
run:
using: toolchain-script
script: repack-clang.sh
toolchain-alias: linux64-clang-android-cross
toolchain-artifact: public/build/clang.tar.zst
fetches:
toolchain:
- linux64-clang-13
- android-aarch64-compiler-rt-13
- android-arm-compiler-rt-13
- android-x86-compiler-rt-13
- android-x64-compiler-rt-13
linux64-clang-13-aarch64-cross:
description: "Clang 13 toolchain build with aarch64 runtime"
treeherder:
symbol: TL(clang13-aarch64)
symbol: TL(clang13)
worker-type: b-linux
worker:
max-run-time: 600
run-on-projects: [trunk]
run:
script: repack-clang.sh
toolchain-alias: linux64-clang-aarch64-cross
toolchain-artifact: public/build/clang.tar.zst
fetches:
toolchain:
- linux64-clang-13
- linux64-aarch64-compiler-rt-13
linux64-clang-13-macosx-cross:
description: "Clang 13 toolchain repack with MacOS Compiler RT libs"
treeherder:
symbol: TL(clang13-macosx-cross)
worker-type: b-linux
worker:
max-run-time: 600
run:
script: repack-clang.sh
toolchain-alias: linux64-clang-macosx-cross
toolchain-alias:
- linux64-clang
toolchain-artifact: public/build/clang.tar.zst
fetches:
toolchain:
- linux64-cctools-port
- linux64-clang-13
- linux64-clang-13-raw
- android-aarch64-compiler-rt-13
- android-arm-compiler-rt-13
- android-x64-compiler-rt-13
- android-x86-compiler-rt-13
- linux64-aarch64-compiler-rt-13
- linux64-x64-compiler-rt-13
- linux64-x86-compiler-rt-13
- macosx64-aarch64-compiler-rt-13
- macosx64-x64-compiler-rt-13
linux64-clang-13-win-cross:
description: "Clang 13 toolchain repack with Windows Compiler RT libs"
treeherder:
symbol: TL(clang13-win-cross)
worker-type: b-linux
worker:
max-run-time: 600
run:
script: repack-clang.sh
toolchain-alias: linux64-clang-win-cross
toolchain-artifact: public/build/clang.tar.zst
fetches:
toolchain:
- linux64-clang-13
- wasm32-wasi-compiler-rt-13
- win32-compiler-rt-13
- win64-compiler-rt-13
@ -281,7 +238,6 @@ macosx64-clang-13-raw:
- linux64-clang-13-profile
- macosx64-sdk-11.0
- macosx64-x64-compiler-rt-13
- wasm32-wasi-compiler-rt-13
macosx64-clang-13:
description: "Clang 13 toolchain repack with MacOS Compiler RT libs"
@ -304,8 +260,18 @@ macosx64-clang-13:
toolchain:
- linux64-cctools-port
- macosx64-clang-13-raw
- android-aarch64-compiler-rt-13
- android-arm-compiler-rt-13
- android-x64-compiler-rt-13
- android-x86-compiler-rt-13
- linux64-aarch64-compiler-rt-13
- linux64-x64-compiler-rt-13
- linux64-x86-compiler-rt-13
- macosx64-aarch64-compiler-rt-13
- macosx64-x64-compiler-rt-13
- wasm32-wasi-compiler-rt-13
- win32-compiler-rt-13
- win64-compiler-rt-13
macosx64-aarch64-clang-13-raw:
description: "Clang 13 toolchain build"
@ -338,7 +304,6 @@ macosx64-aarch64-clang-13-raw:
- linux64-clang-13-profile
- macosx64-sdk-11.0
- macosx64-aarch64-compiler-rt-13
- wasm32-wasi-compiler-rt-13
macosx64-aarch64-clang-13:
description: "Clang 13 toolchain repack with MacOS Compiler RT libs"
@ -361,6 +326,7 @@ macosx64-aarch64-clang-13:
- macosx64-aarch64-clang-13-raw
- macosx64-aarch64-compiler-rt-13
- macosx64-x64-compiler-rt-13
- wasm32-wasi-compiler-rt-13
win64-clang-13-raw:
description: "Clang-cl 13 toolchain build"
@ -393,7 +359,6 @@ win64-clang-13-raw:
- ninja
toolchain:
- win64-clang-13-stage1
- wasm32-wasi-compiler-rt-13
- win64-compiler-rt-13
win64-clang-13:
@ -413,7 +378,18 @@ win64-clang-13:
toolchain-artifact: public/build/clang.tar.zst
fetches:
toolchain:
- linux64-cctools-port
- win64-clang-13-raw
- android-aarch64-compiler-rt-13
- android-arm-compiler-rt-13
- android-x64-compiler-rt-13
- android-x86-compiler-rt-13
- linux64-aarch64-compiler-rt-13
- linux64-x64-compiler-rt-13
- linux64-x86-compiler-rt-13
- macosx64-aarch64-compiler-rt-13
- macosx64-x64-compiler-rt-13
- wasm32-wasi-compiler-rt-13
- win32-compiler-rt-13
- win64-compiler-rt-13

View File

@ -112,7 +112,7 @@ jobs:
toolchain:
- linux64-rust-macos
- linux64-cctools-port
- linux64-clang-13-macosx-cross
- linux64-clang-13
- macosx64-sdk-10.12
- wrench-deps
macosx64-clang-13: