@@ -1206,11 +1206,6 @@ SWIFT_PATH_TO_STRING_PROCESSING_SOURCE="${WORKSPACE}/swift-experimental-string-p
12061206SWIFTSYNTAX_SOURCE_DIR=" ${WORKSPACE} /swift-syntax"
12071207SWIFT_SYNTAX_SOURCE_DIR=" ${WORKSPACE} /swift-syntax"
12081208
1209- # We cannot currently apply the normal rules of skipping here for LLVM. Even if
1210- # we are skipping building LLVM, we still need to at least build a few tools
1211- # like tblgen that Swift relies on for building and testing. See the LLVM
1212- # configure rules.
1213- PRODUCTS=(llvm)
12141209[[ " ${SKIP_BUILD_LIBCXX} " ]] || PRODUCTS+=(libcxx)
12151210[[ " ${SKIP_BUILD_LIBICU} " ]] || PRODUCTS+=(libicu)
12161211[[ " ${SKIP_BUILD_SWIFT} " ]] || PRODUCTS+=(swift)
@@ -1394,9 +1389,6 @@ function cmake_config_opt() {
13941389 # CMake automatically adds --target ALL_BUILD if we don't pass this.
13951390 echo " --target ZERO_CHECK "
13961391 case ${product} in
1397- llvm)
1398- echo " --config ${LLVM_BUILD_TYPE} "
1399- ;;
14001392 libcxx)
14011393 # Reuse LLVM's build type.
14021394 echo " --config ${LLVM_BUILD_TYPE} "
@@ -1700,137 +1692,6 @@ for host in "${ALL_HOSTS[@]}"; do
17001692 cmake_options+=(" ${product_cmake_options[@]} " )
17011693
17021694 case ${product} in
1703- llvm)
1704- if [[ -n " ${LLVM_NINJA_TARGETS_FOR_CROSS_COMPILE_HOSTS} " && $( is_cross_tools_host ${host} ) ]] ; then
1705- build_targets=(" ${LLVM_NINJA_TARGETS_FOR_CROSS_COMPILE_HOSTS[@]} " )
1706- elif [[ -n " ${LLVM_NINJA_TARGETS} " ]] ; then
1707- build_targets=(" ${LLVM_NINJA_TARGETS[@]} " )
1708- fi
1709- # indicating we don't want to build LLVM should
1710- # override any custom ninja target we specified
1711- if [ " ${BUILD_LLVM} " == " 0" ] ; then
1712- build_targets=(clean)
1713- fi
1714- if [[ " ${SKIP_BUILD} " || " ${SKIP_BUILD_LLVM} " ]] ; then
1715- # We can't skip the build completely because the standalone
1716- # build of Swift depend on these for building and testing.
1717- build_targets=(llvm-tblgen clang-resource-headers intrinsics_gen clang-tablegen-targets)
1718- # If we are not performing a toolchain only build, then we
1719- # also want to include FileCheck, not, llvm-nm, and similar
1720- # for testing purposes.
1721- if [[ ! " ${BUILD_TOOLCHAIN_ONLY} " ]] ; then
1722- build_targets=(
1723- " ${build_targets[@]} "
1724- FileCheck
1725- not
1726- llvm-nm
1727- llvm-size
1728- )
1729- fi
1730- fi
1731-
1732- if [ " ${HOST_LIBTOOL} " ] ; then
1733- cmake_options=(
1734- " ${cmake_options[@]} "
1735- -DCMAKE_LIBTOOL:PATH=" ${HOST_LIBTOOL} "
1736- )
1737- fi
1738-
1739- # Note: we set the variable:
1740- #
1741- # LLVM_TOOL_SWIFT_BUILD
1742- #
1743- # below because this script builds swift separately, and people
1744- # often have reasons to symlink the swift directory into
1745- # llvm/tools, e.g. to build LLDB.
1746- cmake_options=(
1747- " ${cmake_options[@]} "
1748- -DCMAKE_C_FLAGS=" $( llvm_c_flags ${host} ) "
1749- -DCMAKE_CXX_FLAGS=" $( llvm_c_flags ${host} ) "
1750- -DCMAKE_C_FLAGS_RELWITHDEBINFO=" -O2 -DNDEBUG"
1751- -DCMAKE_CXX_FLAGS_RELWITHDEBINFO=" -O2 -DNDEBUG"
1752- -DCMAKE_BUILD_TYPE:STRING=" ${LLVM_BUILD_TYPE} "
1753- -DLLVM_TOOL_SWIFT_BUILD:BOOL=NO
1754- -DLLVM_TOOL_LLD_BUILD:BOOL=TRUE
1755- -DLLVM_INCLUDE_DOCS:BOOL=TRUE
1756- -DLLVM_ENABLE_LTO:STRING=" ${LLVM_ENABLE_LTO} "
1757- -DCOMPILER_RT_INTERCEPT_LIBDISPATCH=ON
1758- " ${llvm_cmake_options[@]} "
1759- )
1760-
1761- llvm_enable_projects=(" clang" )
1762-
1763- if [[ ! " ${SKIP_BUILD_COMPILER_RT} " && ! $( is_cross_tools_host ${host} ) ]]; then
1764- llvm_enable_projects+=(" compiler-rt" )
1765- fi
1766-
1767- if [[ ! " ${SKIP_BUILD_CLANG_TOOLS_EXTRA} " ]]; then
1768- llvm_enable_projects+=(" clang-tools-extra" )
1769- fi
1770-
1771- if [[ ! " ${SKIP_BUILD_LLD} " ]]; then
1772- llvm_enable_projects+=(" lld" )
1773- fi
1774-
1775- cmake_options+=(
1776- -DLLVM_ENABLE_PROJECTS=" $( join " ;" ${llvm_enable_projects[@]} ) "
1777- # In the near future we are aiming to build compiler-rt with
1778- # LLVM_ENABLE_RUNTIMES
1779- # Until that happens, we need to unset this variable from
1780- # LLVM CMakeCache.txt for two reasons
1781- # * prevent PRs testing this variable to affect other runs landing
1782- # unrelated features
1783- # * avoid fallouts should we land such change and then have to revert
1784- # it to account for unforeseen regressions
1785- -ULLVM_ENABLE_RUNTIMES
1786- )
1787-
1788- # NOTE: This is not a dead option! It is relied upon for certain
1789- # bots/build-configs!
1790- #
1791- # TODO: In the future when we are always cross compiling and
1792- # using Toolchain files, we should put this in either a
1793- # toolchain file or a cmake cache.
1794- if [[ " ${BUILD_TOOLCHAIN_ONLY} " ]]; then
1795- cmake_options+=(
1796- -DLLVM_BUILD_TOOLS=NO
1797- -DLLVM_INSTALL_TOOLCHAIN_ONLY=YES
1798- -DLLVM_INCLUDE_TESTS=NO
1799- -DCLANG_INCLUDE_TESTS=NO
1800- -DLLVM_INCLUDE_UTILS=NO
1801- -DLLVM_TOOL_LLI_BUILD=NO
1802- -DLLVM_TOOL_LLVM_AR_BUILD=NO
1803- -DCLANG_TOOL_CLANG_CHECK_BUILD=NO
1804- -DCLANG_TOOL_ARCMT_TEST_BUILD=NO
1805- -DCLANG_TOOL_C_ARCMT_TEST_BUILD=NO
1806- -DCLANG_TOOL_C_INDEX_TEST_BUILD=NO
1807- -DCLANG_TOOL_DRIVER_BUILD=$( false_true " ${BUILD_RUNTIME_WITH_HOST_COMPILER} " )
1808- -DCLANG_TOOL_DIAGTOOL_BUILD=NO
1809- -DCLANG_TOOL_SCAN_BUILD_BUILD=NO
1810- -DCLANG_TOOL_SCAN_VIEW_BUILD=NO
1811- -DCLANG_TOOL_CLANG_FORMAT_BUILD=NO
1812- )
1813- fi
1814-
1815- if [[ $( true_false " ${LLVM_INCLUDE_TESTS} " ) == " FALSE" ]]; then
1816- cmake_options+=(
1817- -DLLVM_INCLUDE_TESTS=NO
1818- -DCLANG_INCLUDE_TESTS=NO
1819- )
1820- fi
1821-
1822- if [[ $( is_cross_tools_host ${host} ) ]] ; then
1823- cmake_options=(
1824- " ${cmake_options[@]} "
1825- -DLLVM_TABLEGEN=$( build_directory " ${LOCAL_HOST} " llvm) /bin/llvm-tblgen
1826- -DCLANG_TABLEGEN=$( build_directory " ${LOCAL_HOST} " llvm) /bin/clang-tblgen
1827- -DLLVM_NATIVE_BUILD=$( build_directory " ${LOCAL_HOST} " llvm)
1828- )
1829- cmake_options+=(" ${SWIFT_TARGET_CMAKE_OPTIONS[@]} " )
1830- fi
1831-
1832- ;;
1833-
18341695 libcxx)
18351696 build_targets=(cxx)
18361697 cmake_options=(
@@ -2765,42 +2626,8 @@ for host in "${ALL_HOSTS[@]}"; do
27652626 continue
27662627 fi
27672628
2768- # When we are building LLVM create symlinks to the c++ headers. We need
2769- # to do this before building LLVM since compiler-rt depends on being
2770- # built with the just built clang compiler. These are normally put into
2771- # place during the cmake step of LLVM's build when libcxx is in
2772- # tree... but we are not building llvm with libcxx in tree when we build
2773- # swift. So we need to do configure's work here.
2774- if [[ " ${product} " == " llvm" ]]; then
2775- # Find the location of the c++ header dir.
2776- if [[ " $( uname -s) " == " Darwin" ]] ; then
2777- HOST_CXX_DIR=$( dirname " ${HOST_CXX} " )
2778- HOST_CXX_HEADERS_DIR=" $HOST_CXX_DIR /../../usr/include/c++"
2779- elif [[ " $( uname -s) " == " Haiku" ]] ; then
2780- HOST_CXX_HEADERS_DIR=" /boot/system/develop/headers/c++"
2781- elif [[ " ${ANDROID_DATA} " ]] ; then
2782- # This means we're building natively on Android in the Termux
2783- # app, which supplies the $PREFIX variable.
2784- HOST_CXX_HEADERS_DIR=" $PREFIX /include/c++"
2785- else # Linux
2786- HOST_CXX_HEADERS_DIR=" /usr/include/c++"
2787- fi
2788-
2789- # Find the path in which the local clang build is expecting to find
2790- # the c++ header files.
2791- BUILT_CXX_INCLUDE_DIR=" $llvm_build_dir /include"
2792-
2793- echo " symlinking the system headers ($HOST_CXX_HEADERS_DIR ) into the local clang build directory ($BUILT_CXX_INCLUDE_DIR )."
2794- call ln -s -f " $HOST_CXX_HEADERS_DIR " " $BUILT_CXX_INCLUDE_DIR "
2795- fi
2796-
27972629 # Build.
2798- #
2799- # Even if builds are skipped, Swift configuration relies on
2800- # some LLVM tools like TableGen. In the LLVM configure rules
2801- # above, a small subset of LLVM build_targets are selected
2802- # when SKIP_BUILD is set.
2803- if [[ $( not ${SKIP_BUILD} ) || " ${product} " == " llvm" ]]; then
2630+ if [[ $( not ${SKIP_BUILD} ) ]]; then
28042631 if [[ " ${CMAKE_GENERATOR} " == " Xcode" ]] ; then
28052632 # Xcode generator uses "ALL_BUILD" instead of "all".
28062633 # Also, xcodebuild uses -target instead of bare names.
@@ -2814,13 +2641,6 @@ for host in "${ALL_HOSTS[@]}"; do
28142641
28152642 call " ${CMAKE_BUILD[@]} " " ${build_dir} " $( cmake_config_opt ${product} ) -- " ${BUILD_ARGS[@]} " ${build_targets[@]}
28162643 fi
2817-
2818- # When we are building LLVM copy over the compiler-rt
2819- # builtins for iOS/tvOS/watchOS to ensure that Swift's
2820- # stdlib can use compiler-rt builtins when targeting iOS/tvOS/watchOS.
2821- if [[ " ${product} " = " llvm" ]] && [[ " ${BUILD_LLVM} " = " 1" ]] && [[ " $( uname -s) " = " Darwin" ]]; then
2822- copy_embedded_compiler_rt_builtins_from_darwin_host_toolchain " $( build_directory_bin ${host} llvm) /.."
2823- fi
28242644 done
28252645done
28262646# END OF BUILD PHASE
@@ -2863,9 +2683,6 @@ for host in "${ALL_HOSTS[@]}"; do
28632683 fi
28642684
28652685 case ${product} in
2866- llvm)
2867- continue # We don't test LLVM
2868- ;;
28692686 libcxx)
28702687 continue # We don't test libc++
28712688 ;;
@@ -3185,21 +3002,6 @@ for host in "${ALL_HOSTS[@]}"; do
31853002 INSTALL_TARGETS=" install"
31863003
31873004 case ${product} in
3188- llvm)
3189- if [[ -z " ${INSTALL_LLVM} " ]] ; then
3190- continue
3191- fi
3192-
3193- if [[ " ${LLVM_INSTALL_COMPONENTS} " == " all" ]] ; then
3194- INSTALL_TARGETS=install
3195- elif [[ -n " ${LLVM_INSTALL_COMPONENTS} " ]] ; then
3196- if [[ $( is_cross_tools_host ${host} ) && " ${LLVM_INSTALL_COMPONENTS} " == * " compiler-rt" * ]]; then
3197- INSTALL_TARGETS=install-$( echo ${LLVM_INSTALL_COMPONENTS} | sed -E ' s/compiler-rt;//g' | sed -E ' s/;/ install-/g' )
3198- else
3199- INSTALL_TARGETS=install-$( echo ${LLVM_INSTALL_COMPONENTS} | sed -E ' s/;/ install-/g' )
3200- fi
3201- fi
3202- ;;
32033005 libcxx)
32043006 if [[ -z " ${INSTALL_LIBCXX} " ]] ; then
32053007 continue
@@ -3325,13 +3127,6 @@ for host in "${ALL_HOSTS[@]}"; do
33253127 build_dir=$( build_directory ${host} ${product} )
33263128
33273129 call env DESTDIR=" ${host_install_destdir} " " ${CMAKE_BUILD[@]} " " ${build_dir} " -- ${INSTALL_TARGETS}
3328-
3329- # When we are installing LLVM copy over the compiler-rt
3330- # builtins for iOS/tvOS/watchOS to ensure that we don't
3331- # have linker errors when building apps for such platforms.
3332- if [[ " ${product} " = " llvm" ]] && [[ ! -z " ${LLVM_INSTALL_COMPONENTS} " ]] && [[ " $( uname -s) " = " Darwin" ]]; then
3333- copy_embedded_compiler_rt_builtins_from_darwin_host_toolchain " ${host_install_destdir}${host_install_prefix} "
3334- fi
33353130 done
33363131done
33373132
0 commit comments