@@ -527,6 +527,7 @@ function set_deployment_target_based_options() {
527
527
-DLLVM_HOST_TRIPLE:STRING=" ${llvm_host_triple} "
528
528
-DLLVM_ENABLE_LIBCXX:BOOL=TRUE
529
529
-DLLVM_TOOL_COMPILER_RT_BUILD:BOOL=" $( false_true ${SKIP_COMPILER_RT} ) "
530
+ -DLLVM_BUILD_EXTERNAL_COMPILER_RT:BOOL=" $( false_true ${SKIP_COMPILER_RT} ) "
530
531
-DCOMPILER_RT_ENABLE_IOS:BOOL=FALSE
531
532
-DCOMPILER_RT_ENABLE_WATCHOS:BOOL=FALSE
532
533
-DCOMPILER_RT_ENABLE_TVOS:BOOL=FALSE
@@ -1894,6 +1895,31 @@ for deployment_target in "${HOST_TARGET}" "${CROSS_COMPILE_TOOLS_DEPLOYMENT_TARG
1894
1895
{ set +x; } 2> /dev/null
1895
1896
fi
1896
1897
1898
+ # When we are building LLVM create symlinks to the c++ headers. We need
1899
+ # to do this before building LLVM since compiler-rt depends on being
1900
+ # built with the just built clang compiler. These are normally put into
1901
+ # place during the cmake step of LLVM's build when libcxx is in
1902
+ # tree... but we are not building llvm with libcxx in tree when we build
1903
+ # swift. So we need to do configure's work here.
1904
+ if [[ " ${product} " == " llvm" ]]; then
1905
+ # Find the location of the c++ header dir.
1906
+ if [[ " $( uname -s) " == " Darwin" ]] ; then
1907
+ HOST_CXX_DIR=$( dirname ${HOST_CXX} )
1908
+ HOST_CXX_HEADERS_DIR=" $HOST_CXX_DIR /../../usr/include/c++"
1909
+ else # Linux
1910
+ HOST_CXX_HEADERS_DIR=" /usr/include/c++"
1911
+ fi
1912
+
1913
+ # Find the path in which the local clang build is expecting to find
1914
+ # the c++ header files.
1915
+ BUILT_CXX_INCLUDE_DIR=" $llvm_build_dir /include"
1916
+
1917
+ echo " symlinking the system headers ($HOST_CXX_HEADERS_DIR ) into the local clang build directory ($BUILT_CXX_INCLUDE_DIR )."
1918
+ set -x
1919
+ ln -s -f " $HOST_CXX_HEADERS_DIR " " $BUILT_CXX_INCLUDE_DIR "
1920
+ { set +x; } 2> /dev/null
1921
+ fi
1922
+
1897
1923
# Build.
1898
1924
if [[ ! " ${skip_build} " ]]; then
1899
1925
if [[ " ${CMAKE_GENERATOR} " == " Xcode" ]] ; then
@@ -1913,26 +1939,6 @@ for deployment_target in "${HOST_TARGET}" "${CROSS_COMPILE_TOOLS_DEPLOYMENT_TARG
1913
1939
${DISTCC_PUMP} " ${CMAKE} " --build " ${build_dir} " $( cmake_config_opt ${product} ) -- " ${BUILD_ARGS[@]} " ${build_targets[@]}
1914
1940
{ set +x; } 2> /dev/null
1915
1941
fi
1916
-
1917
- # When we are building LLVM create symlinks to the c++ headers.
1918
- if [[ " ${product} " == " llvm" ]]; then
1919
- # Find the location of the c++ header dir.
1920
- if [[ " $( uname -s) " == " Darwin" ]] ; then
1921
- HOST_CXX_DIR=$( dirname ${HOST_CXX} )
1922
- HOST_CXX_HEADERS_DIR=" $HOST_CXX_DIR /../../usr/include/c++"
1923
- else # Linux
1924
- HOST_CXX_HEADERS_DIR=" /usr/include/c++"
1925
- fi
1926
-
1927
- # Find the path in which the local clang build is expecting to find
1928
- # the c++ header files.
1929
- BUILT_CXX_INCLUDE_DIR=" $llvm_build_dir /include"
1930
-
1931
- echo " symlinking the system headers ($HOST_CXX_HEADERS_DIR ) into the local clang build directory ($BUILT_CXX_INCLUDE_DIR )."
1932
- set -x
1933
- ln -s -f " $HOST_CXX_HEADERS_DIR " " $BUILT_CXX_INCLUDE_DIR "
1934
- { set +x; } 2> /dev/null
1935
- fi
1936
1942
done
1937
1943
done
1938
1944
# END OF BUILD PHASE
0 commit comments