Skip to content

Commit 813f5d2

Browse files
committed
Restore logic dropped during the merge resolution
1 parent b07c940 commit 813f5d2

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

utils/build-script-impl

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1375,12 +1375,16 @@ function copy_embedded_compiler_rt_builtins_from_darwin_host_toolchain() {
13751375
echo "copying compiler-rt embedded builtins from ${HOST_CXX_BUILTINS_DIR} into the local clang build directory ${DEST_BUILTINS_DIR}."
13761376

13771377
for OS in ios watchos tvos; do
1378+
# Copy over the device .a when necessary
13781379
LIB_NAME="libclang_rt.$OS.a"
13791380
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
13841388
fi
13851389

13861390
# Copy over the simulator .a when necessary
@@ -2989,7 +2993,7 @@ for host in "${ALL_HOSTS[@]}"; do
29892993
build_dir=$(build_directory ${host} ${product})
29902994

29912995
call env DESTDIR="${host_install_destdir}" "${CMAKE_BUILD[@]}" "${build_dir}" -- ${INSTALL_TARGETS}
2992-
2996+
29932997
# When we are installing LLVM copy over the compiler-rt
29942998
# builtins for iOS/tvOS/watchOS to ensure that we don't
29952999
# have linker errors when building apps for such platforms.

0 commit comments

Comments
 (0)