diff --git a/utils/build-presets.ini b/utils/build-presets.ini index 326b1f8656dcd..21e9de47f613e 100644 --- a/utils/build-presets.ini +++ b/utils/build-presets.ini @@ -19,7 +19,7 @@ swift-install-components=back-deployment;compiler;clang-builtin-headers;stdlib;s [preset: mixin_buildbot_install_components_with_clang] swift-install-components=autolink-driver;back-deployment;compiler;clang-resource-dir-symlink;stdlib;sdk-overlay;parser-lib;static-mirror-lib;toolchain-tools;license;sourcekit-xpc-service;swift-remote-mirror;swift-remote-mirror-headers -llvm-install-components=llvm-cov;llvm-profdata;IndexStore;clang;clang-resource-headers;compiler-rt;clangd;dsymutil;LTO;clang-features-file +llvm-install-components=llvm-cov;llvm-profdata;IndexStore;clang;clang-resource-headers;builtins;runtimes;clangd;dsymutil;LTO;clang-features-file [preset: mixin_buildbot_trunk_base] # Build standard library and SDK overlay for iOS device and simulator. @@ -800,11 +800,31 @@ no-swift-stdlib-assertions [preset: mixin_linux_install_components_with_clang] swift-install-components=autolink-driver;compiler;clang-resource-dir-symlink;stdlib;swift-remote-mirror;sdk-overlay;parser-lib;static-mirror-lib;toolchain-tools;license;sourcekit-inproc -llvm-install-components=llvm-cov;llvm-profdata;IndexStore;clang;clang-resource-headers;compiler-rt;clangd;lld;LTO;clang-features-file +llvm-install-components=llvm-cov;llvm-profdata;IndexStore;clang;clang-resource-headers;builtins;runtimes;clangd;lld;LTO;clang-features-file + +[preset: mixin_linux_compiler_rt_configuration] +# When configuring the builtins CMake project +# the detection of the features is done generating +# static archives, and that leads to incorrectly +# detect we can build for x86 -- while the bots +# do not have the content to target it +# We then need to manually override the detection logic +# to avoid build failures +extra-cmake-options= + -DBUILTINS_CMAKE_ARGS:STRING="-DCAN_TARGET_i386:BOOL=OFF" +# This is to prevent failures in linking +# tsan_interceptors_dispatch as part of libclang_rt.tsan +# We are now inheriting the -Wl,-z,defs linker flags +# from HandleLLVMOptions.cmake, so the compiler now complains +# for BlocksRuntime symbols that are undefined + -DCOMPILER_RT_INTERCEPT_LIBDISPATCH:BOOL=OFF +# Swift seems to expect the old layout for the runtime directory + -DRUNTIMES_CMAKE_ARGS=-DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR:BOOL=OFF [preset: mixin_linux_installation] mixin-preset= mixin_linux_install_components_with_clang + mixin_linux_compiler_rt_configuration llbuild swiftpm @@ -1082,6 +1102,9 @@ install-destdir=%(install_destdir)s installable-package=%(installable_package)s [preset: buildbot_incremental_linux_base] +mixin-preset= + mixin_linux_compiler_rt_configuration + assertions release @@ -2633,7 +2656,7 @@ darwin-toolchain-display-name-short=Swift Development Snapshot darwin-toolchain-display-name=Swift Development Snapshot darwin-toolchain-name=swift-DEVELOPMENT-SNAPSHOT darwin-toolchain-version=3.999.999 -llvm-install-components=clang;clang-resource-headers;compiler-rt;libclang;libclang-headers;dsymutil;clang-features-file +llvm-install-components=clang;clang-resource-headers;builtins;runtimes;libclang;libclang-headers;dsymutil;clang-features-file swift-install-components=back-deployment;compiler;clang-builtin-headers;stdlib;sdk-overlay;license;sourcekit-xpc-service;swift-remote-mirror;swift-remote-mirror-headers symbols-package=%(symbols_package)s install-symroot=%(install_symroot)s diff --git a/utils/build-script-impl b/utils/build-script-impl old mode 100755 new mode 100644 index 13577f9a0dccb..fef7733a10865 --- a/utils/build-script-impl +++ b/utils/build-script-impl @@ -780,21 +780,6 @@ function set_build_options_for_host() { ;; esac - - # We don't currently support building compiler-rt for cross-compile targets. - # It's not clear that's useful anyway. - if [[ $(is_cross_tools_host "${host}") ]] ; then - llvm_cmake_options+=( - -DLLVM_TOOL_COMPILER_RT_BUILD:BOOL=FALSE - -DLLVM_BUILD_EXTERNAL_COMPILER_RT:BOOL=FALSE - ) - else - llvm_cmake_options+=( - -DLLVM_TOOL_COMPILER_RT_BUILD:BOOL="$(false_true ${SKIP_BUILD_COMPILER_RT})" - -DLLVM_BUILD_EXTERNAL_COMPILER_RT:BOOL="$(false_true ${SKIP_BUILD_COMPILER_RT})" - ) - fi - # If we are asked to not generate test targets for LLVM and or Swift, # disable as many LLVM tools as we can. This improves compile time when # compiling with LTO. @@ -1816,9 +1801,12 @@ for host in "${ALL_HOSTS[@]}"; do ) llvm_enable_projects=("clang") + llvm_enable_runtimes=("") if [[ ! "${SKIP_BUILD_COMPILER_RT}" && ! $(is_cross_tools_host ${host}) ]]; then - llvm_enable_projects+=("compiler-rt") + llvm_enable_runtimes+=("compiler-rt") + build_targets=("${build_targets[@]}" + runtimes) fi if [[ ! "${SKIP_BUILD_CLANG_TOOLS_EXTRA}" ]]; then @@ -1831,15 +1819,10 @@ for host in "${ALL_HOSTS[@]}"; do cmake_options+=( -DLLVM_ENABLE_PROJECTS="$(join ";" ${llvm_enable_projects[@]})" - # In the near future we are aiming to build compiler-rt with - # LLVM_ENABLE_RUNTIMES - # Until that happens, we need to unset this variable from - # LLVM CMakeCache.txt for two reasons - # * prevent PRs testing this variable to affect other runs landing - # unrelated features - # * avoid fallouts should we land such change and then have to revert - # it to account for unforeseen regressions - -ULLVM_ENABLE_RUNTIMES + + -DLLVM_ENABLE_RUNTIMES="$(join ";" ${llvm_enable_runtimes[@]})" + -ULLVM_TOOL_COMPILER_RT_BUILD + -ULLVM_BUILD_EXTERNAL_COMPILER_RT ) # NOTE: This is not a dead option! It is relied upon for certain