@@ -1375,12 +1375,16 @@ function copy_embedded_compiler_rt_builtins_from_darwin_host_toolchain() {
1375
1375
echo " copying compiler-rt embedded builtins from ${HOST_CXX_BUILTINS_DIR} into the local clang build directory ${DEST_BUILTINS_DIR} ."
1376
1376
1377
1377
for OS in ios watchos tvos; do
1378
+ # Copy over the device .a when necessary
1378
1379
LIB_NAME=" libclang_rt.$OS .a"
1379
1380
HOST_LIB_PATH=" $HOST_CXX_BUILTINS_DIR /$LIB_NAME "
1380
- if [[ -f " ${HOST_LIB_PATH} " ]]; then
1381
- call cp " ${HOST_LIB_PATH} " " ${DEST_BUILTINS_DIR} /${LIB_NAME} "
1382
- elif [[ " ${VERBOSE_BUILD} " ]]; then
1383
- echo " no file exists at ${HOST_LIB_PATH} "
1381
+ DEST_LIB_PATH=" ${DEST_BUILTINS_DIR} /${LIB_NAME} "
1382
+ if [[ ! -f " ${DEST_LIB_PATH} " ]]; then
1383
+ if [[ -f " ${HOST_LIB_PATH} " ]]; then
1384
+ call cp " ${HOST_LIB_PATH} " " ${DEST_LIB_PATH} "
1385
+ elif [[ " ${VERBOSE_BUILD} " ]]; then
1386
+ echo " no file exists at ${HOST_LIB_PATH} "
1387
+ fi
1384
1388
fi
1385
1389
1386
1390
# Copy over the simulator .a when necessary
@@ -2989,7 +2993,7 @@ for host in "${ALL_HOSTS[@]}"; do
2989
2993
build_dir=$( build_directory ${host} ${product} )
2990
2994
2991
2995
call env DESTDIR=" ${host_install_destdir} " " ${CMAKE_BUILD[@]} " " ${build_dir} " -- ${INSTALL_TARGETS}
2992
-
2996
+
2993
2997
# When we are installing LLVM copy over the compiler-rt
2994
2998
# builtins for iOS/tvOS/watchOS to ensure that we don't
2995
2999
# have linker errors when building apps for such platforms.
0 commit comments