From 3883f0ad91a9a97036e505df9aaa9c57ac595af2 Mon Sep 17 00:00:00 2001 From: Marian-Vasile Laza Date: Tue, 19 Oct 2021 12:36:47 +0300 Subject: [PATCH] Backed out changeset f3cf8baf4f0a (bug 1731582) for causing build bustages. CLOSED TREE --- ...-13-android.json => clang-12-android.json} | 4 +- build/build-clang/clang-12-linux64.json | 1 + ...3-macosx64.json => clang-12-macosx64.json} | 4 +- ...2stage.json => clang-12-win64-2stage.json} | 0 ...lang-13-win64.json => clang-12-win64.json} | 6 +- build/build-clang/clang-13-linux64.json | 23 - build/build-clang/clang-tidy-ci.patch | 12 +- build/build-clang/clang-tidy-macosx64.json | 2 +- .../compiler-rt-13-no-codesign.patch | 19 - build/build-clang/revert-ga478b0a199f4.patch | 123 -- ...-llvmorg-12-init-16421-gb688c5875d08.patch | 1242 +++++++++++++++++ ...t-llvmorg-13-init-7827-g2a078c307204.patch | 12 - .../revert-r362047-and-r362065_clang_12.patch | 68 + mobile/android/config/mozconfigs/common | 5 - taskcluster/ci/fetch/toolchains.yml | 7 - taskcluster/ci/instrumented-build/kind.yml | 2 - taskcluster/ci/spidermonkey/linux.yml | 4 +- taskcluster/ci/toolchain/cbindgen.yml | 10 +- taskcluster/ci/toolchain/cctools-port.yml | 6 +- taskcluster/ci/toolchain/clang-tidy.yml | 14 +- taskcluster/ci/toolchain/clang.yml | 169 +-- taskcluster/ci/toolchain/compiler-rt.yml | 82 +- taskcluster/ci/toolchain/dump-syms.yml | 10 +- taskcluster/ci/toolchain/fix-stacks.yml | 12 +- taskcluster/ci/toolchain/gn.yml | 4 +- .../ci/toolchain/minidump_stackwalk.yml | 12 +- taskcluster/ci/toolchain/misc.yml | 6 +- taskcluster/ci/toolchain/nasm.yml | 12 +- taskcluster/ci/toolchain/sccache.yml | 10 +- taskcluster/ci/webrender/kind.yml | 6 +- taskcluster/scripts/misc/build-clang-mingw.sh | 120 +- taskcluster/scripts/misc/build-compiler-rt.sh | 1 - .../misc/repack-clang-linux-win-cross.sh | 3 +- 33 files changed, 1552 insertions(+), 459 deletions(-) rename build/build-clang/{clang-13-android.json => clang-12-android.json} (92%) rename build/build-clang/{clang-13-macosx64.json => clang-12-macosx64.json} (88%) rename build/build-clang/{clang-13-win64-2stage.json => clang-12-win64-2stage.json} (100%) rename build/build-clang/{clang-13-win64.json => clang-12-win64.json} (73%) delete mode 100644 build/build-clang/clang-13-linux64.json delete mode 100644 build/build-clang/compiler-rt-13-no-codesign.patch delete mode 100644 build/build-clang/revert-ga478b0a199f4.patch create mode 100644 build/build-clang/revert-llvmorg-12-init-16421-gb688c5875d08.patch delete mode 100644 build/build-clang/revert-llvmorg-13-init-7827-g2a078c307204.patch create mode 100644 build/build-clang/revert-r362047-and-r362065_clang_12.patch diff --git a/build/build-clang/clang-13-android.json b/build/build-clang/clang-12-android.json similarity index 92% rename from build/build-clang/clang-13-android.json rename to build/build-clang/clang-12-android.json index 5e456250c548..bb31d8a3fe93 100644 --- a/build/build-clang/clang-13-android.json +++ b/build/build-clang/clang-12-android.json @@ -49,6 +49,8 @@ "patches": [ "static-llvm-symbolizer_clang_12.patch", "find_symbolizer_linux_clang_10.patch", - "revert-ga478b0a199f4.patch" + "revert-llvmorg-12-init-7827-g2a078c307204.patch", + "revert-llvmorg-12-init-16421-gb688c5875d08.patch", + "revert-r362047-and-r362065_clang_12.patch" ] } diff --git a/build/build-clang/clang-12-linux64.json b/build/build-clang/clang-12-linux64.json index 13ec55338a82..793528db21d8 100644 --- a/build/build-clang/clang-12-linux64.json +++ b/build/build-clang/clang-12-linux64.json @@ -8,6 +8,7 @@ "cc": "/usr/bin/gcc", "cxx": "/usr/bin/g++", "as": "/usr/bin/gcc", + "wasi-compiler-rt": "{MOZ_FETCHES_DIR}/compiler-rt", "patches": [ "static-llvm-symbolizer_clang_12.patch", "find_symbolizer_linux_clang_10.patch", diff --git a/build/build-clang/clang-13-macosx64.json b/build/build-clang/clang-12-macosx64.json similarity index 88% rename from build/build-clang/clang-13-macosx64.json rename to build/build-clang/clang-12-macosx64.json index ea2ecf28e9f9..5bb87f9c7a9c 100644 --- a/build/build-clang/clang-13-macosx64.json +++ b/build/build-clang/clang-12-macosx64.json @@ -16,7 +16,7 @@ "patches": [ "static-llvm-symbolizer_clang_12.patch", "compiler-rt-cross-compile.patch", - "revert-llvmorg-13-init-7827-g2a078c307204.patch", - "compiler-rt-13-no-codesign.patch" + "revert-llvmorg-12-init-7827-g2a078c307204.patch", + "compiler-rt-no-codesign.patch" ] } diff --git a/build/build-clang/clang-13-win64-2stage.json b/build/build-clang/clang-12-win64-2stage.json similarity index 100% rename from build/build-clang/clang-13-win64-2stage.json rename to build/build-clang/clang-12-win64-2stage.json diff --git a/build/build-clang/clang-13-win64.json b/build/build-clang/clang-12-win64.json similarity index 73% rename from build/build-clang/clang-13-win64.json rename to build/build-clang/clang-12-win64.json index c607ea3f267d..553c6205d742 100644 --- a/build/build-clang/clang-13-win64.json +++ b/build/build-clang/clang-12-win64.json @@ -13,8 +13,8 @@ "unpoison-thread-stacks_clang_10.patch", "downgrade-mangling-error_clang_12.patch", "bug47258-extract-symbols-mbcs.patch", - "Remove-FlushViewOfFile-when-unmaping-gcda-files.patch", - "revert-llvmorg-13-init-7827-g2a078c307204.patch", - "loosen-msvc-detection.patch" + "revert-llvmorg-12-init-7827-g2a078c307204.patch", + "loosen-msvc-detection.patch", + "Remove-FlushViewOfFile-when-unmaping-gcda-files.patch" ] } diff --git a/build/build-clang/clang-13-linux64.json b/build/build-clang/clang-13-linux64.json deleted file mode 100644 index e3e4bf21f68c..000000000000 --- a/build/build-clang/clang-13-linux64.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "stages": "4", - "pgo" : true, - "build_libcxx": true, - "build_wasm": true, - "build_type": "Release", - "assertions": false, - "cc": "/usr/bin/gcc", - "cxx": "/usr/bin/g++", - "as": "/usr/bin/gcc", - "wasi-compiler-rt": "{MOZ_FETCHES_DIR}/compiler-rt", - "patches": [ - "static-llvm-symbolizer_clang_12.patch", - "find_symbolizer_linux_clang_10.patch", - "android-mangling-error_clang_12.patch", - "unpoison-thread-stacks_clang_10.patch", - "downgrade-mangling-error_clang_12.patch", - "revert-llvmorg-13-init-7827-g2a078c307204.patch", - "loosen-msvc-detection.patch", - "fuzzing_ccov_build_clang_12.patch", - "revert-ga478b0a199f4.patch" - ] -} diff --git a/build/build-clang/clang-tidy-ci.patch b/build/build-clang/clang-tidy-ci.patch index 12c6fadc4f91..8d5d807ddf6b 100644 --- a/build/build-clang/clang-tidy-ci.patch +++ b/build/build-clang/clang-tidy-ci.patch @@ -1,20 +1,20 @@ diff --git a/clang-tools-extra/clang-tidy/ClangTidy.cpp b/clang-tools-extra/clang-tidy/ClangTidy.cpp -index 73d66b980a5e..3b18de2176ba 100644 +index d6913dfd3c07..d031a163fdd7 100644 --- a/clang-tools-extra/clang-tidy/ClangTidy.cpp +++ b/clang-tools-extra/clang-tidy/ClangTidy.cpp -@@ -432,6 +432,7 @@ ClangTidyASTConsumerFactory::CreateASTConsumer( - - for (auto &Check : Checks) { +@@ -418,6 +418,7 @@ ClangTidyASTConsumerFactory::CreateASTConsumer( + if (!Check->isLanguageVersionSupported(Context.getLangOpts())) + continue; Check->registerMatchers(&*Finder); + Check->registerPPCallbacks(Compiler); Check->registerPPCallbacks(*SM, PP, ModuleExpanderPP); } diff --git a/clang-tools-extra/clang-tidy/ClangTidyCheck.h b/clang-tools-extra/clang-tidy/ClangTidyCheck.h -index 20e9b8e47e6f..aded1f2e196c 100644 +index 54b725126752..200780e86804 100644 --- a/clang-tools-extra/clang-tidy/ClangTidyCheck.h +++ b/clang-tools-extra/clang-tidy/ClangTidyCheck.h -@@ -70,6 +70,9 @@ public: +@@ -130,6 +130,9 @@ public: return true; } diff --git a/build/build-clang/clang-tidy-macosx64.json b/build/build-clang/clang-tidy-macosx64.json index 81ae1893af8f..7e6428291466 100644 --- a/build/build-clang/clang-tidy-macosx64.json +++ b/build/build-clang/clang-tidy-macosx64.json @@ -15,6 +15,6 @@ "patches": [ "clang-tidy-ci.patch", "compiler-rt-cross-compile.patch", - "compiler-rt-13-no-codesign.patch" + "compiler-rt-no-codesign.patch" ] } diff --git a/build/build-clang/compiler-rt-13-no-codesign.patch b/build/build-clang/compiler-rt-13-no-codesign.patch deleted file mode 100644 index 2678a249393d..000000000000 --- a/build/build-clang/compiler-rt-13-no-codesign.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff --git a/compiler-rt/cmake/Modules/AddCompilerRT.cmake b/compiler-rt/cmake/Modules/AddCompilerRT.cmake -index bc69ec95c419..9f100fdcec2f 100644 ---- a/compiler-rt/cmake/Modules/AddCompilerRT.cmake -+++ b/compiler-rt/cmake/Modules/AddCompilerRT.cmake -@@ -366,14 +366,6 @@ function(add_compiler_rt_runtime name type) - set_target_properties(${libname} PROPERTIES IMPORT_PREFIX "") - set_target_properties(${libname} PROPERTIES IMPORT_SUFFIX ".lib") - endif() -- if(APPLE) -- # Ad-hoc sign the dylibs -- add_custom_command(TARGET ${libname} -- POST_BUILD -- COMMAND codesign --sign - $ -- WORKING_DIRECTORY ${COMPILER_RT_OUTPUT_LIBRARY_DIR} -- ) -- endif() - endif() - - set(parent_target_arg) diff --git a/build/build-clang/revert-ga478b0a199f4.patch b/build/build-clang/revert-ga478b0a199f4.patch deleted file mode 100644 index 2e00de010593..000000000000 --- a/build/build-clang/revert-ga478b0a199f4.patch +++ /dev/null @@ -1,123 +0,0 @@ -diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp -index c9360fc67165..b9451bde3dd8 100644 ---- a/clang/lib/Driver/ToolChains/Linux.cpp -+++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -310,12 +310,6 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) - addPathIfExists(D, SysRoot + "/usr/lib", Paths); - } - --ToolChain::RuntimeLibType Linux::GetDefaultRuntimeLibType() const { -- if (getTriple().isAndroid()) -- return ToolChain::RLT_CompilerRT; -- return Generic_ELF::GetDefaultRuntimeLibType(); --} -- - ToolChain::CXXStdlibType Linux::GetDefaultCXXStdlibType() const { - if (getTriple().isAndroid()) - return ToolChain::CST_Libcxx; -diff --git a/clang/lib/Driver/ToolChains/Linux.h b/clang/lib/Driver/ToolChains/Linux.h -index 169a37c44072..65897631715a 100644 ---- a/clang/lib/Driver/ToolChains/Linux.h -+++ b/clang/lib/Driver/ToolChains/Linux.h -@@ -39,7 +39,6 @@ public: - llvm::opt::ArgStringList &CC1Args) const override; - void AddIAMCUIncludeArgs(const llvm::opt::ArgList &DriverArgs, - llvm::opt::ArgStringList &CC1Args) const override; -- RuntimeLibType GetDefaultRuntimeLibType() const override; - CXXStdlibType GetDefaultCXXStdlibType() const override; - bool - IsAArch64OutlineAtomicsDefault(const llvm::opt::ArgList &Args) const override; -diff --git a/clang/test/Driver/linux-ld.c b/clang/test/Driver/linux-ld.c -index cc505588331b..fc43acd07644 100644 ---- a/clang/test/Driver/linux-ld.c -+++ b/clang/test/Driver/linux-ld.c -@@ -283,7 +283,7 @@ - // RUN: --sysroot=%S/Inputs/basic_linux_tree \ - // RUN: | FileCheck --check-prefix=CHECK-CLANG-ANDROID-NONE %s - // CHECK-CLANG-ANDROID-NONE: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" --// CHECK-CLANG-ANDROID-NONE: "-l:libunwind.a" "-ldl" "-lc" -+// CHECK-CLANG-ANDROID-NONE: "-lgcc" "-ldl" "-lc" - // - // RUN: %clang -shared -no-canonical-prefixes %s -### -o %t.o 2>&1 \ - // RUN: --target=aarch64-linux-android -rtlib=platform --unwindlib=platform \ -@@ -291,7 +291,7 @@ - // RUN: --sysroot=%S/Inputs/basic_linux_tree \ - // RUN: | FileCheck --check-prefix=CHECK-CLANG-ANDROID-SHARED %s - // CHECK-CLANG-ANDROID-SHARED: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" --// CHECK-CLANG-ANDROID-SHARED: "-l:libunwind.a" "-ldl" "-lc" -+// CHECK-CLANG-ANDROID-SHARED: "-lgcc" "-ldl" "-lc" - // - // RUN: %clang -static -no-canonical-prefixes %s -### -o %t.o 2>&1 \ - // RUN: --target=aarch64-linux-android -rtlib=platform --unwindlib=platform \ -@@ -299,7 +299,7 @@ - // RUN: --sysroot=%S/Inputs/basic_linux_tree \ - // RUN: | FileCheck --check-prefix=CHECK-CLANG-ANDROID-STATIC %s - // CHECK-CLANG-ANDROID-STATIC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" --// CHECK-CLANG-ANDROID-STATIC: "--start-group" "{{[^"]*}}{{/|\\\\}}libclang_rt.builtins-aarch64-android.a" "-l:libunwind.a" "-lc" "--end-group" -+// CHECK-CLANG-ANDROID-STATIC: "--start-group" "-lgcc" "-lc" "--end-group" - // - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ - // RUN: --target=x86_64-unknown-linux -rtlib=platform --unwindlib=platform \ -@@ -1081,12 +1081,10 @@ - // CHECK-ANDROID: "--enable-new-dtags" - // CHECK-ANDROID: "{{.*}}{{/|\\\\}}crtbegin_dynamic.o" - // CHECK-ANDROID: "-L[[SYSROOT]]/usr/lib" --// CHECK-ANDROID-NOT: "-lgcc_s" --// CHECK-ANDROID-NOT: "-lgcc" --// CHECK-ANDROID: "-l:libunwind.a" -+// CHECK-ANDROID-NOT: "gcc_s" -+// CHECK-ANDROID: "-lgcc" - // CHECK-ANDROID: "-ldl" --// CHECK-ANDROID-NOT: "-lgcc_s" --// CHECK-ANDROID-NOT: "-lgcc" -+// CHECK-ANDROID-NOT: "gcc_s" - // CHECK-ANDROID: "{{.*}}{{/|\\\\}}crtend_android.o" - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ - // RUN: --target=arm-linux-androideabi -rtlib=platform --unwindlib=platform \ -@@ -1139,12 +1137,10 @@ - // CHECK-ANDROID-SO-NOT: "-Bsymbolic" - // CHECK-ANDROID-SO: "{{.*}}{{/|\\\\}}crtbegin_so.o" - // CHECK-ANDROID-SO: "-L[[SYSROOT]]/usr/lib" --// CHECK-ANDROID-SO-NOT: "-lgcc_s" --// CHECK-ANDROID-SO-NOT: "-lgcc" --// CHECK-ANDROID-SO: "-l:libunwind.a" -+// CHECK-ANDROID-SO-NOT: "gcc_s" -+// CHECK-ANDROID-SO: "-lgcc" - // CHECK-ANDROID-SO: "-ldl" --// CHECK-ANDROID-SO-NOT: "-lgcc_s" --// CHECK-ANDROID-SO-NOT: "-lgcc" -+// CHECK-ANDROID-SO-NOT: "gcc_s" - // CHECK-ANDROID-SO: "{{.*}}{{/|\\\\}}crtend_so.o" - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ - // RUN: --target=arm-linux-androideabi -rtlib=platform --unwindlib=platform \ -@@ -1195,12 +1191,10 @@ - // CHECK-ANDROID-STATIC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" - // CHECK-ANDROID-STATIC: "{{.*}}{{/|\\\\}}crtbegin_static.o" - // CHECK-ANDROID-STATIC: "-L[[SYSROOT]]/usr/lib" --// CHECK-ANDROID-STATIC-NOT: "-lgcc_eh" --// CHECK-ANDROID-STATIC-NOT: "-lgcc" --// CHECK-ANDROID-STATIC: "-l:libunwind.a" -+// CHECK-ANDROID-STATIC-NOT: "gcc_s" -+// CHECK-ANDROID-STATIC: "-lgcc" - // CHECK-ANDROID-STATIC-NOT: "-ldl" --// CHECK-ANDROID-STATIC-NOT: "-lgcc_eh" --// CHECK-ANDROID-STATIC-NOT: "-lgcc" -+// CHECK-ANDROID-STATIC-NOT: "gcc_s" - // CHECK-ANDROID-STATIC: "{{.*}}{{/|\\\\}}crtend_android.o" - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ - // RUN: --target=arm-linux-androideabi -rtlib=platform --unwindlib=platform \ -@@ -1253,11 +1247,9 @@ - // CHECK-ANDROID-PIE: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" - // CHECK-ANDROID-PIE: "{{.*}}{{/|\\\\}}crtbegin_dynamic.o" - // CHECK-ANDROID-PIE: "-L[[SYSROOT]]/usr/lib" --// CHECK-ANDROID-PIE-NOT: "-lgcc_s" --// CHECK-ANDROID-PIE-NOT: "-lgcc" --// CHECK-ANDROID-PIE: "-l:libunwind.a" --// CHECK-ANDROID-PIE-NOT: "-lgcc_s" --// CHECK-ANDROID-PIE-NOT: "-lgcc" -+// CHECK-ANDROID-PIE-NOT: "gcc_s" -+// CHECK-ANDROID-PIE: "-lgcc" -+// CHECK-ANDROID-PIE-NOT: "gcc_s" - // CHECK-ANDROID-PIE: "{{.*}}{{/|\\\\}}crtend_android.o" - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ - // RUN: --target=arm-linux-androideabi \ diff --git a/build/build-clang/revert-llvmorg-12-init-16421-gb688c5875d08.patch b/build/build-clang/revert-llvmorg-12-init-16421-gb688c5875d08.patch new file mode 100644 index 000000000000..9f6971001921 --- /dev/null +++ b/build/build-clang/revert-llvmorg-12-init-16421-gb688c5875d08.patch @@ -0,0 +1,1242 @@ +Revert "[CMake] Split the target side of runtimes build" + +This reverts commit b688c5875d08c586f7b35b8f9da1493ebbf92b45. + +Commit 98c89ccfbd7467f946874c2af170d0f504355dd1 was in the revert path and is +also reverted by this patch. That commit doesn't affect us, so it's not worth +the extra patch-juggling to preserve it. + +This will make it easier to apply revert-r362047-and-r362065_clang_12.patch. + +diff --git a/llvm/runtimes/CMakeLists.txt b/llvm/runtimes/CMakeLists.txt +index 243d6ceb2202..d2f5d6bf80f0 100644 +--- a/llvm/runtimes/CMakeLists.txt ++++ b/llvm/runtimes/CMakeLists.txt +@@ -1,13 +1,26 @@ +-# TODO: This file assumes the Clang toolchain so it'd be better if it lived in +-# Clang, except there already is clang/runtime directory which contains +-# similar although simpler functionality. We should figure out how to merge +-# the two files. +- +-# TODO: Selecting runtimes should be always performed inside the runtimes +-# build, see runtimes/CMakeLists.txt, except that we currently check whether +-# compiler-rt is being built to determine whether to first build builtins +-# or not so we need that information in this file as well. +-set(LLVM_ALL_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind;openmp") ++# This file handles building LLVM runtime sub-projects. ++ ++# Runtimes are different from tools or other drop-in projects because runtimes ++# should be built with the LLVM toolchain from the build directory. This file is ++# a first step to formalizing runtime build interfaces. ++ ++# Setting CMake minimum required version should be at the very top of the file ++# if this is the entry point. ++if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) ++ cmake_minimum_required(VERSION 3.13.4) ++ project(Runtimes C CXX ASM) ++endif() ++ ++# Find all subdirectories containing CMake projects ++file(GLOB entries *) ++foreach(entry ${entries}) ++ if(IS_DIRECTORY ${entry} AND EXISTS ${entry}/CMakeLists.txt) ++ list(APPEND runtimes ${entry}) ++ endif() ++endforeach() ++ ++# Side-by-side subprojects layout. ++set(LLVM_ALL_RUNTIMES "libcxx;libcxxabi;libunwind;compiler-rt;openmp") + set(LLVM_ENABLE_RUNTIMES "" CACHE STRING + "Semicolon-separated list of runtimes to build (${LLVM_ALL_RUNTIMES}), or \"all\".") + if(LLVM_ENABLE_RUNTIMES STREQUAL "all" ) +@@ -35,436 +48,612 @@ function(get_compiler_rt_path path) + endforeach() + endfunction() + +-include(LLVMExternalProjectUtils) ++# If this file is acting as a top-level CMake invocation, this code path is ++# triggered by the external project call for the runtimes target below. ++if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}) + +-if(NOT LLVM_BUILD_RUNTIMES) +- set(EXTRA_ARGS EXCLUDE_FROM_ALL) +-endif() ++ function(runtime_register_component name) ++ set_property(GLOBAL APPEND PROPERTY SUB_COMPONENTS ${name}) ++ endfunction() + +-function(check_apple_target triple builtin_or_runtime) +- set(error "\ +-compiler-rt for Darwin builds for all platforms and architectures using a \ +-single configuration. Specify only a single darwin triple (e.g. x86_64-apple-darwin) \ +-in your targets list (and not a triple for a specific platform such as macos). \ +-You can use variables such as COMPILER_RT_ENABLE_IOS and DARWIN_ios_ARCHS to \ +-control the specific platforms and architectures to build.") ++ cmake_minimum_required(VERSION 3.13.4) ++ project(Runtimes C CXX ASM) + +- set(seen_property ${builtin_or_runtime}_darwin_triple_seen) +- string(REPLACE "-" ";" triple_components ${triple}) +- foreach(component ${triple_components}) +- string(TOLOWER "${component}" component_lower) +- if(component_lower MATCHES "^darwin") +- get_property(darwin_triple_seen GLOBAL PROPERTY ${seen_property}) +- if(darwin_triple_seen) +- message(FATAL_ERROR "${error}") +- endif() +- set_property(GLOBAL PROPERTY ${seen_property} YES) +- if(NOT RUNTIMES_BUILD_ALLOW_DARWIN) +- message(FATAL_ERROR "\ +-${error} Set RUNTIMES_BUILD_ALLOW_DARWIN to allow a single darwin triple.") +- endif() +- elseif(component_lower MATCHES "^ios|^macos|^tvos|^watchos") +- message(FATAL_ERROR "${error}") +- endif() +- endforeach() +-endfunction() ++ find_package(LLVM PATHS "${LLVM_BINARY_DIR}" NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) ++ find_package(Clang PATHS "${LLVM_BINARY_DIR}" NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) + +-function(builtin_default_target compiler_rt_path) +- cmake_parse_arguments(ARG "" "" "DEPENDS" ${ARGN}) ++ # Add the root project's CMake modules, and the LLVM build's modules to the ++ # CMake module path. ++ list(INSERT CMAKE_MODULE_PATH 0 ++ "${CMAKE_CURRENT_SOURCE_DIR}/../cmake" ++ "${CMAKE_CURRENT_SOURCE_DIR}/../cmake/modules" ++ ) + +- set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR_default ON) +- # AIX should fold 32-bit & 64-bit arch libraries into a single archive. +- if (TARGET_TRIPLE MATCHES "aix") +- set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR_default OFF) ++ # Some of the runtimes will conditionally use the compiler-rt sanitizers ++ # to make this work smoothly we ensure that compiler-rt is added first in ++ # the list of sub-projects. This allows other sub-projects to have checks ++ # like `if(TARGET asan)` to enable building with asan. ++ get_compiler_rt_path(compiler_rt_path) ++ if(compiler_rt_path) ++ list(REMOVE_ITEM runtimes ${compiler_rt_path}) ++ if(NOT DEFINED LLVM_BUILD_COMPILER_RT OR LLVM_BUILD_COMPILER_RT) ++ list(INSERT runtimes 0 ${compiler_rt_path}) ++ endif() + endif() + +- llvm_ExternalProject_Add(builtins +- ${compiler_rt_path}/lib/builtins +- DEPENDS ${ARG_DEPENDS} +- CMAKE_ARGS -DLLVM_LIBRARY_OUTPUT_INTDIR=${LLVM_LIBRARY_DIR} +- -DLLVM_RUNTIME_OUTPUT_INTDIR=${LLVM_TOOLS_BINARY_DIR} +- -DLLVM_DEFAULT_TARGET_TRIPLE=${TARGET_TRIPLE} +- -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=${LLVM_ENABLE_PER_TARGET_RUNTIME_DIR_default} +- -DCMAKE_C_COMPILER_TARGET=${TARGET_TRIPLE} +- -DCMAKE_ASM_COMPILER_TARGET=${TARGET_TRIPLE} +- -DCMAKE_C_COMPILER_WORKS=ON +- -DCMAKE_ASM_COMPILER_WORKS=ON +- ${BUILTINS_CMAKE_ARGS} +- PASSTHROUGH_PREFIXES COMPILER_RT +- USE_TOOLCHAIN +- ${EXTRA_ARGS}) +-endfunction() ++ # Setting these variables will allow the sub-build to put their outputs into ++ # the library and bin directories of the top-level build. ++ set(LLVM_LIBRARY_OUTPUT_INTDIR ${LLVM_LIBRARY_DIR}) ++ set(LLVM_RUNTIME_OUTPUT_INTDIR ${LLVM_TOOLS_BINARY_DIR}) + +-function(builtin_register_target compiler_rt_path target) +- cmake_parse_arguments(ARG "" "" "DEPENDS" ${ARGN}) ++ # This variable makes sure that e.g. llvm-lit is found. ++ set(LLVM_MAIN_SRC_DIR ${LLVM_BUILD_MAIN_SRC_DIR}) ++ set(LLVM_CMAKE_PATH ${LLVM_MAIN_SRC_DIR}/cmake/modules) + +- check_apple_target(${target} builtin) ++ # This variable is used by individual runtimes to locate LLVM files. ++ set(LLVM_PATH ${LLVM_BUILD_MAIN_SRC_DIR}) + +- get_cmake_property(variableNames VARIABLES) +- foreach(variableName ${variableNames}) +- string(FIND "${variableName}" "BUILTINS_${target}" out) +- if("${out}" EQUAL 0) +- string(REPLACE "BUILTINS_${target}_" "" new_name ${variableName}) +- string(REPLACE ";" "|" new_value "${${variableName}}") +- list(APPEND ${target}_extra_args "-D${new_name}=${new_value}") +- endif() +- endforeach() ++ if(APPLE) ++ set(LLVM_ENABLE_LIBCXX ON CACHE BOOL "") ++ endif() + +- llvm_ExternalProject_Add(builtins-${target} +- ${compiler_rt_path}/lib/builtins +- DEPENDS ${ARG_DEPENDS} +- CMAKE_ARGS -DLLVM_LIBRARY_OUTPUT_INTDIR=${LLVM_LIBRARY_DIR} +- -DLLVM_RUNTIME_OUTPUT_INTDIR=${LLVM_TOOLS_BINARY_DIR} +- -DLLVM_DEFAULT_TARGET_TRIPLE=${target} +- -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON +- -DCMAKE_C_COMPILER_TARGET=${target} +- -DCMAKE_ASM_COMPILER_TARGET=${target} +- -DCMAKE_C_COMPILER_WORKS=ON +- -DCMAKE_ASM_COMPILER_WORKS=ON +- -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON +- ${${target}_extra_args} +- USE_TOOLCHAIN +- ${EXTRA_ARGS}) +-endfunction() ++ include(CheckLibraryExists) ++ include(CheckCCompilerFlag) + +-# If compiler-rt is present we need to build the builtin libraries first. This +-# is required because the other runtimes need the builtin libraries present +-# before the just-built compiler can pass the configuration tests. +-get_compiler_rt_path(compiler_rt_path) +-if(compiler_rt_path) +- if(NOT LLVM_BUILTIN_TARGETS) +- builtin_default_target(${compiler_rt_path} +- DEPENDS clang-resource-headers) +- else() +- if("default" IN_LIST LLVM_BUILTIN_TARGETS) +- builtin_default_target(${compiler_rt_path} +- DEPENDS clang-resource-headers) +- list(REMOVE_ITEM LLVM_BUILTIN_TARGETS "default") +- else() +- add_custom_target(builtins) +- add_custom_target(install-builtins) +- add_custom_target(install-builtins-stripped) +- endif() ++ # We don't have libc++ (yet)... ++ set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -nostdinc++ -nostdlib++") + +- foreach(target ${LLVM_BUILTIN_TARGETS}) +- builtin_register_target(${compiler_rt_path} ${target} +- DEPENDS clang-resource-headers) +- +- add_dependencies(builtins builtins-${target}) +- add_dependencies(install-builtins install-builtins-${target}) +- add_dependencies(install-builtins-stripped install-builtins-${target}-stripped) +- endforeach() ++ # ...but we need access to libc++ headers for CMake checks to succeed. ++ if (LLVM_EXTERNAL_LIBCXX_SOURCE_DIR AND "libcxx" IN_LIST LLVM_ENABLE_RUNTIMES) ++ set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -isystem ${LLVM_EXTERNAL_LIBCXX_SOURCE_DIR}/include") + endif() +- set(deps builtins) +- # We don't need to depend on the builtins if we're building instrumented +- # because the next stage will use the same compiler used to build this stage. +- if(NOT LLVM_BUILD_INSTRUMENTED AND CLANG_ENABLE_BOOTSTRAP) +- add_dependencies(clang-bootstrap-deps builtins) +- endif() +-endif() + +-# We create a list the names of all the runtime projects in all uppercase and +-# with dashes turned to underscores. This gives us the CMake variable prefixes +-# for all variables that will apply to runtimes. +-foreach(entry ${runtimes}) +- get_filename_component(projName ${entry} NAME) +- string(REPLACE "-" "_" canon_name ${projName}) +- string(TOUPPER ${canon_name} canon_name) +- list(APPEND prefixes ${canon_name}) +- if (${canon_name} STREQUAL "OPENMP") +- list(APPEND prefixes "LIBOMP" "LIBOMPTARGET") +- endif() +- # Many compiler-rt options start with SANITIZER_ rather than COMPILER_RT_, +- # so when compiler-rt is enabled, consider both. +- if(canon_name STREQUAL "COMPILER_RT") +- list(APPEND prefixes SANITIZER) +- endif() ++ # Avoid checking whether the compiler is working. ++ set(LLVM_COMPILER_CHECKED ON) ++ ++ # Handle common options used by all runtimes. ++ include(AddLLVM) ++ include(HandleLLVMOptions) ++ include(FindPythonInterp) + +- string(FIND ${projName} "lib" LIB_IDX) +- if(LIB_IDX EQUAL 0) +- string(SUBSTRING ${projName} 3 -1 projName) ++ # Remove the -nostdlib++ option we've added earlier. ++ string(REPLACE "-nostdlib++" "" CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") ++ ++ # Use libtool instead of ar if you are both on an Apple host, and targeting Apple. ++ if(CMAKE_HOST_APPLE AND APPLE) ++ include(UseLibtool) + endif() +- list(APPEND runtime_names ${projName}) +-endforeach() + +-if(LLVM_RUNTIME_BUILD_ID_LINK_TARGETS) +- configure_file( +- ${CMAKE_CURRENT_SOURCE_DIR}/llvm-strip-link.in +- ${CMAKE_CURRENT_BINARY_DIR}/llvm-strip-link +- @ONLY +- ) +-endif() ++ # This can be used to detect whether we're in the runtimes build. ++ set(RUNTIMES_BUILD ON) + +-function(runtime_default_target) +- cmake_parse_arguments(ARG "" "" "DEPENDS;PREFIXES" ${ARGN}) ++ foreach(entry ${runtimes}) ++ get_filename_component(projName ${entry} NAME) + +- include(${LLVM_BINARY_DIR}/runtimes/Components.cmake OPTIONAL) +- set(SUB_CHECK_TARGETS ${SUB_CHECK_TARGETS} PARENT_SCOPE) +- set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${LLVM_BINARY_DIR}/runtimes/Components.cmake) ++ # TODO: Clean this up as part of an interface standardization ++ string(REPLACE "-" "_" canon_name ${projName}) ++ string(TOUPPER ${canon_name} canon_name) ++ ++ # The subdirectories need to treat this as standalone builds. D57992 tried ++ # to get rid of this, but the runtimes treat *_STANDALONE_BUILD=OFF as if ++ # llvm & clang are configured in the same CMake, and setup dependencies ++ # against their targets. OpenMP has fixed the issue so we don't set the ++ # variable. ++ if (NOT ${canon_name} STREQUAL "OPENMP") ++ set(${canon_name}_STANDALONE_BUILD ON) ++ endif() + +- foreach(runtime_name ${runtime_names}) +- list(APPEND extra_targets +- ${runtime_name} +- install-${runtime_name} +- install-${runtime_name}-stripped) +- if(LLVM_INCLUDE_TESTS) +- list(APPEND test_targets check-${runtime_name}) ++ if(LLVM_RUNTIMES_LIBDIR_SUBDIR) ++ set(${canon_name}_LIBDIR_SUBDIR "${LLVM_RUNTIMES_LIBDIR_SUBDIR}" CACHE STRING "" FORCE) + endif() ++ ++ # Setting a variable to let sub-projects detect which other projects ++ # will be included under here. ++ set(HAVE_${canon_name} ON) + endforeach() +- foreach(component ${LLVM_RUNTIME_DISTRIBUTION_COMPONENTS}) +- if(NOT ${component} IN_LIST SUB_COMPONENTS) +- list(APPEND extra_targets ${component} install-${component} install-${component}-stripped) +- endif() ++ ++ # We do this in two loops so that HAVE_* is set for each runtime before the ++ # other runtimes are added. ++ foreach(entry ${runtimes}) ++ get_filename_component(projName ${entry} NAME) ++ ++ # Between each sub-project we want to cache and clear the LIT properties ++ set_property(GLOBAL PROPERTY LLVM_LIT_TESTSUITES) ++ set_property(GLOBAL PROPERTY LLVM_LIT_PARAMS) ++ set_property(GLOBAL PROPERTY LLVM_LIT_DEPENDS) ++ set_property(GLOBAL PROPERTY LLVM_LIT_EXTRA_ARGS) ++ ++ add_subdirectory(${entry} ${projName}) ++ ++ get_property(LLVM_LIT_TESTSUITES GLOBAL PROPERTY LLVM_LIT_TESTSUITES) ++ get_property(LLVM_LIT_PARAMS GLOBAL PROPERTY LLVM_LIT_PARAMS) ++ get_property(LLVM_LIT_DEPENDS GLOBAL PROPERTY LLVM_LIT_DEPENDS) ++ get_property(LLVM_LIT_EXTRA_ARGS GLOBAL PROPERTY LLVM_LIT_EXTRA_ARGS) ++ ++ list(APPEND RUNTIMES_LIT_TESTSUITES ${LLVM_LIT_TESTSUITES}) ++ list(APPEND RUNTIMES_LIT_PARAMS ${LLVM_LIT_PARAMS}) ++ list(APPEND RUNTIMES_LIT_DEPENDS ${LLVM_LIT_DEPENDS}) ++ list(APPEND RUNTIMES_LIT_EXTRA_ARGS ${LLVM_LIT_EXTRA_ARGS}) + endforeach() + + if(LLVM_INCLUDE_TESTS) +- list(APPEND test_targets runtimes-test-depends check-runtimes) +- endif() +- +- set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR_default ON) +- # AIX should fold 32-bit & 64-bit arch libraries into a single archive. +- if (TARGET_TRIPLE MATCHES "aix") +- set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR_default OFF) ++ # Add a global check rule now that all subdirectories have been traversed ++ # and we know the total set of lit testsuites. ++ ++ add_lit_target(check-runtimes ++ "Running all regression tests" ++ ${RUNTIMES_LIT_TESTSUITES} ++ PARAMS ${RUNTIMES_LIT_PARAMS} ++ DEPENDS ${RUNTIMES_LIT_DEPENDS} ++ ARGS ${RUNTIMES_LIT_EXTRA_ARGS} ++ ) ++ add_custom_target(runtimes-test-depends DEPENDS ${RUNTIMES_LIT_DEPENDS}) + endif() + +- llvm_ExternalProject_Add(runtimes +- ${CMAKE_CURRENT_SOURCE_DIR}/../../runtimes +- DEPENDS ${ARG_DEPENDS} +- # Builtins were built separately above +- CMAKE_ARGS -DCOMPILER_RT_BUILD_BUILTINS=Off +- -DLLVM_INCLUDE_TESTS=${LLVM_INCLUDE_TESTS} +- -DLLVM_DEFAULT_TARGET_TRIPLE=${TARGET_TRIPLE} +- -DLLVM_ENABLE_PROJECTS_USED=${LLVM_ENABLE_PROJECTS_USED} +- -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=${LLVM_ENABLE_PER_TARGET_RUNTIME_DIR_default} +- -DCMAKE_C_COMPILER_TARGET=${TARGET_TRIPLE} +- -DCMAKE_CXX_COMPILER_TARGET=${TARGET_TRIPLE} +- -DCMAKE_ASM_COMPILER_TARGET=${TARGET_TRIPLE} +- -DCMAKE_C_COMPILER_WORKS=ON +- -DCMAKE_CXX_COMPILER_WORKS=ON +- -DCMAKE_ASM_COMPILER_WORKS=ON +- ${RUNTIMES_CMAKE_ARGS} +- PASSTHROUGH_PREFIXES LLVM_ENABLE_RUNTIMES +- ${ARG_PREFIXES} +- EXTRA_TARGETS ${extra_targets} +- ${test_targets} +- ${SUB_COMPONENTS} +- ${SUB_CHECK_TARGETS} +- ${SUB_INSTALL_TARGETS} +- USE_TOOLCHAIN +- ${EXTRA_ARGS}) +-endfunction() ++ get_property(SUB_COMPONENTS GLOBAL PROPERTY SUB_COMPONENTS) ++ if(SUB_COMPONENTS) ++ list(REMOVE_DUPLICATES SUB_COMPONENTS) ++ foreach(component ${SUB_COMPONENTS}) ++ if(NOT TARGET ${component}) ++ message(SEND_ERROR "Missing target for runtime component ${component}!") ++ continue() ++ endif() + +-# runtime_register_target(target) +-# Utility function to register external runtime target. +-function(runtime_register_target name target) +- cmake_parse_arguments(ARG "" "" "DEPENDS;CMAKE_ARGS" ${ARGN}) +- include(${LLVM_BINARY_DIR}/runtimes/${name}/Components.cmake OPTIONAL) +- set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${LLVM_BINARY_DIR}/runtimes/${name}/Components.cmake) ++ if(TARGET check-${component}) ++ list(APPEND SUB_CHECK_TARGETS check-${component}) ++ endif() + +- check_apple_target(${target} runtime) ++ if(TARGET install-${component}) ++ list(APPEND SUB_INSTALL_TARGETS install-${component}) ++ endif() ++ if(TARGET install-${component}-stripped) ++ list(APPEND SUB_INSTALL_TARGETS install-${component}-stripped) ++ endif() ++ endforeach() + +- set(${name}_deps ${ARG_DEPENDS}) +- if(NOT name STREQUAL target) +- list(APPEND ${name}_deps runtimes-${target}) ++ if(LLVM_RUNTIMES_TARGET) ++ configure_file( ++ ${CMAKE_CURRENT_SOURCE_DIR}/Components.cmake.in ++ ${LLVM_BINARY_DIR}/runtimes/${LLVM_RUNTIMES_TARGET}/Components.cmake) ++ else() ++ configure_file( ++ ${CMAKE_CURRENT_SOURCE_DIR}/Components.cmake.in ++ ${LLVM_BINARY_DIR}/runtimes/Components.cmake) ++ endif() + endif() + +- foreach(runtime_name ${runtime_names}) +- set(${runtime_name}-${name} ${runtime_name}) +- set(install-${runtime_name}-${name} install-${runtime_name}) +- set(install-${runtime_name}-${name}-stripped install-${runtime_name}-stripped) +- list(APPEND ${name}_extra_targets ${runtime_name}-${name} install-${runtime_name}-${name} install-${runtime_name}-${name}-stripped) +- if(LLVM_INCLUDE_TESTS) +- set(check-${runtime_name}-${name} check-${runtime_name} ) +- list(APPEND ${name}_test_targets check-${runtime_name}-${name}) +- endif() +- endforeach() ++else() # if this is included from LLVM's CMake ++ include(LLVMExternalProjectUtils) + +- foreach(target_name IN LISTS SUB_COMPONENTS SUB_INSTALL_TARGETS) +- set(${target_name}-${name} ${target_name}) +- list(APPEND ${name}_extra_targets ${target_name}-${name}) +- endforeach() ++ if(NOT LLVM_BUILD_RUNTIMES) ++ set(EXTRA_ARGS EXCLUDE_FROM_ALL) ++ endif() + +- foreach(component ${LLVM_RUNTIME_DISTRIBUTION_COMPONENTS}) +- set(${component}-${name} ${component}) +- set(install-${component}-${name} install-${component}) +- set(install-${component}-${name}-stripped install-${component}-stripped) +- list(APPEND ${name}_extra_targets ${component}-${name} install-${component}-${name} install-${component}-${name}-stripped) +- endforeach() ++ function(check_apple_target triple builtin_or_runtime) ++ set(error "\ ++compiler-rt for Darwin builds for all platforms and architectures using a \ ++single configuration. Specify only a single darwin triple (e.g. x86_64-apple-darwin) \ ++in your targets list (and not a triple for a specific platform such as macos). \ ++You can use variables such as COMPILER_RT_ENABLE_IOS and DARWIN_ios_ARCHS to \ ++control the specific platforms and architectures to build.") + +- if(LLVM_INCLUDE_TESTS) +- set(runtimes-test-depends-${name} runtimes-test-depends) +- set(check-runtimes-${name} check-runtimes) +- list(APPEND ${name}_test_targets runtimes-test-depends-${name} check-runtimes-${name}) +- foreach(target_name IN LISTS SUB_CHECK_TARGETS) +- set(${target_name}-${name} ${target_name}) +- list(APPEND ${name}_test_targets ${target_name}-${name}) +- list(APPEND test_targets ${target_name}-${name}) ++ set(seen_property ${builtin_or_runtime}_darwin_triple_seen) ++ string(REPLACE "-" ";" triple_components ${triple}) ++ foreach(component ${triple_components}) ++ string(TOLOWER "${component}" component_lower) ++ if(component_lower MATCHES "^darwin") ++ get_property(darwin_triple_seen GLOBAL PROPERTY ${seen_property}) ++ if(darwin_triple_seen) ++ message(FATAL_ERROR "${error}") ++ endif() ++ set_property(GLOBAL PROPERTY ${seen_property} YES) ++ if(NOT RUNTIMES_BUILD_ALLOW_DARWIN) ++ message(FATAL_ERROR "\ ++${error} Set RUNTIMES_BUILD_ALLOW_DARWIN to allow a single darwin triple.") ++ endif() ++ elseif(component_lower MATCHES "^ios|^macos|^tvos|^watchos") ++ message(FATAL_ERROR "${error}") ++ endif() + endforeach() +- set(test_targets "${test_targets}" PARENT_SCOPE) +- endif() ++ endfunction() ++ ++ function(builtin_default_target compiler_rt_path) ++ cmake_parse_arguments(ARG "" "" "DEPENDS" ${ARGN}) + +- set(${name}_extra_args ${ARG_CMAKE_ARGS}) +- get_cmake_property(variableNames VARIABLES) +- foreach(variableName ${variableNames}) +- string(FIND "${variableName}" "RUNTIMES_${target}_" out) +- if("${out}" EQUAL 0) +- string(REPLACE "RUNTIMES_${target}_" "" new_name ${variableName}) +- string(REPLACE ";" "|" new_value "${${variableName}}") +- list(APPEND ${name}_extra_args "-D${new_name}=${new_value}") ++ set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR_default ON) ++ # AIX should fold 32-bit & 64-bit arch libraries into a single archive. ++ if (TARGET_TRIPLE MATCHES "aix") ++ set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR_default OFF) + endif() +- endforeach() +- if(NOT "${name}" STREQUAL "${target}") ++ ++ llvm_ExternalProject_Add(builtins ++ ${compiler_rt_path}/lib/builtins ++ DEPENDS ${ARG_DEPENDS} ++ CMAKE_ARGS -DLLVM_LIBRARY_OUTPUT_INTDIR=${LLVM_LIBRARY_DIR} ++ -DLLVM_RUNTIME_OUTPUT_INTDIR=${LLVM_TOOLS_BINARY_DIR} ++ -DLLVM_DEFAULT_TARGET_TRIPLE=${TARGET_TRIPLE} ++ -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=${LLVM_ENABLE_PER_TARGET_RUNTIME_DIR_default} ++ -DCMAKE_C_COMPILER_TARGET=${TARGET_TRIPLE} ++ -DCMAKE_ASM_COMPILER_TARGET=${TARGET_TRIPLE} ++ -DCMAKE_C_COMPILER_WORKS=ON ++ -DCMAKE_ASM_COMPILER_WORKS=ON ++ ${BUILTINS_CMAKE_ARGS} ++ PASSTHROUGH_PREFIXES COMPILER_RT ++ USE_TOOLCHAIN ++ ${EXTRA_ARGS}) ++ endfunction() ++ ++ function(builtin_register_target compiler_rt_path target) ++ cmake_parse_arguments(ARG "" "" "DEPENDS" ${ARGN}) ++ ++ check_apple_target(${target} builtin) ++ ++ get_cmake_property(variableNames VARIABLES) + foreach(variableName ${variableNames}) +- string(FIND "${variableName}" "RUNTIMES_${name}_" out) ++ string(FIND "${variableName}" "BUILTINS_${target}" out) + if("${out}" EQUAL 0) +- string(REPLACE "RUNTIMES_${name}_" "" new_name ${variableName}) ++ string(REPLACE "BUILTINS_${target}_" "" new_name ${variableName}) + string(REPLACE ";" "|" new_value "${${variableName}}") +- list(APPEND ${name}_extra_args "-D${new_name}=${new_value}") ++ list(APPEND ${target}_extra_args "-D${new_name}=${new_value}") + endif() + endforeach() +- endif() + +- if(NOT RUNTIMES_${name}_LLVM_ENABLE_RUNTIMES AND NOT RUNTIMES_${target}_LLVM_ENABLE_RUNTIMES) +- string(REPLACE ";" "|" LLVM_ENABLE_RUNTIMES_PASSTHROUGH "${LLVM_ENABLE_RUNTIMES}") +- list(APPEND ${name}_extra_args -DLLVM_ENABLE_RUNTIMES=${LLVM_ENABLE_RUNTIMES_PASSTHROUGH}) ++ llvm_ExternalProject_Add(builtins-${target} ++ ${compiler_rt_path}/lib/builtins ++ DEPENDS ${ARG_DEPENDS} ++ CMAKE_ARGS -DLLVM_LIBRARY_OUTPUT_INTDIR=${LLVM_LIBRARY_DIR} ++ -DLLVM_RUNTIME_OUTPUT_INTDIR=${LLVM_TOOLS_BINARY_DIR} ++ -DLLVM_DEFAULT_TARGET_TRIPLE=${target} ++ -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON ++ -DCMAKE_C_COMPILER_TARGET=${target} ++ -DCMAKE_ASM_COMPILER_TARGET=${target} ++ -DCMAKE_C_COMPILER_WORKS=ON ++ -DCMAKE_ASM_COMPILER_WORKS=ON ++ -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON ++ ${${target}_extra_args} ++ USE_TOOLCHAIN ++ ${EXTRA_ARGS}) ++ endfunction() ++ ++ # If compiler-rt is present we need to build the builtin libraries first. This ++ # is required because the other runtimes need the builtin libraries present ++ # before the just-built compiler can pass the configuration tests. ++ get_compiler_rt_path(compiler_rt_path) ++ if(compiler_rt_path) ++ if(NOT LLVM_BUILTIN_TARGETS) ++ builtin_default_target(${compiler_rt_path} ++ DEPENDS clang-resource-headers) ++ else() ++ if("default" IN_LIST LLVM_BUILTIN_TARGETS) ++ builtin_default_target(${compiler_rt_path} ++ DEPENDS clang-resource-headers) ++ list(REMOVE_ITEM LLVM_BUILTIN_TARGETS "default") ++ else() ++ add_custom_target(builtins) ++ add_custom_target(install-builtins) ++ add_custom_target(install-builtins-stripped) ++ endif() ++ ++ foreach(target ${LLVM_BUILTIN_TARGETS}) ++ builtin_register_target(${compiler_rt_path} ${target} ++ DEPENDS clang-resource-headers) ++ ++ add_dependencies(builtins builtins-${target}) ++ add_dependencies(install-builtins install-builtins-${target}) ++ add_dependencies(install-builtins-stripped install-builtins-${target}-stripped) ++ endforeach() ++ endif() ++ set(deps builtins) ++ # We don't need to depend on the builtins if we're building instrumented ++ # because the next stage will use the same compiler used to build this stage. ++ if(NOT LLVM_BUILD_INSTRUMENTED AND CLANG_ENABLE_BOOTSTRAP) ++ add_dependencies(clang-bootstrap-deps builtins) ++ endif() + endif() + +- if(target IN_LIST LLVM_RUNTIME_BUILD_ID_LINK_TARGETS) +- list(APPEND EXTRA_ARGS STRIP_TOOL ${CMAKE_CURRENT_BINARY_DIR}/llvm-strip-link) ++ # We create a list the names of all the runtime projects in all uppercase and ++ # with dashes turned to underscores. This gives us the CMake variable prefixes ++ # for all variables that will apply to runtimes. ++ foreach(entry ${runtimes}) ++ get_filename_component(projName ${entry} NAME) ++ string(REPLACE "-" "_" canon_name ${projName}) ++ string(TOUPPER ${canon_name} canon_name) ++ list(APPEND prefixes ${canon_name}) ++ if (${canon_name} STREQUAL "OPENMP") ++ list(APPEND prefixes "LIBOMP" "LIBOMPTARGET") ++ endif() ++ # Many compiler-rt options start with SANITIZER_ rather than COMPILER_RT_, ++ # so when compiler-rt is enabled, consider both. ++ if(canon_name STREQUAL "COMPILER_RT") ++ list(APPEND prefixes SANITIZER) ++ endif() ++ ++ string(FIND ${projName} "lib" LIB_IDX) ++ if(LIB_IDX EQUAL 0) ++ string(SUBSTRING ${projName} 3 -1 projName) ++ endif() ++ list(APPEND runtime_names ${projName}) ++ endforeach() ++ ++ if(LLVM_RUNTIME_BUILD_ID_LINK_TARGETS) ++ configure_file( ++ ${CMAKE_CURRENT_SOURCE_DIR}/llvm-strip-link.in ++ ${CMAKE_CURRENT_BINARY_DIR}/llvm-strip-link ++ @ONLY ++ ) + endif() + +- llvm_ExternalProject_Add(runtimes-${name} +- ${CMAKE_CURRENT_SOURCE_DIR}/../../runtimes +- DEPENDS ${${name}_deps} +- # Builtins were built separately above +- CMAKE_ARGS -DCOMPILER_RT_BUILD_BUILTINS=Off +- -DLLVM_INCLUDE_TESTS=${LLVM_INCLUDE_TESTS} +- -DLLVM_DEFAULT_TARGET_TRIPLE=${target} +- -DLLVM_ENABLE_PROJECTS_USED=${LLVM_ENABLE_PROJECTS_USED} +- -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON +- -DCMAKE_C_COMPILER_TARGET=${target} +- -DCMAKE_CXX_COMPILER_TARGET=${target} +- -DCMAKE_ASM_COMPILER_TARGET=${target} +- -DCMAKE_C_COMPILER_WORKS=ON +- -DCMAKE_CXX_COMPILER_WORKS=ON +- -DCMAKE_ASM_COMPILER_WORKS=ON +- -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON +- -DLLVM_RUNTIMES_TARGET=${name} +- ${${name}_extra_args} +- EXTRA_TARGETS ${${name}_extra_targets} +- ${${name}_test_targets} +- USE_TOOLCHAIN +- ${EXTRA_ARGS}) +-endfunction() ++ function(runtime_default_target) ++ cmake_parse_arguments(ARG "" "" "DEPENDS;PREFIXES" ${ARGN}) + +-if(runtimes) +- # Create a runtimes target that uses this file as its top-level CMake file. +- # The runtimes target is a configuration of all the runtime libraries +- # together in a single CMake invocaiton. +- if(NOT LLVM_RUNTIME_TARGETS) +- runtime_default_target( +- DEPENDS ${deps} +- PREFIXES ${prefixes}) +- set(test_targets check-runtimes) +- else() +- if("default" IN_LIST LLVM_RUNTIME_TARGETS) +- runtime_default_target( +- DEPENDS ${deps} +- PREFIXES ${prefixes}) +- list(REMOVE_ITEM LLVM_RUNTIME_TARGETS "default") +- else() +- add_custom_target(runtimes) +- add_custom_target(runtimes-configure) +- add_custom_target(install-runtimes) +- add_custom_target(install-runtimes-stripped) ++ include(${LLVM_BINARY_DIR}/runtimes/Components.cmake OPTIONAL) ++ set(SUB_CHECK_TARGETS ${SUB_CHECK_TARGETS} PARENT_SCOPE) ++ set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${LLVM_BINARY_DIR}/runtimes/Components.cmake) ++ ++ foreach(runtime_name ${runtime_names}) ++ list(APPEND extra_targets ++ ${runtime_name} ++ install-${runtime_name} ++ install-${runtime_name}-stripped) + if(LLVM_INCLUDE_TESTS) +- add_custom_target(check-runtimes) +- add_custom_target(runtimes-test-depends) +- set(test_targets "") ++ list(APPEND test_targets check-${runtime_name}) + endif() +- foreach(runtime_name ${runtime_names}) +- add_custom_target(${runtime_name}) +- add_custom_target(install-${runtime_name}) +- add_custom_target(install-${runtime_name}-stripped) +- endforeach() +- if(LLVM_RUNTIME_DISTRIBUTION_COMPONENTS) +- foreach(component ${LLVM_RUNTIME_DISTRIBUTION_COMPONENTS}) +- add_custom_target(${component}) +- add_custom_target(install-${component}) +- add_custom_target(install-${component}-stripped) +- endforeach() ++ endforeach() ++ foreach(component ${LLVM_RUNTIME_DISTRIBUTION_COMPONENTS}) ++ if(NOT ${component} IN_LIST SUB_COMPONENTS) ++ list(APPEND extra_targets ${component} install-${component} install-${component}-stripped) + endif() ++ endforeach() ++ ++ if(LLVM_INCLUDE_TESTS) ++ list(APPEND test_targets runtimes-test-depends check-runtimes) + endif() + +- foreach(name ${LLVM_RUNTIME_TARGETS}) +- runtime_register_target(${name} ${name} +- DEPENDS ${deps}) ++ set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR_default ON) ++ # AIX should fold 32-bit & 64-bit arch libraries into a single archive. ++ if (TARGET_TRIPLE MATCHES "aix") ++ set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR_default OFF) ++ endif() ++ ++ llvm_ExternalProject_Add(runtimes ++ ${CMAKE_CURRENT_SOURCE_DIR} ++ DEPENDS ${ARG_DEPENDS} ++ # Builtins were built separately above ++ CMAKE_ARGS -DCOMPILER_RT_BUILD_BUILTINS=Off ++ -DLLVM_INCLUDE_TESTS=${LLVM_INCLUDE_TESTS} ++ -DLLVM_DEFAULT_TARGET_TRIPLE=${TARGET_TRIPLE} ++ -DLLVM_ENABLE_PROJECTS_USED=${LLVM_ENABLE_PROJECTS_USED} ++ -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=${LLVM_ENABLE_PER_TARGET_RUNTIME_DIR_default} ++ -DCMAKE_C_COMPILER_TARGET=${TARGET_TRIPLE} ++ -DCMAKE_CXX_COMPILER_TARGET=${TARGET_TRIPLE} ++ -DCMAKE_ASM_COMPILER_TARGET=${TARGET_TRIPLE} ++ -DCMAKE_C_COMPILER_WORKS=ON ++ -DCMAKE_CXX_COMPILER_WORKS=ON ++ -DCMAKE_ASM_COMPILER_WORKS=ON ++ ${RUNTIMES_CMAKE_ARGS} ++ PASSTHROUGH_PREFIXES LLVM_ENABLE_RUNTIMES ++ ${ARG_PREFIXES} ++ EXTRA_TARGETS ${extra_targets} ++ ${test_targets} ++ ${SUB_COMPONENTS} ++ ${SUB_CHECK_TARGETS} ++ ${SUB_INSTALL_TARGETS} ++ USE_TOOLCHAIN ++ ${EXTRA_ARGS}) ++ endfunction() ++ ++ # runtime_register_target(target) ++ # Utility function to register external runtime target. ++ function(runtime_register_target name target) ++ cmake_parse_arguments(ARG "" "" "DEPENDS;CMAKE_ARGS" ${ARGN}) ++ include(${LLVM_BINARY_DIR}/runtimes/${name}/Components.cmake OPTIONAL) ++ set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${LLVM_BINARY_DIR}/runtimes/${name}/Components.cmake) ++ ++ check_apple_target(${target} runtime) ++ ++ set(${name}_deps ${ARG_DEPENDS}) ++ if(NOT name STREQUAL target) ++ list(APPEND ${name}_deps runtimes-${target}) ++ endif() + +- add_dependencies(runtimes runtimes-${name}) +- add_dependencies(runtimes-configure runtimes-${name}-configure) +- add_dependencies(install-runtimes install-runtimes-${name}) +- add_dependencies(install-runtimes-stripped install-runtimes-${name}-stripped) ++ foreach(runtime_name ${runtime_names}) ++ set(${runtime_name}-${name} ${runtime_name}) ++ set(install-${runtime_name}-${name} install-${runtime_name}) ++ set(install-${runtime_name}-${name}-stripped install-${runtime_name}-stripped) ++ list(APPEND ${name}_extra_targets ${runtime_name}-${name} install-${runtime_name}-${name} install-${runtime_name}-${name}-stripped) + if(LLVM_INCLUDE_TESTS) +- add_dependencies(check-runtimes check-runtimes-${name}) +- add_dependencies(runtimes-test-depends runtimes-test-depends-${name}) ++ set(check-${runtime_name}-${name} check-${runtime_name} ) ++ list(APPEND ${name}_test_targets check-${runtime_name}-${name}) + endif() +- foreach(runtime_name ${runtime_names}) +- add_dependencies(${runtime_name} ${runtime_name}-${name}) +- add_dependencies(install-${runtime_name} install-${runtime_name}-${name}) +- add_dependencies(install-${runtime_name}-stripped install-${runtime_name}-${name}-stripped) ++ endforeach() ++ ++ foreach(target_name IN LISTS SUB_COMPONENTS SUB_INSTALL_TARGETS) ++ set(${target_name}-${name} ${target_name}) ++ list(APPEND ${name}_extra_targets ${target_name}-${name}) ++ endforeach() ++ ++ foreach(component ${LLVM_RUNTIME_DISTRIBUTION_COMPONENTS}) ++ set(${component}-${name} ${component}) ++ set(install-${component}-${name} install-${component}) ++ set(install-${component}-${name}-stripped install-${component}-stripped) ++ list(APPEND ${name}_extra_targets ${component}-${name} install-${component}-${name} install-${component}-${name}-stripped) ++ endforeach() ++ ++ if(LLVM_INCLUDE_TESTS) ++ set(runtimes-test-depends-${name} runtimes-test-depends) ++ set(check-runtimes-${name} check-runtimes) ++ list(APPEND ${name}_test_targets runtimes-test-depends-${name} check-runtimes-${name}) ++ foreach(target_name IN LISTS SUB_CHECK_TARGETS) ++ set(${target_name}-${name} ${target_name}) ++ list(APPEND ${name}_test_targets ${target_name}-${name}) ++ list(APPEND test_targets ${target_name}-${name}) + endforeach() ++ set(test_targets "${test_targets}" PARENT_SCOPE) ++ endif() ++ ++ set(${name}_extra_args ${ARG_CMAKE_ARGS}) ++ get_cmake_property(variableNames VARIABLES) ++ foreach(variableName ${variableNames}) ++ string(FIND "${variableName}" "RUNTIMES_${target}_" out) ++ if("${out}" EQUAL 0) ++ string(REPLACE "RUNTIMES_${target}_" "" new_name ${variableName}) ++ string(REPLACE ";" "|" new_value "${${variableName}}") ++ list(APPEND ${name}_extra_args "-D${new_name}=${new_value}") ++ endif() + endforeach() ++ if(NOT "${name}" STREQUAL "${target}") ++ foreach(variableName ${variableNames}) ++ string(FIND "${variableName}" "RUNTIMES_${name}_" out) ++ if("${out}" EQUAL 0) ++ string(REPLACE "RUNTIMES_${name}_" "" new_name ${variableName}) ++ string(REPLACE ";" "|" new_value "${${variableName}}") ++ list(APPEND ${name}_extra_args "-D${new_name}=${new_value}") ++ endif() ++ endforeach() ++ endif() ++ ++ if(NOT RUNTIMES_${name}_LLVM_ENABLE_RUNTIMES AND NOT RUNTIMES_${target}_LLVM_ENABLE_RUNTIMES) ++ string(REPLACE ";" "|" LLVM_ENABLE_RUNTIMES_PASSTHROUGH "${LLVM_ENABLE_RUNTIMES}") ++ list(APPEND ${name}_extra_args -DLLVM_ENABLE_RUNTIMES=${LLVM_ENABLE_RUNTIMES_PASSTHROUGH}) ++ endif() ++ ++ if(target IN_LIST LLVM_RUNTIME_BUILD_ID_LINK_TARGETS) ++ list(APPEND EXTRA_ARGS STRIP_TOOL ${CMAKE_CURRENT_BINARY_DIR}/llvm-strip-link) ++ endif() + +- foreach(multilib ${LLVM_RUNTIME_MULTILIBS}) +- foreach(name ${LLVM_RUNTIME_MULTILIB_${multilib}_TARGETS}) +- runtime_register_target(${name}+${multilib} ${name} +- DEPENDS runtimes-${name} +- CMAKE_ARGS -DLLVM_RUNTIMES_PREFIX=${name}/ +- -DLLVM_RUNTIMES_LIBDIR_SUBDIR=${multilib}) +- add_dependencies(runtimes runtimes-${name}+${multilib}) +- add_dependencies(runtimes-configure runtimes-${name}+${multilib}-configure) +- add_dependencies(install-runtimes install-runtimes-${name}+${multilib}) +- add_dependencies(install-runtimes-stripped install-runtimes-${name}+${multilib}-stripped) ++ llvm_ExternalProject_Add(runtimes-${name} ++ ${CMAKE_CURRENT_SOURCE_DIR} ++ DEPENDS ${${name}_deps} ++ # Builtins were built separately above ++ CMAKE_ARGS -DCOMPILER_RT_BUILD_BUILTINS=Off ++ -DLLVM_INCLUDE_TESTS=${LLVM_INCLUDE_TESTS} ++ -DLLVM_DEFAULT_TARGET_TRIPLE=${target} ++ -DLLVM_ENABLE_PROJECTS_USED=${LLVM_ENABLE_PROJECTS_USED} ++ -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON ++ -DCMAKE_C_COMPILER_TARGET=${target} ++ -DCMAKE_CXX_COMPILER_TARGET=${target} ++ -DCMAKE_ASM_COMPILER_TARGET=${target} ++ -DCMAKE_C_COMPILER_WORKS=ON ++ -DCMAKE_CXX_COMPILER_WORKS=ON ++ -DCMAKE_ASM_COMPILER_WORKS=ON ++ -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON ++ -DLLVM_RUNTIMES_TARGET=${name} ++ ${${name}_extra_args} ++ EXTRA_TARGETS ${${name}_extra_targets} ++ ${${name}_test_targets} ++ USE_TOOLCHAIN ++ ${EXTRA_ARGS}) ++ endfunction() ++ ++ if(runtimes) ++ # Create a runtimes target that uses this file as its top-level CMake file. ++ # The runtimes target is a configuration of all the runtime libraries ++ # together in a single CMake invocaiton. ++ if(NOT LLVM_RUNTIME_TARGETS) ++ runtime_default_target( ++ DEPENDS ${deps} ++ PREFIXES ${prefixes}) ++ set(test_targets check-runtimes) ++ else() ++ if("default" IN_LIST LLVM_RUNTIME_TARGETS) ++ runtime_default_target( ++ DEPENDS ${deps} ++ PREFIXES ${prefixes}) ++ list(REMOVE_ITEM LLVM_RUNTIME_TARGETS "default") ++ else() ++ add_custom_target(runtimes) ++ add_custom_target(runtimes-configure) ++ add_custom_target(install-runtimes) ++ add_custom_target(install-runtimes-stripped) ++ if(LLVM_INCLUDE_TESTS) ++ add_custom_target(check-runtimes) ++ add_custom_target(runtimes-test-depends) ++ set(test_targets "") ++ endif() ++ foreach(runtime_name ${runtime_names}) ++ add_custom_target(${runtime_name}) ++ add_custom_target(install-${runtime_name}) ++ add_custom_target(install-${runtime_name}-stripped) ++ endforeach() ++ if(LLVM_RUNTIME_DISTRIBUTION_COMPONENTS) ++ foreach(component ${LLVM_RUNTIME_DISTRIBUTION_COMPONENTS}) ++ add_custom_target(${component}) ++ add_custom_target(install-${component}) ++ add_custom_target(install-${component}-stripped) ++ endforeach() ++ endif() ++ endif() ++ ++ foreach(name ${LLVM_RUNTIME_TARGETS}) ++ runtime_register_target(${name} ${name} ++ DEPENDS ${deps}) ++ ++ add_dependencies(runtimes runtimes-${name}) ++ add_dependencies(runtimes-configure runtimes-${name}-configure) ++ add_dependencies(install-runtimes install-runtimes-${name}) ++ add_dependencies(install-runtimes-stripped install-runtimes-${name}-stripped) ++ if(LLVM_INCLUDE_TESTS) ++ add_dependencies(check-runtimes check-runtimes-${name}) ++ add_dependencies(runtimes-test-depends runtimes-test-depends-${name}) ++ endif() + foreach(runtime_name ${runtime_names}) +- add_dependencies(${runtime_name} ${runtime_name}-${name}+${multilib}) +- add_dependencies(install-${runtime_name} install-${runtime_name}-${name}+${multilib}) +- add_dependencies(install-${runtime_name}-stripped install-${runtime_name}-${name}+${multilib}-stripped) ++ add_dependencies(${runtime_name} ${runtime_name}-${name}) ++ add_dependencies(install-${runtime_name} install-${runtime_name}-${name}) ++ add_dependencies(install-${runtime_name}-stripped install-${runtime_name}-${name}-stripped) + endforeach() + endforeach() +- endforeach() +- endif() + +- if(NOT LLVM_BUILD_INSTRUMENTED AND CLANG_ENABLE_BOOTSTRAP) +- # TODO: This is a hack needed because the libcxx headers are copied into the +- # build directory during configuration. Without that step the clang in the +- # build directory cannot find the C++ headers in certain configurations. +- # I need to build a mechanism for runtime projects to provide CMake code +- # that executes at LLVM configuration time to handle this case. +- add_dependencies(clang-bootstrap-deps runtimes-configure) +- # We need to add the runtimes as a dependency because compiler-rt can be +- # built as part of runtimes and we need the profile runtime for PGO +- add_dependencies(clang-bootstrap-deps runtimes) +- endif() ++ foreach(multilib ${LLVM_RUNTIME_MULTILIBS}) ++ foreach(name ${LLVM_RUNTIME_MULTILIB_${multilib}_TARGETS}) ++ runtime_register_target(${name}+${multilib} ${name} ++ DEPENDS runtimes-${name} ++ CMAKE_ARGS -DLLVM_RUNTIMES_PREFIX=${name}/ ++ -DLLVM_RUNTIMES_LIBDIR_SUBDIR=${multilib}) ++ add_dependencies(runtimes runtimes-${name}+${multilib}) ++ add_dependencies(runtimes-configure runtimes-${name}+${multilib}-configure) ++ add_dependencies(install-runtimes install-runtimes-${name}+${multilib}) ++ add_dependencies(install-runtimes-stripped install-runtimes-${name}+${multilib}-stripped) ++ foreach(runtime_name ${runtime_names}) ++ add_dependencies(${runtime_name} ${runtime_name}-${name}+${multilib}) ++ add_dependencies(install-${runtime_name} install-${runtime_name}-${name}+${multilib}) ++ add_dependencies(install-${runtime_name}-stripped install-${runtime_name}-${name}+${multilib}-stripped) ++ endforeach() ++ endforeach() ++ endforeach() ++ endif() + +- if(LLVM_INCLUDE_TESTS) +- set_property(GLOBAL APPEND PROPERTY LLVM_ADDITIONAL_TEST_DEPENDS runtimes-test-depends) +- set_property(GLOBAL APPEND PROPERTY LLVM_ADDITIONAL_TEST_TARGETS check-runtimes) +- +- set(RUNTIMES_TEST_DEPENDS +- FileCheck +- count +- llvm-nm +- llvm-objdump +- llvm-xray +- not +- obj2yaml +- sancov +- sanstats +- gtest_main +- gtest +- ) +- foreach(target ${test_targets} ${SUB_CHECK_TARGETS}) +- add_dependencies(${target} ${RUNTIMES_TEST_DEPENDS}) +- endforeach() ++ if(NOT LLVM_BUILD_INSTRUMENTED AND CLANG_ENABLE_BOOTSTRAP) ++ # TODO: This is a hack needed because the libcxx headers are copied into the ++ # build directory during configuration. Without that step the clang in the ++ # build directory cannot find the C++ headers in certain configurations. ++ # I need to build a mechanism for runtime projects to provide CMake code ++ # that executes at LLVM configuration time to handle this case. ++ add_dependencies(clang-bootstrap-deps runtimes-configure) ++ # We need to add the runtimes as a dependency because compiler-rt can be ++ # built as part of runtimes and we need the profile runtime for PGO ++ add_dependencies(clang-bootstrap-deps runtimes) ++ endif() ++ ++ if(LLVM_INCLUDE_TESTS) ++ set_property(GLOBAL APPEND PROPERTY LLVM_ADDITIONAL_TEST_DEPENDS runtimes-test-depends) ++ set_property(GLOBAL APPEND PROPERTY LLVM_ADDITIONAL_TEST_TARGETS check-runtimes) ++ ++ set(RUNTIMES_TEST_DEPENDS ++ FileCheck ++ count ++ llvm-nm ++ llvm-objdump ++ llvm-xray ++ not ++ obj2yaml ++ sancov ++ sanstats ++ gtest_main ++ gtest ++ ) ++ foreach(target ${test_targets} ${SUB_CHECK_TARGETS}) ++ add_dependencies(${target} ${RUNTIMES_TEST_DEPENDS}) ++ endforeach() ++ endif() + endif() + endif() +diff --git a/runtimes/Components.cmake.in b/llvm/runtimes/Components.cmake.in +similarity index 100% +rename from runtimes/Components.cmake.in +rename to llvm/runtimes/Components.cmake.in +diff --git a/runtimes/CMakeLists.txt b/runtimes/CMakeLists.txt +deleted file mode 100644 +index a1017d91f36a..000000000000 +--- a/runtimes/CMakeLists.txt ++++ /dev/null +@@ -1,203 +0,0 @@ +-# This file handles building LLVM runtime sub-projects. +-cmake_minimum_required(VERSION 3.13.4) +-project(Runtimes C CXX ASM) +- +-set(LLVM_ALL_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind;openmp") +-set(LLVM_ENABLE_RUNTIMES "" CACHE STRING +- "Semicolon-separated list of runtimes to build (${LLVM_ALL_RUNTIMES}), or \"all\".") +-if(LLVM_ENABLE_RUNTIMES STREQUAL "all" ) +- set(LLVM_ENABLE_RUNTIMES ${LLVM_ALL_RUNTIMES}) +-endif() +- +-foreach(proj ${LLVM_ENABLE_RUNTIMES}) +- set(proj_dir "${CMAKE_CURRENT_SOURCE_DIR}/../${proj}") +- if(IS_DIRECTORY ${proj_dir} AND EXISTS ${proj_dir}/CMakeLists.txt) +- list(APPEND runtimes ${proj_dir}) +- else() +- message(FATAL_ERROR "LLVM_ENABLE_RUNTIMES requests ${proj} but directory not found: ${proj_dir}") +- endif() +- string(TOUPPER "${proj}" canon_name) +- STRING(REGEX REPLACE "-" "_" canon_name ${canon_name}) +- set(LLVM_EXTERNAL_${canon_name}_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../${proj}") +-endforeach() +- +-function(runtime_register_component name) +- set_property(GLOBAL APPEND PROPERTY SUB_COMPONENTS ${name}) +-endfunction() +- +-find_package(LLVM PATHS "${LLVM_BINARY_DIR}" NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) +-find_package(Clang PATHS "${LLVM_BINARY_DIR}" NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) +- +-# Add path for custom and the LLVM build's modules to the CMake module path. +-list(INSERT CMAKE_MODULE_PATH 0 +- "${CMAKE_CURRENT_SOURCE_DIR}/cmake" +- "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" +- "${CMAKE_CURRENT_SOURCE_DIR}/../llvm/cmake" +- "${CMAKE_CURRENT_SOURCE_DIR}/../llvm/cmake/modules" +-) +- +-function(get_compiler_rt_path path) +- foreach(entry ${runtimes}) +- get_filename_component(projName ${entry} NAME) +- if("${projName}" MATCHES "compiler-rt") +- set(${path} ${entry} PARENT_SCOPE) +- return() +- endif() +- endforeach() +-endfunction() +- +-# Some of the runtimes will conditionally use the compiler-rt sanitizers +-# to make this work smoothly we ensure that compiler-rt is added first in +-# the list of sub-projects. This allows other sub-projects to have checks +-# like `if(TARGET asan)` to enable building with asan. +-get_compiler_rt_path(compiler_rt_path) +-if(compiler_rt_path) +- list(REMOVE_ITEM runtimes ${compiler_rt_path}) +- if(NOT DEFINED LLVM_BUILD_COMPILER_RT OR LLVM_BUILD_COMPILER_RT) +- list(INSERT runtimes 0 ${compiler_rt_path}) +- endif() +-endif() +- +-# Setting these variables will allow the sub-build to put their outputs into +-# the library and bin directories of the top-level build. +-set(LLVM_LIBRARY_OUTPUT_INTDIR ${LLVM_LIBRARY_DIR}) +-set(LLVM_RUNTIME_OUTPUT_INTDIR ${LLVM_TOOLS_BINARY_DIR}) +- +-# This variable makes sure that e.g. llvm-lit is found. +-set(LLVM_MAIN_SRC_DIR ${LLVM_BUILD_MAIN_SRC_DIR}) +-set(LLVM_CMAKE_PATH ${LLVM_MAIN_SRC_DIR}/cmake/modules) +- +-# This variable is used by individual runtimes to locate LLVM files. +-set(LLVM_PATH ${LLVM_BUILD_MAIN_SRC_DIR}) +- +-if(APPLE) +- set(LLVM_ENABLE_LIBCXX ON CACHE BOOL "") +-endif() +- +-include(CheckLibraryExists) +-include(CheckCCompilerFlag) +- +-# Disable use of the installed C++ standard library when building runtimes. If +-# MSVC is true, we must be using the clang-cl driver, which doesn't understand +-# these flags. +-if (NOT MSVC) +- set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -nostdinc++ -nostdlib++") +- +- if (LLVM_EXTERNAL_LIBCXX_SOURCE_DIR AND "libcxx" IN_LIST LLVM_ENABLE_RUNTIMES) +- set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -isystem ${LLVM_EXTERNAL_LIBCXX_SOURCE_DIR}/include") +- endif() +-endif() +- +-# Avoid checking whether the compiler is working. +-set(LLVM_COMPILER_CHECKED ON) +- +-# Handle common options used by all runtimes. +-include(AddLLVM) +-include(HandleLLVMOptions) +-include(FindPythonInterp) +- +-# Remove the -nostdlib++ option we've added earlier. +-string(REPLACE "-nostdlib++" "" CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") +- +-# Use libtool instead of ar if you are both on an Apple host, and targeting Apple. +-if(CMAKE_HOST_APPLE AND APPLE) +- include(UseLibtool) +-endif() +- +-# This can be used to detect whether we're in the runtimes build. +-set(RUNTIMES_BUILD ON) +- +-foreach(entry ${runtimes}) +- get_filename_component(projName ${entry} NAME) +- +- # TODO: Clean this up as part of an interface standardization +- string(REPLACE "-" "_" canon_name ${projName}) +- string(TOUPPER ${canon_name} canon_name) +- +- # The subdirectories need to treat this as standalone builds. D57992 tried +- # to get rid of this, but the runtimes treat *_STANDALONE_BUILD=OFF as if +- # llvm & clang are configured in the same CMake, and setup dependencies +- # against their targets. OpenMP has fixed the issue so we don't set the +- # variable. +- if (NOT ${canon_name} STREQUAL "OPENMP") +- set(${canon_name}_STANDALONE_BUILD ON) +- endif() +- +- if(LLVM_RUNTIMES_LIBDIR_SUBDIR) +- set(${canon_name}_LIBDIR_SUBDIR "${LLVM_RUNTIMES_LIBDIR_SUBDIR}" CACHE STRING "" FORCE) +- endif() +- +- # Setting a variable to let sub-projects detect which other projects +- # will be included under here. +- set(HAVE_${canon_name} ON) +-endforeach() +- +-# We do this in two loops so that HAVE_* is set for each runtime before the +-# other runtimes are added. +-foreach(entry ${runtimes}) +- get_filename_component(projName ${entry} NAME) +- +- # Between each sub-project we want to cache and clear the LIT properties +- set_property(GLOBAL PROPERTY LLVM_LIT_TESTSUITES) +- set_property(GLOBAL PROPERTY LLVM_LIT_PARAMS) +- set_property(GLOBAL PROPERTY LLVM_LIT_DEPENDS) +- set_property(GLOBAL PROPERTY LLVM_LIT_EXTRA_ARGS) +- +- add_subdirectory(${entry} ${projName}) +- +- get_property(LLVM_LIT_TESTSUITES GLOBAL PROPERTY LLVM_LIT_TESTSUITES) +- get_property(LLVM_LIT_PARAMS GLOBAL PROPERTY LLVM_LIT_PARAMS) +- get_property(LLVM_LIT_DEPENDS GLOBAL PROPERTY LLVM_LIT_DEPENDS) +- get_property(LLVM_LIT_EXTRA_ARGS GLOBAL PROPERTY LLVM_LIT_EXTRA_ARGS) +- +- list(APPEND RUNTIMES_LIT_TESTSUITES ${LLVM_LIT_TESTSUITES}) +- list(APPEND RUNTIMES_LIT_PARAMS ${LLVM_LIT_PARAMS}) +- list(APPEND RUNTIMES_LIT_DEPENDS ${LLVM_LIT_DEPENDS}) +- list(APPEND RUNTIMES_LIT_EXTRA_ARGS ${LLVM_LIT_EXTRA_ARGS}) +-endforeach() +- +-if(LLVM_INCLUDE_TESTS) +- # Add a global check rule now that all subdirectories have been traversed +- # and we know the total set of lit testsuites. +- +- add_lit_target(check-runtimes +- "Running all regression tests" +- ${RUNTIMES_LIT_TESTSUITES} +- PARAMS ${RUNTIMES_LIT_PARAMS} +- DEPENDS ${RUNTIMES_LIT_DEPENDS} +- ARGS ${RUNTIMES_LIT_EXTRA_ARGS} +- ) +- add_custom_target(runtimes-test-depends DEPENDS ${RUNTIMES_LIT_DEPENDS}) +-endif() +- +-get_property(SUB_COMPONENTS GLOBAL PROPERTY SUB_COMPONENTS) +-if(SUB_COMPONENTS) +- list(REMOVE_DUPLICATES SUB_COMPONENTS) +- foreach(component ${SUB_COMPONENTS}) +- if(NOT TARGET ${component}) +- message(SEND_ERROR "Missing target for runtime component ${component}!") +- continue() +- endif() +- +- if(TARGET check-${component}) +- list(APPEND SUB_CHECK_TARGETS check-${component}) +- endif() +- +- if(TARGET install-${component}) +- list(APPEND SUB_INSTALL_TARGETS install-${component}) +- endif() +- if(TARGET install-${component}-stripped) +- list(APPEND SUB_INSTALL_TARGETS install-${component}-stripped) +- endif() +- endforeach() +- +- if(LLVM_RUNTIMES_TARGET) +- configure_file( +- ${CMAKE_CURRENT_SOURCE_DIR}/Components.cmake.in +- ${LLVM_BINARY_DIR}/runtimes/${LLVM_RUNTIMES_TARGET}/Components.cmake) +- else() +- configure_file( +- ${CMAKE_CURRENT_SOURCE_DIR}/Components.cmake.in +- ${LLVM_BINARY_DIR}/runtimes/Components.cmake) +- endif() +-endif() diff --git a/build/build-clang/revert-llvmorg-13-init-7827-g2a078c307204.patch b/build/build-clang/revert-llvmorg-13-init-7827-g2a078c307204.patch deleted file mode 100644 index b8df15f06eb0..000000000000 --- a/build/build-clang/revert-llvmorg-13-init-7827-g2a078c307204.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp -index 368fc87dc801..96c2388d776e 100644 ---- a/llvm/lib/IR/Attributes.cpp -+++ b/llvm/lib/IR/Attributes.cpp -@@ -1902,7 +1902,6 @@ AttrBuilder AttributeFuncs::typeIncompatible(Type *Ty) { - .addAttribute(Attribute::ReadNone) - .addAttribute(Attribute::ReadOnly) - .addAttribute(Attribute::SwiftError) -- .addAlignmentAttr(1) // the int here is ignored - .addDereferenceableAttr(1) // the int here is ignored - .addDereferenceableOrNullAttr(1) // the int here is ignored - .addPreallocatedAttr(Ty) diff --git a/build/build-clang/revert-r362047-and-r362065_clang_12.patch b/build/build-clang/revert-r362047-and-r362065_clang_12.patch new file mode 100644 index 000000000000..881ffed4be5e --- /dev/null +++ b/build/build-clang/revert-r362047-and-r362065_clang_12.patch @@ -0,0 +1,68 @@ +Bisection found that r362047 (and its followup build fix r362065) cause the +build to install the android PGO library into the following location: +stage2/clang/lib/linux/libclang_rt.profile-arm-android.a +rather than the expected: +stage2/clang/lib64/clang/$VERSION/lib/linux/libclang_rt.profile-arm-android.a + +For lack of any progress in debugging this, revert those two patches. + +diff --git a/llvm/runtimes/CMakeLists.txt b/llvm/runtimes/CMakeLists.txt +index d2f5d6bf80f0..424f4da01f77 100644 +--- a/llvm/runtimes/CMakeLists.txt ++++ b/llvm/runtimes/CMakeLists.txt +@@ -59,7 +59,6 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}) + cmake_minimum_required(VERSION 3.13.4) + project(Runtimes C CXX ASM) + +- find_package(LLVM PATHS "${LLVM_BINARY_DIR}" NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) + find_package(Clang PATHS "${LLVM_BINARY_DIR}" NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) + + # Add the root project's CMake modules, and the LLVM build's modules to the +@@ -67,6 +66,7 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}) + list(INSERT CMAKE_MODULE_PATH 0 + "${CMAKE_CURRENT_SOURCE_DIR}/../cmake" + "${CMAKE_CURRENT_SOURCE_DIR}/../cmake/modules" ++ "${LLVM_LIBRARY_DIR}/cmake/llvm" + ) + + # Some of the runtimes will conditionally use the compiler-rt sanitizers +@@ -81,6 +81,11 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}) + endif() + endif() + ++ # LLVMConfig.cmake contains a bunch of CMake variables from the LLVM build. ++ # This file is installed as part of LLVM distributions, so this can be used ++ # either from a build directory or an installed LLVM. ++ include(LLVMConfig) ++ + # Setting these variables will allow the sub-build to put their outputs into + # the library and bin directories of the top-level build. + set(LLVM_LIBRARY_OUTPUT_INTDIR ${LLVM_LIBRARY_DIR}) +@@ -90,9 +95,6 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}) + set(LLVM_MAIN_SRC_DIR ${LLVM_BUILD_MAIN_SRC_DIR}) + set(LLVM_CMAKE_PATH ${LLVM_MAIN_SRC_DIR}/cmake/modules) + +- # This variable is used by individual runtimes to locate LLVM files. +- set(LLVM_PATH ${LLVM_BUILD_MAIN_SRC_DIR}) +- + if(APPLE) + set(LLVM_ENABLE_LIBCXX ON CACHE BOOL "") + endif() +@@ -421,6 +423,8 @@ ${error} Set RUNTIMES_BUILD_ALLOW_DARWIN to allow a single darwin triple.") + # Builtins were built separately above + CMAKE_ARGS -DCOMPILER_RT_BUILD_BUILTINS=Off + -DLLVM_INCLUDE_TESTS=${LLVM_INCLUDE_TESTS} ++ -DLLVM_BINARY_DIR=${LLVM_BINARY_DIR} ++ -DLLVM_LIBRARY_DIR=${LLVM_LIBRARY_DIR} + -DLLVM_DEFAULT_TARGET_TRIPLE=${TARGET_TRIPLE} + -DLLVM_ENABLE_PROJECTS_USED=${LLVM_ENABLE_PROJECTS_USED} + -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=${LLVM_ENABLE_PER_TARGET_RUNTIME_DIR_default} +@@ -527,6 +531,8 @@ ${error} Set RUNTIMES_BUILD_ALLOW_DARWIN to allow a single darwin triple.") + # Builtins were built separately above + CMAKE_ARGS -DCOMPILER_RT_BUILD_BUILTINS=Off + -DLLVM_INCLUDE_TESTS=${LLVM_INCLUDE_TESTS} ++ -DLLVM_BINARY_DIR=${LLVM_BINARY_DIR} ++ -DLLVM_LIBRARY_DIR=${LLVM_LIBRARY_DIR} + -DLLVM_DEFAULT_TARGET_TRIPLE=${target} + -DLLVM_ENABLE_PROJECTS_USED=${LLVM_ENABLE_PROJECTS_USED} + -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON diff --git a/mobile/android/config/mozconfigs/common b/mobile/android/config/mozconfigs/common index a9d704370fb0..895d3386a930 100644 --- a/mobile/android/config/mozconfigs/common +++ b/mobile/android/config/mozconfigs/common @@ -40,9 +40,4 @@ fi # Package js shell. export MOZ_PACKAGE_JSSHELL=1 -if [ -d "$MOZ_FETCHES_DIR/binutils/bin" ]; then - mk_add_options "export PATH=$MOZ_FETCHES_DIR/binutils/bin:$PATH" - export LDFLAGS="$LDFLAGS -B $MOZ_FETCHES_DIR/binutils/bin" -fi - JS_BINARY="$topsrcdir/mobile/android/config/js_wrapper.sh" diff --git a/taskcluster/ci/fetch/toolchains.yml b/taskcluster/ci/fetch/toolchains.yml index 7770bdb8d2b8..6be5cef8a527 100644 --- a/taskcluster/ci/fetch/toolchains.yml +++ b/taskcluster/ci/fetch/toolchains.yml @@ -380,13 +380,6 @@ clang-12: repo: https://github.com/llvm/llvm-project revision: fed41342a82f5a3a9201819a82bf7a48313e296b -clang-13: - description: clang 13.0.0 source code - fetch: - type: git - repo: https://github.com/llvm/llvm-project - revision: d7b669b3a30345cfcdb2fde2af6f48aa4b94845d - clang-trunk: description: clang main branch source code attributes: diff --git a/taskcluster/ci/instrumented-build/kind.yml b/taskcluster/ci/instrumented-build/kind.yml index 6337bcc64ee5..0e6eb28b2b83 100644 --- a/taskcluster/ci/instrumented-build/kind.yml +++ b/taskcluster/ci/instrumented-build/kind.yml @@ -169,8 +169,6 @@ jobs: - android-gradle-dependencies - android-ndk-linux - android-sdk-linux - # Workaround issues in binutils from the ndk with the compiler-rt from clang-13 - - linux64-binutils - linux64-clang-android-cross - linux64-rust-android - linux64-rust-size diff --git a/taskcluster/ci/spidermonkey/linux.yml b/taskcluster/ci/spidermonkey/linux.yml index aaa7c82b5bbd..7ba9e3d06f1f 100644 --- a/taskcluster/ci/spidermonkey/linux.yml +++ b/taskcluster/ci/spidermonkey/linux.yml @@ -430,9 +430,7 @@ sm-fuzzing-linux64/opt: spidermonkey-variant: fuzzing fetches: toolchain: - # Keep this with clang-12 until we move to rust 1.56 that uses the same - # LLVM-13 backend as clang-13 - - linux64-clang-12 + - linux64-clang - linux64-rust - linux64-cbindgen - linux64-dump_syms diff --git a/taskcluster/ci/toolchain/cbindgen.yml b/taskcluster/ci/toolchain/cbindgen.yml index c142a9dd6f90..4bf6d57000b2 100644 --- a/taskcluster/ci/toolchain/cbindgen.yml +++ b/taskcluster/ci/toolchain/cbindgen.yml @@ -28,7 +28,7 @@ linux64-cbindgen: arguments: ['x86_64-unknown-linux-gnu'] fetches: toolchain: - - linux64-clang-13 + - linux64-clang-12 - linux64-rust-1.47 - sysroot-x86_64-linux-gnu @@ -39,8 +39,8 @@ macosx64-cbindgen: arguments: ['x86_64-apple-darwin'] fetches: toolchain: - - linux64-cctools-port-clang-13 - - linux64-clang-13 + - linux64-cctools-port-clang-12 + - linux64-clang-12 - linux64-rust-macos-1.47 - macosx64-sdk-11.0 @@ -51,8 +51,8 @@ macosx64-aarch64-cbindgen: arguments: ['aarch64-apple-darwin'] fetches: toolchain: - - linux64-cctools-port-clang-13 - - linux64-clang-13 + - linux64-cctools-port-clang-12 + - linux64-clang-12 - linux64-rust-macos-1.49 - macosx64-sdk-11.0 diff --git a/taskcluster/ci/toolchain/cctools-port.yml b/taskcluster/ci/toolchain/cctools-port.yml index 20dfe24be472..9e6afda48803 100644 --- a/taskcluster/ci/toolchain/cctools-port.yml +++ b/taskcluster/ci/toolchain/cctools-port.yml @@ -13,15 +13,15 @@ job-defaults: - libtapi - ldid -linux64-cctools-port-clang-13: +linux64-cctools-port-clang-12: treeherder: - symbol: TL(cctools-clang-13) + symbol: TL(cctools-clang-12) run: script: build-cctools-port.sh toolchain-alias: linux64-cctools-port toolchain-artifact: public/build/cctools.tar.zst fetches: toolchain: - - linux64-clang-13 + - linux64-clang-12 - linux64-binutils - linux64-toolchain-sysroot diff --git a/taskcluster/ci/toolchain/clang-tidy.yml b/taskcluster/ci/toolchain/clang-tidy.yml index 06394193564f..dac5f3d24d84 100644 --- a/taskcluster/ci/toolchain/clang-tidy.yml +++ b/taskcluster/ci/toolchain/clang-tidy.yml @@ -23,7 +23,7 @@ job-defaults: - 'build/build-clang/build-clang.py' fetches: fetch: - - clang-13 + - clang-12 linux64-clang-tidy: index: @@ -40,7 +40,7 @@ linux64-clang-tidy: - trunk fetches: toolchain: - - linux64-clang-13 + - linux64-clang-12 - linux64-toolchain-sysroot macosx64-clang-tidy: @@ -59,8 +59,8 @@ macosx64-clang-tidy: - trunk fetches: toolchain: - - linux64-cctools-port-clang-13 - - linux64-clang-13-macosx-cross + - linux64-cctools-port-clang-12 + - linux64-clang-12-macosx-cross - macosx64-sdk-11.0 macosx64-arch64-clang-tidy: @@ -82,8 +82,8 @@ macosx64-arch64-clang-tidy: - trunk fetches: toolchain: - - linux64-cctools-port-clang-13 - - linux64-clang-13-macosx-cross + - linux64-cctools-port-clang-12 + - linux64-clang-12-macosx-cross - macosx64-sdk-11.0 win64-clang-tidy: @@ -136,5 +136,5 @@ linux64-clang-tidy-external: fetch: - civet-source toolchain: - - linux64-clang-13 + - linux64-clang-12 - linux64-toolchain-sysroot diff --git a/taskcluster/ci/toolchain/clang.yml b/taskcluster/ci/toolchain/clang.yml index 6ff87c563984..cf344aaabfc2 100644 --- a/taskcluster/ci/toolchain/clang.yml +++ b/taskcluster/ci/toolchain/clang.yml @@ -46,8 +46,8 @@ linux64-clang-7: toolchain: - linux64-toolchain-sysroot -linux64-clang-13-mingw-x86: - description: "MinGW-Clang 13 x86 toolchain build" +linux64-clang-12-mingw-x86: + description: "MinGW-Clang 12 x86 toolchain build" treeherder: symbol: TMW(clang-x86) worker-type: b-linux @@ -59,16 +59,16 @@ linux64-clang-13-mingw-x86: toolchain-artifact: public/build/clangmingw.tar.zst fetches: fetch: - - clang-13 + - clang-12 - mingw-w64 - libunwind - llvm-mingw - gcc-9.3.0 toolchain: - - linux64-clang-13 + - linux64-clang-12 -linux64-clang-13-mingw-x64: - description: "MinGW-Clang 13 x64 toolchain build" +linux64-clang-12-mingw-x64: + description: "MinGW-Clang 12 x64 toolchain build" treeherder: symbol: TMW(clang-x64) tier: 1 @@ -81,13 +81,13 @@ linux64-clang-13-mingw-x64: toolchain-artifact: public/build/clangmingw.tar.zst fetches: fetch: - - clang-13 + - clang-12 - mingw-w64 - libunwind - llvm-mingw - gcc-9.3.0 toolchain: - - linux64-clang-13 + - linux64-clang-12 linux64-clang-10: description: "Clang 10 toolchain build" @@ -144,40 +144,19 @@ linux64-clang-12: - 'build/build-clang/clang-12-linux64.json' resources: - 'build/build-clang/clang-12-linux64.json' + toolchain-alias: linux64-clang toolchain-artifact: public/build/clang.tar.zst fetches: fetch: - clang-12 toolchain: - linux64-toolchain-sysroot + - wasm32-wasi-compiler-rt-12 -linux64-clang-13: - description: "Clang 13 toolchain build" - attributes: - local-toolchain: true +linux64-clang-12-android-cross: + description: "Clang 12 toolchain build" treeherder: - symbol: TL(clang13) - run-on-projects: [trunk] - run: - using: toolchain-script - script: build-clang.sh - arguments: - - 'build/build-clang/clang-13-linux64.json' - resources: - - 'build/build-clang/clang-13-linux64.json' - toolchain-alias: linux64-clang - toolchain-artifact: public/build/clang.tar.zst - fetches: - fetch: - - clang-13 - toolchain: - - linux64-toolchain-sysroot - - wasm32-wasi-compiler-rt-13 - -linux64-clang-13-android-cross: - description: "Clang 13 toolchain build" - treeherder: - symbol: TL(clang13-android) + symbol: TL(clang12-android) run: using: toolchain-script script: repack-clang-linux-cross.sh @@ -189,30 +168,30 @@ linux64-clang-13-android-cross: 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 + android-aarch64-compiler-rt-12: toolchain-android-aarch64-compiler-rt-12 + android-arm-compiler-rt-12: toolchain-android-arm-compiler-rt-12 + android-x86-compiler-rt-12: toolchain-android-x86-compiler-rt-12 + android-x64-compiler-rt-12: toolchain-android-x64-compiler-rt-12 fetches: toolchain: - - linux64-clang-13 - android-aarch64-compiler-rt-13: + - linux64-clang-12 + android-aarch64-compiler-rt-12: - artifact: compiler-rt.tar.zst dest: aarch64 - android-arm-compiler-rt-13: + android-arm-compiler-rt-12: - artifact: compiler-rt.tar.zst dest: arm - android-x86-compiler-rt-13: + android-x86-compiler-rt-12: - artifact: compiler-rt.tar.zst dest: x86 - android-x64-compiler-rt-13: + android-x64-compiler-rt-12: - artifact: compiler-rt.tar.zst dest: x64 -linux64-clang-13-aarch64-cross: - description: "Clang 13 toolchain build with aarch64 runtime" +linux64-clang-12-aarch64-cross: + description: "Clang 12 toolchain build with aarch64 runtime" treeherder: - symbol: TL(clang13-aarch64) + symbol: TL(clang12-aarch64) worker-type: b-linux worker: max-run-time: 600 @@ -221,17 +200,17 @@ linux64-clang-13-aarch64-cross: 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 + linux64-aarch64-compiler-rt-12: toolchain-linux64-aarch64-compiler-rt-12 fetches: toolchain: - - linux64-clang-13 - linux64-aarch64-compiler-rt-13: + - linux64-clang-12 + linux64-aarch64-compiler-rt-12: - artifact: compiler-rt.tar.zst -linux64-clang-13-macosx-cross: - description: "Clang 13 toolchain repack with MacOS Compiler RT libs" +linux64-clang-12-macosx-cross: + description: "Clang 12 toolchain repack with MacOS Compiler RT libs" treeherder: - symbol: TL(clang13-macosx-cross) + symbol: TL(clang12-macosx-cross) worker-type: b-linux worker: max-run-time: 600 @@ -240,23 +219,23 @@ linux64-clang-13-macosx-cross: 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 + macosx64-aarch64-compiler-rt-12: toolchain-macosx64-aarch64-compiler-rt-12 + macosx64-x64-compiler-rt-12: toolchain-macosx64-x64-compiler-rt-12 fetches: toolchain: - - linux64-cctools-port-clang-13 - - linux64-clang-13 - macosx64-aarch64-compiler-rt-13: + - linux64-cctools-port-clang-12 + - linux64-clang-12 + macosx64-aarch64-compiler-rt-12: - artifact: compiler-rt.tar.zst dest: aarch64 - macosx64-x64-compiler-rt-13: + macosx64-x64-compiler-rt-12: - artifact: compiler-rt.tar.zst dest: x86_64 -linux64-clang-13-win-cross: - description: "Clang 13 toolchain repack with Windows Compiler RT libs" +linux64-clang-12-win-cross: + description: "Clang 12 toolchain repack with Windows Compiler RT libs" treeherder: - symbol: TL(clang13-win-cross) + symbol: TL(clang12-win-cross) worker-type: b-linux worker: max-run-time: 600 @@ -265,22 +244,22 @@ linux64-clang-13-win-cross: toolchain-alias: linux64-clang-win-cross toolchain-artifact: public/build/clang.tar.zst dependencies: - win64-clang-13-2stage: toolchain-win64-clang-13-2stage + win64-clang-12-2stage: toolchain-win64-clang-12-2stage fetches: toolchain: - - linux64-clang-13 - win64-clang-13-2stage: + - linux64-clang-12 + win64-clang-12-2stage: # Put this into a new directory so it doesn't conflict with the linux toolchain - artifact: clang.tar.zst dest: clang-cl extract: false -macosx64-clang-13: - description: "Clang 13 toolchain build" +macosx64-clang-12: + description: "Clang 12 toolchain build" attributes: local-toolchain: true treeherder: - symbol: TM(clang-13) + symbol: TM(clang-12) worker-type: b-linux-large worker: max-run-time: 3600 @@ -289,26 +268,26 @@ macosx64-clang-13: run: script: build-clang.sh arguments: - - 'build/build-clang/clang-13-macosx64.json' + - 'build/build-clang/clang-12-macosx64.json' resources: - - 'build/build-clang/clang-13-macosx64.json' + - 'build/build-clang/clang-12-macosx64.json' toolchain-alias: macosx64-clang toolchain-artifact: public/build/clang.tar.zst fetches: fetch: - - clang-13 + - clang-12 toolchain: - - linux64-cctools-port-clang-13 - - linux64-clang-13-macosx-cross + - linux64-cctools-port-clang-12 + - linux64-clang-12-macosx-cross - macosx64-sdk-11.0 - - wasm32-wasi-compiler-rt-13 + - wasm32-wasi-compiler-rt-12 -macosx64-aarch64-clang-13: - description: "Clang 13 toolchain build" +macosx64-aarch64-clang-12: + description: "Clang 12 toolchain build" attributes: local-toolchain: true treeherder: - symbol: TM(clang-13-aarch64) + symbol: TM(clang-12-aarch64) worker-type: b-linux-large worker: env: @@ -319,26 +298,26 @@ macosx64-aarch64-clang-13: run: script: build-clang.sh arguments: - - 'build/build-clang/clang-13-macosx64.json' + - 'build/build-clang/clang-12-macosx64.json' resources: - - 'build/build-clang/clang-13-macosx64.json' + - 'build/build-clang/clang-12-macosx64.json' toolchain-alias: macosx64-aarch64-clang toolchain-artifact: public/build/clang.tar.zst fetches: fetch: - - clang-13 + - clang-12 toolchain: - - linux64-cctools-port-clang-13 - - linux64-clang-13-macosx-cross + - linux64-cctools-port-clang-12 + - linux64-clang-12-macosx-cross - macosx64-sdk-11.0 - - wasm32-wasi-compiler-rt-13 + - wasm32-wasi-compiler-rt-12 -win64-clang-13: - description: "Clang-cl 13 toolchain build" +win64-clang-12: + description: "Clang-cl 12 toolchain build" attributes: local-toolchain: true treeherder: - symbol: TW64(clang-13) + symbol: TW64(clang-12) worker-type: b-win2012 worker: env: @@ -349,25 +328,25 @@ win64-clang-13: run: script: build-clang.sh arguments: - - 'build/build-clang/clang-13-win64.json' + - 'build/build-clang/clang-12-win64.json' resources: - - 'build/build-clang/clang-13-win64.json' + - 'build/build-clang/clang-12-win64.json' - 'taskcluster/scripts/misc/tooltool-download.sh' toolchain-alias: win64-clang toolchain-artifact: public/build/clang.tar.zst tooltool-downloads: internal fetches: fetch: - - clang-13 + - clang-12 - cmake - ninja toolchain: - - wasm32-wasi-compiler-rt-13 + - wasm32-wasi-compiler-rt-12 -win64-clang-13-2stage: - description: "Clang-cl 13 toolchain 2-stage quick build" +win64-clang-12-2stage: + description: "Clang-cl 12 toolchain 2-stage quick build" treeherder: - symbol: TW64(clang-13-2stage) + symbol: TW64(clang-12-2stage) worker-type: b-win2012 worker: env: @@ -375,15 +354,15 @@ win64-clang-13-2stage: run: script: build-clang.sh arguments: - - 'build/build-clang/clang-13-win64-2stage.json' + - 'build/build-clang/clang-12-win64-2stage.json' resources: - - 'build/build-clang/clang-13-win64-2stage.json' + - 'build/build-clang/clang-12-win64-2stage.json' - 'taskcluster/scripts/misc/tooltool-download.sh' toolchain-alias: win64-clang-2stage toolchain-artifact: public/build/clang.tar.zst tooltool-downloads: internal fetches: fetch: - - clang-13 + - clang-12 - cmake - ninja diff --git a/taskcluster/ci/toolchain/compiler-rt.yml b/taskcluster/ci/toolchain/compiler-rt.yml index b90495d30ac7..dc0b062d7c8e 100644 --- a/taskcluster/ci/toolchain/compiler-rt.yml +++ b/taskcluster/ci/toolchain/compiler-rt.yml @@ -11,10 +11,10 @@ job-defaults: 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" +android-aarch64-compiler-rt-12: + description: "android aarch64 Compiler-rt for Clang 12 toolchain build" treeherder: - symbol: TA(aarch64-crt-13) + symbol: TA(aarch64-crt-12) run: arguments: - aarch64-linux-android @@ -23,15 +23,15 @@ android-aarch64-compiler-rt-13: - 'build/build-clang/find_symbolizer_linux_clang_10.patch' fetches: fetch: - - clang-13 + - clang-12 toolchain: - - linux64-clang-13 + - linux64-clang-12 - linux64-android-ndk-linux-repack -android-arm-compiler-rt-13: - description: "android arm Compiler-rt for Clang 13 toolchain build" +android-arm-compiler-rt-12: + description: "android arm Compiler-rt for Clang 12 toolchain build" treeherder: - symbol: TA(arm-crt-13) + symbol: TA(arm-crt-12) run: arguments: - armv7-linux-android @@ -40,15 +40,15 @@ android-arm-compiler-rt-13: - 'build/build-clang/find_symbolizer_linux_clang_10.patch' fetches: fetch: - - clang-13 + - clang-12 toolchain: - - linux64-clang-13 + - linux64-clang-12 - linux64-android-ndk-linux-repack -android-x86-compiler-rt-13: - description: "android x86 Compiler-rt for Clang 13 toolchain build" +android-x86-compiler-rt-12: + description: "android x86 Compiler-rt for Clang 12 toolchain build" treeherder: - symbol: TA(x86-crt-13) + symbol: TA(x86-crt-12) run: arguments: - i686-linux-android @@ -57,15 +57,15 @@ android-x86-compiler-rt-13: - 'build/build-clang/find_symbolizer_linux_clang_10.patch' fetches: fetch: - - clang-13 + - clang-12 toolchain: - - linux64-clang-13 + - linux64-clang-12 - linux64-android-ndk-linux-repack -android-x64-compiler-rt-13: - description: "android x64 Compiler-rt for Clang 13 toolchain build" +android-x64-compiler-rt-12: + description: "android x64 Compiler-rt for Clang 12 toolchain build" treeherder: - symbol: TA(x64-crt-13) + symbol: TA(x64-crt-12) run: arguments: - x86_64-linux-android @@ -74,15 +74,15 @@ android-x64-compiler-rt-13: - 'build/build-clang/find_symbolizer_linux_clang_10.patch' fetches: fetch: - - clang-13 + - clang-12 toolchain: - - linux64-clang-13 + - linux64-clang-12 - linux64-android-ndk-linux-repack -linux64-aarch64-compiler-rt-13: - description: "Linux aarch64 Compiler-rt for Clang 13 toolchain build" +linux64-aarch64-compiler-rt-12: + description: "Linux aarch64 Compiler-rt for Clang 12 toolchain build" treeherder: - symbol: TL(aarch64-crt-13) + symbol: TL(aarch64-crt-12) run: arguments: - aarch64-unknown-linux-gnu @@ -91,53 +91,53 @@ linux64-aarch64-compiler-rt-13: - 'build/build-clang/find_symbolizer_linux_clang_10.patch' fetches: fetch: - - clang-13 + - clang-12 toolchain: - linux64-binutils - - linux64-clang-13 + - linux64-clang-12 - sysroot-aarch64-linux-gnu -macosx64-x64-compiler-rt-13: - description: "macOS x64 Compiler-rt for Clang 13 toolchain build" +macosx64-x64-compiler-rt-12: + description: "macOS x64 Compiler-rt for Clang 12 toolchain build" treeherder: - symbol: TM(x64-crt-13) + symbol: TM(x64-crt-12) run: arguments: - x86_64-apple-darwin fetches: fetch: - - clang-13 + - clang-12 toolchain: - - linux64-cctools-port-clang-13 - - linux64-clang-13 + - linux64-cctools-port-clang-12 + - linux64-clang-12 - macosx64-sdk-11.0 -macosx64-aarch64-compiler-rt-13: - description: "macOS aarch64 Compiler-rt for Clang 13 toolchain build" +macosx64-aarch64-compiler-rt-12: + description: "macOS aarch64 Compiler-rt for Clang 12 toolchain build" treeherder: - symbol: TM(aarch64-crt-13) + symbol: TM(aarch64-crt-12) run: arguments: - aarch64-apple-darwin fetches: fetch: - - clang-13 + - clang-12 toolchain: - - linux64-cctools-port-clang-13 - - linux64-clang-13 + - linux64-cctools-port-clang-12 + - linux64-clang-12 - macosx64-sdk-11.0 -wasm32-wasi-compiler-rt-13: - description: "wasm32-wasi Compiler-rt for Clang 13 toolchain build" +wasm32-wasi-compiler-rt-12: + description: "wasm32-wasi Compiler-rt for Clang 12 toolchain build" treeherder: - symbol: TL(wasi-crt-13) + symbol: TL(wasi-crt-12) worker-type: b-linux-xlarge run: script: build-compiler-rt-wasi.sh toolchain-alias: wasm32-wasi-compiler-rt fetches: fetch: - - clang-13 + - clang-12 - wasi-sdk wasm32-wasi-compiler-rt-10: diff --git a/taskcluster/ci/toolchain/dump-syms.yml b/taskcluster/ci/toolchain/dump-syms.yml index 640d2fda2247..7e119661167c 100644 --- a/taskcluster/ci/toolchain/dump-syms.yml +++ b/taskcluster/ci/toolchain/dump-syms.yml @@ -24,7 +24,7 @@ linux64-dump_syms: fetches: toolchain: - linux64-binutils - - linux64-clang-13 + - linux64-clang-12 - linux64-rust-1.55 - sysroot-x86_64-linux-gnu @@ -38,8 +38,8 @@ macosx64-dump_syms: fetches: toolchain: - linux64-rust-macos-1.55 - - linux64-clang-13 - - linux64-cctools-port-clang-13 + - linux64-clang-12 + - linux64-cctools-port-clang-12 - macosx64-sdk-11.0 macosx64-aarch64-dump_syms: @@ -52,8 +52,8 @@ macosx64-aarch64-dump_syms: fetches: toolchain: - linux64-rust-macos-1.55 - - linux64-clang-13 - - linux64-cctools-port-clang-13 + - linux64-clang-12 + - linux64-cctools-port-clang-12 - macosx64-sdk-11.0 win64-dump_syms: diff --git a/taskcluster/ci/toolchain/fix-stacks.yml b/taskcluster/ci/toolchain/fix-stacks.yml index 35732747dd6e..788869853971 100644 --- a/taskcluster/ci/toolchain/fix-stacks.yml +++ b/taskcluster/ci/toolchain/fix-stacks.yml @@ -26,7 +26,7 @@ linux64-fix-stacks: fetches: toolchain: - linux64-binutils - - linux64-clang-13 + - linux64-clang-12 - linux64-rust-1.47 - sysroot-x86_64-linux-gnu @@ -38,8 +38,8 @@ macosx64-fix-stacks: toolchain-artifact: public/build/fix-stacks.tar.zst fetches: toolchain: - - linux64-cctools-port-clang-13 - - linux64-clang-13 + - linux64-cctools-port-clang-12 + - linux64-clang-12 - linux64-rust-macos-1.47 - macosx64-sdk-11.0 @@ -51,8 +51,8 @@ macosx64-aarch64-fix-stacks: toolchain-artifact: public/build/fix-stacks.tar.zst fetches: toolchain: - - linux64-cctools-port-clang-13 - - linux64-clang-13 + - linux64-cctools-port-clang-12 + - linux64-clang-12 - linux64-rust-macos-1.49 - macosx64-sdk-11.0 @@ -70,6 +70,6 @@ win32-fix-stacks: tooltool-downloads: internal fetches: toolchain: - - linux64-clang-13 + - linux64-clang-12 - linux64-liblowercase - linux64-rust-windows-1.47 diff --git a/taskcluster/ci/toolchain/gn.yml b/taskcluster/ci/toolchain/gn.yml index 12c79ff51f92..ab2df50db8c1 100644 --- a/taskcluster/ci/toolchain/gn.yml +++ b/taskcluster/ci/toolchain/gn.yml @@ -30,8 +30,8 @@ macosx64-gn: script: build-gn-macosx.sh fetches: toolchain: - - linux64-cctools-port-clang-13 - - linux64-clang-13 + - linux64-cctools-port-clang-12 + - linux64-clang-12 - macosx64-sdk-11.0 win32-gn: diff --git a/taskcluster/ci/toolchain/minidump_stackwalk.yml b/taskcluster/ci/toolchain/minidump_stackwalk.yml index db3d4cb7394e..8f0455400845 100644 --- a/taskcluster/ci/toolchain/minidump_stackwalk.yml +++ b/taskcluster/ci/toolchain/minidump_stackwalk.yml @@ -28,7 +28,7 @@ linux64-minidump-stackwalk: symbol: TL(stackwalk) fetches: toolchain: - - linux64-clang-13 + - linux64-clang-12 - linux64-binutils - linux64-rust-1.53 - linux64-toolchain-sysroot @@ -40,8 +40,8 @@ macosx64-minidump-stackwalk: arguments: ['macosx64'] fetches: toolchain: - - linux64-cctools-port-clang-13 - - linux64-clang-13 + - linux64-cctools-port-clang-12 + - linux64-clang-12 - linux64-rust-macos-1.53 - macosx64-sdk-11.0 @@ -52,8 +52,8 @@ macosx64-aarch64-minidump-stackwalk: arguments: ['macosx64-aarch64'] fetches: toolchain: - - linux64-cctools-port-clang-13 - - linux64-clang-13 + - linux64-cctools-port-clang-12 + - linux64-clang-12 - linux64-rust-macos-1.53 - macosx64-sdk-11.0 @@ -76,6 +76,6 @@ linux64-breakpad-injector: symbol: TL(injector) fetches: toolchain: - - linux64-clang-13 + - linux64-clang-12 - linux64-binutils - linux64-toolchain-sysroot diff --git a/taskcluster/ci/toolchain/misc.yml b/taskcluster/ci/toolchain/misc.yml index b0e4b03ab9b1..a30465d334eb 100644 --- a/taskcluster/ci/toolchain/misc.yml +++ b/taskcluster/ci/toolchain/misc.yml @@ -52,7 +52,7 @@ linux64-hfsplus: fetch: - hfsplus-tools toolchain: - - linux64-clang-13 + - linux64-clang-12 linux64-libdmg: description: "libdmg-hfsplus toolchain build" @@ -65,7 +65,7 @@ linux64-libdmg: fetch: - libdmg-hfsplus toolchain: - - linux64-clang-13 + - linux64-clang-12 - linux64-toolchain-sysroot linux64-mar-tools: @@ -293,5 +293,5 @@ nsis: - nsis-3.07 - nsis-3.07-win toolchain: - - linux64-clang-13 + - linux64-clang-12 - sysroot-x86_64-linux-gnu diff --git a/taskcluster/ci/toolchain/nasm.yml b/taskcluster/ci/toolchain/nasm.yml index 50fb9e0890b4..e5522fb8751f 100644 --- a/taskcluster/ci/toolchain/nasm.yml +++ b/taskcluster/ci/toolchain/nasm.yml @@ -38,8 +38,8 @@ macosx64-nasm: fetch: - nasm-2.15.05 toolchain: - - linux64-cctools-port-clang-13 - - linux64-clang-13-macosx-cross + - linux64-cctools-port-clang-12 + - linux64-clang-12-macosx-cross - macosx64-sdk-11.0 macosx64-aarch64-nasm: @@ -55,8 +55,8 @@ macosx64-aarch64-nasm: fetch: - nasm-2.14.02 toolchain: - - linux64-cctools-port-clang-13 - - linux64-clang-13-macosx-cross + - linux64-cctools-port-clang-12 + - linux64-clang-12-macosx-cross - macosx64-sdk-11.0 linux64-nasm: @@ -72,7 +72,7 @@ linux64-nasm: fetch: - nasm-2.15.05 toolchain: - - linux64-clang-13 + - linux64-clang-12 - sysroot-x86_64-linux-gnu linux64-nasm-2.14.02: @@ -86,5 +86,5 @@ linux64-nasm-2.14.02: fetch: - nasm-2.14.02 toolchain: - - linux64-clang-13 + - linux64-clang-12 - sysroot-x86_64-linux-gnu diff --git a/taskcluster/ci/toolchain/sccache.yml b/taskcluster/ci/toolchain/sccache.yml index 223e03560b28..60a07f58d1ae 100644 --- a/taskcluster/ci/toolchain/sccache.yml +++ b/taskcluster/ci/toolchain/sccache.yml @@ -27,7 +27,7 @@ linux64-sccache: fetches: toolchain: - linux64-rust-1.47 - - linux64-clang-13 + - linux64-clang-12 - linux64-binutils - sysroot-x86_64-linux-gnu @@ -43,8 +43,8 @@ macosx64-sccache: fetches: toolchain: - linux64-rust-macos-1.47 - - linux64-clang-13 - - linux64-cctools-port-clang-13 + - linux64-clang-12 + - linux64-cctools-port-clang-12 - macosx64-sdk-11.0 macosx64-aarch64-sccache: @@ -59,8 +59,8 @@ macosx64-aarch64-sccache: fetches: toolchain: - linux64-rust-macos-1.49 - - linux64-clang-13 - - linux64-cctools-port-clang-13 + - linux64-clang-12 + - linux64-cctools-port-clang-12 - macosx64-sdk-11.0 win64-sccache: diff --git a/taskcluster/ci/webrender/kind.yml b/taskcluster/ci/webrender/kind.yml index f3cb46ca6dd6..41caac1dced6 100644 --- a/taskcluster/ci/webrender/kind.yml +++ b/taskcluster/ci/webrender/kind.yml @@ -107,15 +107,15 @@ jobs: name: public/build/wrench-macos-headless.tar.bz2 path: /builds/worker/artifacts/wrench-macos-headless.tar.bz2 dependencies: - macosx64-clang-13: toolchain-macosx64-clang-13 + macosx64-clang-12: toolchain-macosx64-clang-12 fetches: toolchain: - linux64-rust-macos - linux64-cctools-port - - linux64-clang-13-macosx-cross + - linux64-clang-12-macosx-cross - macosx64-sdk-10.12 - wrench-deps - macosx64-clang-13: + macosx64-clang-12: - artifact: clang.tar.zst dest: clang-mac run: diff --git a/taskcluster/scripts/misc/build-clang-mingw.sh b/taskcluster/scripts/misc/build-clang-mingw.sh index 85b1ce64b26d..c0be94091f1b 100755 --- a/taskcluster/scripts/misc/build-clang-mingw.sh +++ b/taskcluster/scripts/misc/build-clang-mingw.sh @@ -149,7 +149,64 @@ build_libcxx() { # other options. DEBUG_FLAGS="-g -gcodeview" - # First configure libcxx + mkdir libunwind + pushd libunwind + cmake \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=$CROSS_PREFIX_DIR \ + -DCMAKE_C_COMPILER=$CC \ + -DCMAKE_CXX_COMPILER=$CXX \ + -DCMAKE_CROSSCOMPILING=TRUE \ + -DCMAKE_SYSROOT=$CROSS_PREFIX_DIR \ + -DCMAKE_SYSTEM_NAME=Windows \ + -DCMAKE_C_COMPILER_WORKS=TRUE \ + -DCMAKE_CXX_COMPILER_WORKS=TRUE \ + -DLLVM_COMPILER_CHECKED=TRUE \ + -DCMAKE_AR=$INSTALL_DIR/bin/llvm-ar \ + -DCMAKE_RANLIB=$INSTALL_DIR/bin/llvm-ranlib \ + -DLLVM_NO_OLD_LIBSTDCXX=TRUE \ + -DCXX_SUPPORTS_CXX11=TRUE \ + -DCXX_SUPPORTS_CXX_STD=TRUE \ + -DLIBUNWIND_USE_COMPILER_RT=TRUE \ + -DLIBUNWIND_ENABLE_THREADS=TRUE \ + -DLIBUNWIND_ENABLE_SHARED=FALSE \ + -DLIBUNWIND_ENABLE_CROSS_UNWINDING=FALSE \ + -DCMAKE_CXX_FLAGS="${DEBUG_FLAGS} -Wno-dll-attribute-on-redeclaration -nostdinc++ -I$TOOLCHAIN_DIR/libcxx/include -DPSAPI_VERSION=2" \ + -DCMAKE_C_FLAGS="-Wno-dll-attribute-on-redeclaration" \ + $MOZ_FETCHES_DIR/libunwind + make $make_flags + make $make_flags install + popd + + mkdir libcxxabi + pushd libcxxabi + cmake \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=$CROSS_PREFIX_DIR \ + -DCMAKE_C_COMPILER=$CC \ + -DCMAKE_CXX_COMPILER=$CXX \ + -DCMAKE_CROSSCOMPILING=TRUE \ + -DCMAKE_SYSTEM_NAME=Windows \ + -DCMAKE_C_COMPILER_WORKS=TRUE \ + -DCMAKE_CXX_COMPILER_WORKS=TRUE \ + -DCMAKE_SYSROOT=$CROSS_PREFIX_DIR \ + -DLLVM_COMPILER_CHECKED=TRUE \ + -DCMAKE_AR=$INSTALL_DIR/bin/llvm-ar \ + -DCMAKE_RANLIB=$INSTALL_DIR/bin/llvm-ranlib \ + -DLIBCXXABI_USE_COMPILER_RT=ON \ + -DLIBCXXABI_ENABLE_EXCEPTIONS=ON \ + -DLIBCXXABI_ENABLE_THREADS=ON \ + -DLIBCXXABI_TARGET_TRIPLE=$machine-w64-mingw32 \ + -DLIBCXXABI_ENABLE_SHARED=OFF \ + -DLIBCXXABI_LIBCXX_INCLUDES=$TOOLCHAIN_DIR/libcxx/include \ + -DLLVM_NO_OLD_LIBSTDCXX=TRUE \ + -DCXX_SUPPORTS_CXX11=TRUE \ + -DCXX_SUPPORTS_CXX_STD=TRUE \ + -DCMAKE_CXX_FLAGS="${DEBUG_FLAGS} -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCPP_HAS_THREAD_API_WIN32" \ + $TOOLCHAIN_DIR/libcxxabi + make $make_flags VERBOSE=1 + popd + mkdir libcxx pushd libcxx cmake \ @@ -181,67 +238,6 @@ build_libcxx() { -DLIBCXX_CXX_ABI_LIBRARY_PATH=../libcxxabi/lib \ -DCMAKE_CXX_FLAGS="${DEBUG_FLAGS} -D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS" \ $TOOLCHAIN_DIR/libcxx - popd - - mkdir libunwind - pushd libunwind - cmake \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=$CROSS_PREFIX_DIR \ - -DCMAKE_C_COMPILER=$CC \ - -DCMAKE_CXX_COMPILER=$CXX \ - -DCMAKE_CROSSCOMPILING=TRUE \ - -DCMAKE_SYSROOT=$CROSS_PREFIX_DIR \ - -DCMAKE_SYSTEM_NAME=Windows \ - -DCMAKE_C_COMPILER_WORKS=TRUE \ - -DCMAKE_CXX_COMPILER_WORKS=TRUE \ - -DLLVM_COMPILER_CHECKED=TRUE \ - -DCMAKE_AR=$INSTALL_DIR/bin/llvm-ar \ - -DCMAKE_RANLIB=$INSTALL_DIR/bin/llvm-ranlib \ - -DLLVM_NO_OLD_LIBSTDCXX=TRUE \ - -DCXX_SUPPORTS_CXX11=TRUE \ - -DCXX_SUPPORTS_CXX_STD=TRUE \ - -DLIBUNWIND_USE_COMPILER_RT=TRUE \ - -DLIBUNWIND_ENABLE_THREADS=TRUE \ - -DLIBUNWIND_ENABLE_SHARED=FALSE \ - -DLIBUNWIND_ENABLE_CROSS_UNWINDING=FALSE \ - -DCMAKE_CXX_FLAGS="${DEBUG_FLAGS} -Wno-dll-attribute-on-redeclaration -nostdinc++ -I$TOOLCHAIN_DIR/build/libcxx/include/c++/v1 -DPSAPI_VERSION=2" \ - -DCMAKE_C_FLAGS="-Wno-dll-attribute-on-redeclaration" \ - $MOZ_FETCHES_DIR/libunwind - make $make_flags - make $make_flags install - popd - - mkdir libcxxabi - pushd libcxxabi - cmake \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=$CROSS_PREFIX_DIR \ - -DCMAKE_C_COMPILER=$CC \ - -DCMAKE_CXX_COMPILER=$CXX \ - -DCMAKE_CROSSCOMPILING=TRUE \ - -DCMAKE_SYSTEM_NAME=Windows \ - -DCMAKE_C_COMPILER_WORKS=TRUE \ - -DCMAKE_CXX_COMPILER_WORKS=TRUE \ - -DCMAKE_SYSROOT=$CROSS_PREFIX_DIR \ - -DLLVM_COMPILER_CHECKED=TRUE \ - -DCMAKE_AR=$INSTALL_DIR/bin/llvm-ar \ - -DCMAKE_RANLIB=$INSTALL_DIR/bin/llvm-ranlib \ - -DLIBCXXABI_USE_COMPILER_RT=ON \ - -DLIBCXXABI_ENABLE_EXCEPTIONS=ON \ - -DLIBCXXABI_ENABLE_THREADS=ON \ - -DLIBCXXABI_TARGET_TRIPLE=$machine-w64-mingw32 \ - -DLIBCXXABI_ENABLE_SHARED=OFF \ - -DLIBCXXABI_LIBCXX_INCLUDES=$TOOLCHAIN_DIR/libcxx/include/ \ - -DLLVM_NO_OLD_LIBSTDCXX=TRUE \ - -DCXX_SUPPORTS_CXX11=TRUE \ - -DCXX_SUPPORTS_CXX_STD=TRUE \ - -DCMAKE_CXX_FLAGS="${DEBUG_FLAGS} -I$TOOLCHAIN_DIR/build/libcxx/include/c++/v1 -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCPP_HAS_THREAD_API_WIN32" \ - $TOOLCHAIN_DIR/libcxxabi - make $make_flags VERBOSE=1 - popd - - pushd libcxx make $make_flags VERBOSE=1 make $make_flags install diff --git a/taskcluster/scripts/misc/build-compiler-rt.sh b/taskcluster/scripts/misc/build-compiler-rt.sh index 501e34f1eff0..e1aaf0b8284e 100755 --- a/taskcluster/scripts/misc/build-compiler-rt.sh +++ b/taskcluster/scripts/misc/build-compiler-rt.sh @@ -95,7 +95,6 @@ case "$target" in -DANDROID_NATIVE_API_LEVEL=$api_level -DSANITIZER_ALLOW_CXXABI=OFF -DCOMPILER_RT_BUILD_LIBFUZZER=OFF - -DCOMPILER_RT_BUILD_ORC=OFF " ;; aarch64-unknown-linux-gnu) diff --git a/taskcluster/scripts/misc/repack-clang-linux-win-cross.sh b/taskcluster/scripts/misc/repack-clang-linux-win-cross.sh index 07a44d02f150..d4b3aa4ac20f 100755 --- a/taskcluster/scripts/misc/repack-clang-linux-win-cross.sh +++ b/taskcluster/scripts/misc/repack-clang-linux-win-cross.sh @@ -9,8 +9,7 @@ cd $MOZ_FETCHES_DIR # We have a non-extracted clang-cl/clang.tar.zst for Windows clang-cl that we need to extract # files from. -$GECKO_PATH/taskcluster/scripts/misc/zstdpy -d clang-cl/clang.tar.zst | tar -x --wildcards clang/lib/clang/*/lib/windows clang/bin/clang.exe clang/bin/llvm-symbolizer.exe -mv clang/bin/clang.exe clang/bin/clang-cl.exe +$GECKO_PATH/taskcluster/scripts/misc/zstdpy -d clang-cl/clang.tar.zst | tar -x --wildcards clang/lib/clang/*/lib/windows clang/bin/clang-cl.exe clang/bin/llvm-symbolizer.exe chmod +x clang/bin/clang-cl.exe tar caf clang.tar.zst clang