@@ -1275,9 +1275,6 @@ function build_directory_bin() {
1275
1275
root=" $( build_directory ${host} ${product} ) "
1276
1276
if [[ " ${CMAKE_GENERATOR} " == " Xcode" ]] ; then
1277
1277
case ${product} in
1278
- llvm)
1279
- echo " ${root} /${LLVM_BUILD_TYPE} /bin"
1280
- ;;
1281
1278
libcxx)
1282
1279
# Reuse LLVM's build type.
1283
1280
echo " ${root} /${LLVM_BUILD_TYPE} /bin"
@@ -1394,9 +1391,6 @@ function cmake_config_opt() {
1394
1391
# CMake automatically adds --target ALL_BUILD if we don't pass this.
1395
1392
echo " --target ZERO_CHECK "
1396
1393
case ${product} in
1397
- llvm)
1398
- echo " --config ${LLVM_BUILD_TYPE} "
1399
- ;;
1400
1394
libcxx)
1401
1395
# Reuse LLVM's build type.
1402
1396
echo " --config ${LLVM_BUILD_TYPE} "
@@ -1668,7 +1662,7 @@ for host in "${ALL_HOSTS[@]}"; do
1668
1662
exit 1
1669
1663
fi
1670
1664
else
1671
- CLANG_BIN=" $( build_directory_bin ${LOCAL_HOST} llvm ) "
1665
+ CLANG_BIN=" $( build_directory_bin ${LOCAL_HOST} libcxx ) "
1672
1666
fi
1673
1667
1674
1668
if [[ " ${NATIVE_SWIFT_TOOLS_PATH} " ]] ; then
@@ -1700,137 +1694,6 @@ for host in "${ALL_HOSTS[@]}"; do
1700
1694
cmake_options+=(" ${product_cmake_options[@]} " )
1701
1695
1702
1696
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
-
1834
1697
libcxx)
1835
1698
build_targets=(cxx)
1836
1699
cmake_options=(
@@ -2362,7 +2225,7 @@ for host in "${ALL_HOSTS[@]}"; do
2362
2225
-DLLBUILD_SUPPORT_BINDINGS:=Swift
2363
2226
2364
2227
-DLIT_EXECUTABLE:PATH=" ${LLVM_SOURCE_DIR} /utils/lit/lit.py"
2365
- -DFILECHECK_EXECUTABLE:PATH=" $( build_directory_bin ${LOCAL_HOST} llvm ) /FileCheck"
2228
+ -DFILECHECK_EXECUTABLE:PATH=" $( build_directory_bin ${LOCAL_HOST} libcxx ) /FileCheck"
2366
2229
-DSWIFTC_EXECUTABLE:PATH=${SWIFTC_BIN}
2367
2230
-DFOUNDATION_BUILD_DIR:PATH=" $( build_directory ${host} foundation) "
2368
2231
-DLIBDISPATCH_BUILD_DIR:PATH=" $( build_directory ${host} libdispatch) "
@@ -2765,42 +2628,13 @@ for host in "${ALL_HOSTS[@]}"; do
2765
2628
continue
2766
2629
fi
2767
2630
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
-
2797
2631
# Build.
2798
2632
#
2799
2633
# Even if builds are skipped, Swift configuration relies on
2800
2634
# some LLVM tools like TableGen. In the LLVM configure rules
2801
2635
# above, a small subset of LLVM build_targets are selected
2802
2636
# when SKIP_BUILD is set.
2803
- if [[ $( not ${SKIP_BUILD} ) || " ${product} " == " llvm " ]]; then
2637
+ if [[ $( not ${SKIP_BUILD} ) ]]; then
2804
2638
if [[ " ${CMAKE_GENERATOR} " == " Xcode" ]] ; then
2805
2639
# Xcode generator uses "ALL_BUILD" instead of "all".
2806
2640
# Also, xcodebuild uses -target instead of bare names.
@@ -2814,13 +2648,6 @@ for host in "${ALL_HOSTS[@]}"; do
2814
2648
2815
2649
call " ${CMAKE_BUILD[@]} " " ${build_dir} " $( cmake_config_opt ${product} ) -- " ${BUILD_ARGS[@]} " ${build_targets[@]}
2816
2650
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
2824
2651
done
2825
2652
done
2826
2653
# END OF BUILD PHASE
@@ -2846,7 +2673,7 @@ for host in "${ALL_HOSTS[@]}"; do
2846
2673
if [[ " ${NATIVE_CLANG_TOOLS_PATH} " ]] ; then
2847
2674
CLANG_BIN=" ${NATIVE_CLANG_TOOLS_PATH} "
2848
2675
else
2849
- CLANG_BIN=" $( build_directory_bin ${LOCAL_HOST} llvm ) "
2676
+ CLANG_BIN=" $( build_directory_bin ${LOCAL_HOST} libcxx ) "
2850
2677
fi
2851
2678
2852
2679
if [[ " ${NATIVE_SWIFT_TOOLS_PATH} " ]] ; then
@@ -2863,9 +2690,6 @@ for host in "${ALL_HOSTS[@]}"; do
2863
2690
fi
2864
2691
2865
2692
case ${product} in
2866
- llvm)
2867
- continue # We don't test LLVM
2868
- ;;
2869
2693
libcxx)
2870
2694
continue # We don't test libc++
2871
2695
;;
@@ -3185,21 +3009,6 @@ for host in "${ALL_HOSTS[@]}"; do
3185
3009
INSTALL_TARGETS=" install"
3186
3010
3187
3011
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
- ;;
3203
3012
libcxx)
3204
3013
if [[ -z " ${INSTALL_LIBCXX} " ]] ; then
3205
3014
continue
@@ -3325,13 +3134,6 @@ for host in "${ALL_HOSTS[@]}"; do
3325
3134
build_dir=$( build_directory ${host} ${product} )
3326
3135
3327
3136
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
3335
3137
done
3336
3138
done
3337
3139
@@ -3552,7 +3354,7 @@ function build_and_test_installable_package() {
3552
3354
fi
3553
3355
3554
3356
LIT_EXECUTABLE_PATH=" ${LLVM_SOURCE_DIR} /utils/lit/lit.py"
3555
- LLVM_BIN_DIR=" $( build_directory_bin ${LOCAL_HOST} llvm ) "
3357
+ LLVM_BIN_DIR=" $( build_directory_bin ${LOCAL_HOST} libcxx ) "
3556
3358
echo " -- Test Installable Package --"
3557
3359
call rm -rf " ${PKG_TESTS_SANDBOX_PARENT} "
3558
3360
call mkdir -p " ${PKG_TESTS_SANDBOX} "
0 commit comments