diff --git a/build/build-clang/linux64.json b/build/build-clang/linux64.json index 66f5bae94284..26dc5a0841d9 100644 --- a/build/build-clang/linux64.json +++ b/build/build-clang/linux64.json @@ -3,5 +3,5 @@ "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" + "wasi-compiler-rt": "{MOZ_FETCHES_DIR}/compiler-rt-wasm32-wasi" } diff --git a/build/build-clang/macosx64.json b/build/build-clang/macosx64.json index 212df987c4ed..13b1cdf56caa 100644 --- a/build/build-clang/macosx64.json +++ b/build/build-clang/macosx64.json @@ -8,5 +8,5 @@ "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" + "wasi-compiler-rt": "{MOZ_FETCHES_DIR}/compiler-rt-wasm32-wasi" } diff --git a/build/build-clang/win64.json b/build/build-clang/win64.json index f44d333d6825..f445ea2d6ec4 100644 --- a/build/build-clang/win64.json +++ b/build/build-clang/win64.json @@ -3,5 +3,5 @@ "cc": "cl.exe", "cxx": "cl.exe", "ml": "ml64.exe", - "wasi-compiler-rt": "{MOZ_FETCHES_DIR}/compiler-rt" + "wasi-compiler-rt": "{MOZ_FETCHES_DIR}/compiler-rt-wasm32-wasi" } diff --git a/taskcluster/ci/toolchain/clang.yml b/taskcluster/ci/toolchain/clang.yml index 858a231dd8c6..b4ebbb58d497 100644 --- a/taskcluster/ci/toolchain/clang.yml +++ b/taskcluster/ci/toolchain/clang.yml @@ -190,33 +190,15 @@ linux64-clang-13-android-cross: run: using: toolchain-script script: repack-clang-linux-cross.sh - arguments: - - aarch64 - - arm - - x86 - - x64 toolchain-alias: linux64-clang-android-cross toolchain-artifact: public/build/clang.tar.zst - dependencies: - android-aarch64-compiler-rt-13: toolchain-android-aarch64-compiler-rt-13 - android-arm-compiler-rt-13: toolchain-android-arm-compiler-rt-13 - android-x86-compiler-rt-13: toolchain-android-x86-compiler-rt-13 - android-x64-compiler-rt-13: toolchain-android-x64-compiler-rt-13 fetches: toolchain: - linux64-clang-13 - android-aarch64-compiler-rt-13: - - artifact: compiler-rt.tar.zst - dest: aarch64 - android-arm-compiler-rt-13: - - artifact: compiler-rt.tar.zst - dest: arm - android-x86-compiler-rt-13: - - artifact: compiler-rt.tar.zst - dest: x86 - android-x64-compiler-rt-13: - - artifact: compiler-rt.tar.zst - dest: x64 + - 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" @@ -229,13 +211,10 @@ linux64-clang-13-aarch64-cross: script: repack-clang-linux-cross.sh toolchain-alias: linux64-clang-aarch64-cross toolchain-artifact: public/build/clang.tar.zst - dependencies: - linux64-aarch64-compiler-rt-13: toolchain-linux64-aarch64-compiler-rt-13 fetches: toolchain: - linux64-clang-13 - linux64-aarch64-compiler-rt-13: - - artifact: compiler-rt.tar.zst + - linux64-aarch64-compiler-rt-13 linux64-clang-13-macosx-cross: description: "Clang 13 toolchain repack with MacOS Compiler RT libs" @@ -248,19 +227,12 @@ linux64-clang-13-macosx-cross: script: repack-clang-linux-macosx-cross.sh toolchain-alias: linux64-clang-macosx-cross toolchain-artifact: public/build/clang.tar.zst - dependencies: - macosx64-aarch64-compiler-rt-13: toolchain-macosx64-aarch64-compiler-rt-13 - macosx64-x64-compiler-rt-13: toolchain-macosx64-x64-compiler-rt-13 fetches: toolchain: - linux64-cctools-port - linux64-clang-13 - macosx64-aarch64-compiler-rt-13: - - artifact: compiler-rt.tar.zst - dest: aarch64 - macosx64-x64-compiler-rt-13: - - artifact: compiler-rt.tar.zst - dest: x86_64 + - 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" @@ -273,18 +245,11 @@ linux64-clang-13-win-cross: script: repack-clang-linux-win-cross.sh toolchain-alias: linux64-clang-win-cross toolchain-artifact: public/build/clang.tar.zst - dependencies: - win32-compiler-rt-13: toolchain-win32-compiler-rt-13 - win64-compiler-rt-13: toolchain-win64-compiler-rt-13 fetches: toolchain: - linux64-clang-13 - win32-compiler-rt-13: - - artifact: compiler-rt.tar.zst - dest: x86 - win64-compiler-rt-13: - - artifact: compiler-rt.tar.zst - dest: x86_64 + - win32-compiler-rt-13 + - win64-compiler-rt-13 macosx64-clang-13-raw: description: "Clang 13 toolchain build" @@ -333,19 +298,12 @@ macosx64-clang-13: - macosx64-clang - macosx64-clang-toolchain toolchain-artifact: public/build/clang.tar.zst - dependencies: - macosx64-aarch64-compiler-rt-13: toolchain-macosx64-aarch64-compiler-rt-13 - macosx64-x64-compiler-rt-13: toolchain-macosx64-x64-compiler-rt-13 fetches: toolchain: - linux64-cctools-port - macosx64-clang-13-raw - macosx64-aarch64-compiler-rt-13: - - artifact: compiler-rt.tar.zst - dest: aarch64 - macosx64-x64-compiler-rt-13: - - artifact: compiler-rt.tar.zst - dest: x86_64 + - macosx64-aarch64-compiler-rt-13 + - macosx64-x64-compiler-rt-13 macosx64-aarch64-clang-13-raw: description: "Clang 13 toolchain build" @@ -394,19 +352,12 @@ macosx64-aarch64-clang-13: script: repack-clang-linux-macosx-cross.sh toolchain-alias: macosx64-aarch64-clang toolchain-artifact: public/build/clang.tar.zst - dependencies: - macosx64-aarch64-compiler-rt-13: toolchain-macosx64-aarch64-compiler-rt-13 - macosx64-x64-compiler-rt-13: toolchain-macosx64-x64-compiler-rt-13 fetches: toolchain: - linux64-cctools-port - macosx64-aarch64-clang-13-raw - macosx64-aarch64-compiler-rt-13: - - artifact: compiler-rt.tar.zst - dest: aarch64 - macosx64-x64-compiler-rt-13: - - artifact: compiler-rt.tar.zst - dest: x86_64 + - macosx64-aarch64-compiler-rt-13 + - macosx64-x64-compiler-rt-13 win64-clang-13-raw: description: "Clang-cl 13 toolchain build" @@ -456,18 +407,11 @@ win64-clang-13: script: repack-clang-linux-win-cross.sh toolchain-alias: win64-clang toolchain-artifact: public/build/clang.tar.zst - dependencies: - win32-compiler-rt-13: toolchain-win32-compiler-rt-13 - win64-compiler-rt-13: toolchain-win64-compiler-rt-13 fetches: toolchain: - win64-clang-13-raw - win32-compiler-rt-13: - - artifact: compiler-rt.tar.zst - dest: x86 - win64-compiler-rt-13: - - artifact: compiler-rt.tar.zst - dest: x86_64 + - win32-compiler-rt-13 + - win64-compiler-rt-13 win64-clang-13-stage1: description: "Clang-cl 13 toolchain build stage 1" diff --git a/taskcluster/ci/toolchain/compiler-rt.yml b/taskcluster/ci/toolchain/compiler-rt.yml index 613fa81f4068..bcbb3f670021 100644 --- a/taskcluster/ci/toolchain/compiler-rt.yml +++ b/taskcluster/ci/toolchain/compiler-rt.yml @@ -9,7 +9,6 @@ job-defaults: run: using: toolchain-script script: build-compiler-rt.sh - toolchain-artifact: public/build/compiler-rt.tar.zst android-aarch64-compiler-rt-13: description: "android aarch64 Compiler-rt for Clang 13 toolchain build" @@ -17,10 +16,10 @@ android-aarch64-compiler-rt-13: symbol: TA(aarch64-crt-13) run: arguments: - - aarch64-linux-android - build/build-clang/clang-13.json resources: - build/build-clang/clang-13.json + toolchain-artifact: public/build/compiler-rt-aarch64-linux-android.tar.zst fetches: fetch: - clang-13 @@ -34,10 +33,10 @@ android-arm-compiler-rt-13: symbol: TA(arm-crt-13) run: arguments: - - armv7-linux-android - build/build-clang/clang-13.json resources: - build/build-clang/clang-13.json + toolchain-artifact: public/build/compiler-rt-armv7-linux-android.tar.zst fetches: fetch: - clang-13 @@ -51,10 +50,10 @@ android-x86-compiler-rt-13: symbol: TA(x86-crt-13) run: arguments: - - i686-linux-android - build/build-clang/clang-13.json resources: - build/build-clang/clang-13.json + toolchain-artifact: public/build/compiler-rt-i686-linux-android.tar.zst fetches: fetch: - clang-13 @@ -68,10 +67,10 @@ android-x64-compiler-rt-13: symbol: TA(x64-crt-13) run: arguments: - - x86_64-linux-android - build/build-clang/clang-13.json resources: - build/build-clang/clang-13.json + toolchain-artifact: public/build/compiler-rt-x86_64-linux-android.tar.zst fetches: fetch: - clang-13 @@ -85,10 +84,10 @@ linux64-aarch64-compiler-rt-13: symbol: TL(aarch64-crt-13) run: arguments: - - aarch64-unknown-linux-gnu - build/build-clang/clang-13.json resources: - build/build-clang/clang-13.json + toolchain-artifact: public/build/compiler-rt-aarch64-unknown-linux-gnu.tar.zst fetches: fetch: - clang-13 @@ -103,10 +102,10 @@ macosx64-x64-compiler-rt-13: symbol: TM(x64-crt-13) run: arguments: - - x86_64-apple-darwin - build/build-clang/clang-13.json resources: - build/build-clang/clang-13.json + toolchain-artifact: public/build/compiler-rt-x86_64-apple-darwin.tar.zst fetches: fetch: - clang-13 @@ -121,10 +120,10 @@ macosx64-aarch64-compiler-rt-13: symbol: TM(aarch64-crt-13) run: arguments: - - aarch64-apple-darwin - build/build-clang/clang-13.json resources: - build/build-clang/clang-13.json + toolchain-artifact: public/build/compiler-rt-aarch64-apple-darwin.tar.zst fetches: fetch: - clang-13 @@ -142,11 +141,11 @@ win32-compiler-rt-13: TOOLTOOL_MANIFEST: "browser/config/tooltool-manifests/vs2017-15.9.manifest" run: arguments: - - i686-pc-windows-msvc - build/build-clang/clang-13.json resources: - 'taskcluster/scripts/misc/tooltool-download.sh' - build/build-clang/clang-13.json + toolchain-artifact: public/build/compiler-rt-i686-pc-windows-msvc.tar.zst tooltool-downloads: internal fetches: fetch: @@ -164,11 +163,11 @@ win64-compiler-rt-13: TOOLTOOL_MANIFEST: "browser/config/tooltool-manifests/vs2017-15.9.manifest" run: arguments: - - x86_64-pc-windows-msvc - build/build-clang/clang-13.json resources: - 'taskcluster/scripts/misc/tooltool-download.sh' - build/build-clang/clang-13.json + toolchain-artifact: public/build/compiler-rt-x86_64-pc-windows-msvc.tar.zst tooltool-downloads: internal fetches: fetch: @@ -184,6 +183,7 @@ wasm32-wasi-compiler-rt-13: worker-type: b-linux-xlarge run: script: build-compiler-rt-wasi.sh + toolchain-artifact: public/build/compiler-rt-wasm32-wasi.tar.zst toolchain-alias: wasm32-wasi-compiler-rt fetches: fetch: diff --git a/taskcluster/scripts/misc/build-compiler-rt.sh b/taskcluster/scripts/misc/build-compiler-rt.sh index a8b16f4faf47..36303916d96b 100755 --- a/taskcluster/scripts/misc/build-compiler-rt.sh +++ b/taskcluster/scripts/misc/build-compiler-rt.sh @@ -2,8 +2,9 @@ set -e -x -target=$1 -shift +artifact=$(basename $TOOLCHAIN_ARTIFACT) +dir=${artifact%.tar.*} +target=${dir#compiler-rt-} clang=$MOZ_FETCHES_DIR/clang/bin/clang @@ -51,7 +52,6 @@ esac case "$target" in *-apple-darwin) - libdir=lib/darwin EXTRA_CMAKE_FLAGS=" -DCMAKE_LINKER=$MOZ_FETCHES_DIR/cctools/bin/$target-ld -DCMAKE_LIPO=$MOZ_FETCHES_DIR/cctools/bin/lipo @@ -71,7 +71,6 @@ case "$target" in PATH="$PWD:$MOZ_FETCHES_DIR/cctools/bin:$PATH" ;; *-linux-android) - libdir=lib/linux cflags=" --gcc-toolchain=$MOZ_FETCHES_DIR/android-ndk/toolchains/$ndk_prefix-4.9/prebuilt/linux-x86_64 -isystem $MOZ_FETCHES_DIR/android-ndk/sysroot/usr/include/$ndk_target @@ -101,7 +100,6 @@ case "$target" in " ;; aarch64-unknown-linux-gnu) - libdir=lib/linux EXTRA_CMAKE_FLAGS=" -DCMAKE_SYSROOT=$MOZ_FETCHES_DIR/sysroot-aarch64-linux-gnu -DCMAKE_LINKER=$MOZ_FETCHES_DIR/clang/bin/ld.lld @@ -177,16 +175,15 @@ eval cmake \ -DCMAKE_AR=$MOZ_FETCHES_DIR/clang/bin/llvm-${ar:-ar} \ -DCMAKE_RANLIB=$MOZ_FETCHES_DIR/clang/bin/llvm-ranlib \ -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=${PWD}/${dir} \ -DLLVM_ENABLE_ASSERTIONS=OFF \ -DLLVM_CONFIG_PATH=$MOZ_FETCHES_DIR/clang/bin/llvm-config \ -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON \ $EXTRA_CMAKE_FLAGS -ninja -v +ninja install -v -cd .. - -tar caf compiler-rt.tar.zst compiler-rt/$libdir +tar caf "$artifact" "$dir" mkdir -p "$UPLOAD_DIR" -mv "compiler-rt.tar.zst" "$UPLOAD_DIR" +mv "$artifact" "$UPLOAD_DIR" diff --git a/taskcluster/scripts/misc/repack-clang-linux-cross.sh b/taskcluster/scripts/misc/repack-clang-linux-cross.sh index 53722e025463..74b98b201262 100755 --- a/taskcluster/scripts/misc/repack-clang-linux-cross.sh +++ b/taskcluster/scripts/misc/repack-clang-linux-cross.sh @@ -6,14 +6,10 @@ set -x -e -v cd $MOZ_FETCHES_DIR # We have a native linux64 toolchain in $MOZ_FETCHES_DIR/clang -# We have some linux compiler-rts in $MOZ_FETCHES_DIR/compiler-rt if no argument -# is given to the script, or $MOZ_FETCHES_DIR/*/compiler-rt otherwise. The -# subdirectories are given as arguments. +# We have some linux compiler-rts in $MOZ_FETCHES_DIR/compiler-rt* clang_lib=$(echo $PWD/clang/lib/clang/*/lib) -for dir in ${*:-.}; do - find $dir/compiler-rt/lib/linux -type f | while read f; do - cp -n $f $clang_lib/linux - done +find compiler-rt-*/lib/linux -type f | while read f; do + cp -n $f $clang_lib/linux done tar -caf clang.tar.zst clang diff --git a/taskcluster/scripts/misc/repack-clang-linux-macosx-cross.sh b/taskcluster/scripts/misc/repack-clang-linux-macosx-cross.sh index e532c20b95c4..345271f13029 100755 --- a/taskcluster/scripts/misc/repack-clang-linux-macosx-cross.sh +++ b/taskcluster/scripts/misc/repack-clang-linux-macosx-cross.sh @@ -7,20 +7,20 @@ set -x -e -v cd $MOZ_FETCHES_DIR # We have a native linux64 toolchain in $MOZ_FETCHES_DIR/clang -# We have a native aarch64 macos compiler-rt in $MOZ_FETCHES_DIR/aarch64/compiler-rt -# We have a native x86_64 macos compiler-rt in $MOZ_FETCHES_DIR/x86_64/compiler-rt +# We have a native aarch64 macos compiler-rt in $MOZ_FETCHES_DIR/compiler-rt-aarch64-apple-darwin +# We have a native x86_64 macos compiler-rt in $MOZ_FETCHES_DIR/compiler-rt-x86_64-apple-darwin clang_lib=$(echo clang/lib/clang/*/lib) mkdir -p $clang_lib/darwin -find {aarch64,x86_64}/compiler-rt/lib/darwin -type f -printf '%f\n' | sort -u | while read f; do - f=compiler-rt/lib/darwin/$f - if [ -f aarch64/$f -a -f x86_64/$f ]; then +find compiler-rt-*/lib/darwin -type f -printf '%f\n' | sort -u | while read f; do + f=lib/darwin/$f + if [ -f compiler-rt-aarch64-apple-darwin/$f -a -f compiler-rt-x86_64-apple-darwin/$f ]; then # For compiler-rt files that exist on both ends, merge them - $MOZ_FETCHES_DIR/cctools/bin/lipo -create {aarch64,x86_64}/$f -output $clang_lib/darwin/${f##*/} - elif [ -f aarch64/$f ]; then + $MOZ_FETCHES_DIR/cctools/bin/lipo -create compiler-rt-{aarch64,x86_64}-apple-darwin/$f -output $clang_lib/darwin/${f##*/} + elif [ -f compiler-rt-aarch64-apple-darwin/$f ]; then # For compiler-rt files that exist on either end, copy the existing one - cp aarch64/$f $clang_lib/darwin + cp compiler-rt-aarch64-apple-darwin/$f $clang_lib/darwin else - cp x86_64/$f $clang_lib/darwin + cp compiler-rt-x86_64-apple-darwin/$f $clang_lib/darwin fi done diff --git a/taskcluster/scripts/misc/repack-clang-linux-win-cross.sh b/taskcluster/scripts/misc/repack-clang-linux-win-cross.sh index 0571f46a24d8..f471363bd2f7 100755 --- a/taskcluster/scripts/misc/repack-clang-linux-win-cross.sh +++ b/taskcluster/scripts/misc/repack-clang-linux-win-cross.sh @@ -7,12 +7,12 @@ set -x -e -v cd $MOZ_FETCHES_DIR # We have a native linux64 toolchain in $MOZ_FETCHES_DIR/clang -# We have a native x86 windows compiler-rt in $MOZ_FETCHES_DIR/x86/compiler-rt -# We have a native x86_64 windows compiler-rt in $MOZ_FETCHES_DIR/x86_64/compiler-rt +# We have a native x86 windows compiler-rt in $MOZ_FETCHES_DIR/compiler-rt-i686-pc-windows-msvc +# We have a native x86_64 windows compiler-rt in $MOZ_FETCHES_DIR/compiler-rt-x86_64-pc-windows-msvc clang_lib=$(echo clang/lib/clang/*/lib) mkdir -p $clang_lib/windows -cp x86/compiler-rt/lib/windows/* $clang_lib/windows -cp x86_64/compiler-rt/lib/windows/* $clang_lib/windows +cp compiler-rt-i686-pc-windows-msvc/lib/windows/* $clang_lib/windows +cp compiler-rt-x86_64-pc-windows-msvc/lib/windows/* $clang_lib/windows tar caf clang.tar.zst clang