Skip to content

Commit

Permalink
Bug 1755415 - Ship most compiler-rts alongside clang toolchains on al…
Browse files Browse the repository at this point in the history
…l 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
  • Loading branch information
glandium committed Feb 16, 2022
1 parent 30700e6 commit 15fc1cf
Show file tree
Hide file tree
Showing 14 changed files with 78 additions and 126 deletions.
20 changes: 0 additions & 20 deletions build/build-clang/build-clang.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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)

Expand Down
1 change: 0 additions & 1 deletion build/build-clang/clang-5.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"cxx": "/usr/bin/g++",
"as": "/usr/bin/gcc",
"build_wasm": false,
"wasi-compiler-rt": null,
"patches": [
"profile-g4a10504e1f70c.patch"
]
Expand Down
3 changes: 1 addition & 2 deletions build/build-clang/linux64.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
3 changes: 1 addition & 2 deletions build/build-clang/macosx64.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
3 changes: 1 addition & 2 deletions build/build-clang/win64.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
2 changes: 1 addition & 1 deletion taskcluster/ci/build/android-asan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion taskcluster/ci/build/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1654,7 +1654,7 @@ linux64-aarch64/opt:
fetches:
toolchain:
- linux64-binutils
- linux64-clang-aarch64-cross
- linux64-clang
- linux64-rust
- linux64-rust-size
- linux64-cbindgen
Expand Down
30 changes: 15 additions & 15 deletions taskcluster/ci/build/macosx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
16 changes: 8 additions & 8 deletions taskcluster/ci/build/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ win32/debug:
fetches:
toolchain:
- linux64-binutils
- linux64-clang-win-cross
- linux64-clang
- linux64-rust-cross
- linux64-rust-size
- linux64-nasm
Expand Down Expand Up @@ -158,7 +158,7 @@ win64/debug:
fetches:
toolchain:
- linux64-binutils
- linux64-clang-win-cross
- linux64-clang
- linux64-rust-cross
- linux64-rust-size
- linux64-nasm
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions taskcluster/ci/instrumented-build/kind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ jobs:
toolchain:
- linux64-binutils
- linux64-cctools-port
- linux64-clang-macosx-cross
- linux64-clang
- linux64-hfsplus
- linux64-libdmg
- linux64-rust-macos
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -274,7 +274,7 @@ jobs:
fetches:
toolchain:
- linux64-binutils
- linux64-clang-win-cross
- linux64-clang
- linux64-rust-cross
- linux64-rust-size
- linux64-nasm
Expand Down Expand Up @@ -319,7 +319,7 @@ jobs:
fetches:
toolchain:
- linux64-binutils
- linux64-clang-win-cross
- linux64-clang
- linux64-rust-cross
- linux64-rust-size
- linux64-nasm
Expand Down
4 changes: 2 additions & 2 deletions taskcluster/ci/searchfox/kind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
toolchain:
- linux64-binutils
- linux64-cctools-port
- linux64-clang-macosx-cross
- linux64-clang
- linux64-hfsplus
- linux64-libdmg
- linux64-nasm
Expand Down Expand Up @@ -135,7 +135,7 @@ jobs:
fetches:
toolchain:
- linux64-binutils
- linux64-clang-win-cross
- linux64-clang
- linux64-rust-cross
- linux64-rust-size
- linux64-nasm
Expand Down
4 changes: 2 additions & 2 deletions taskcluster/ci/toolchain/clang-tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
Loading

0 comments on commit 15fc1cf

Please sign in to comment.