Skip to content

Commit ab06af8

Browse files
authored
Merge pull request #33155 from hyp/fix-compiler-rt-sim-libs-5.3
[build-script] copy over the simulator libclang_rt.*.a libraries to a…
2 parents 62e6834 + 2e85f09 commit ab06af8

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

utils/build-script-impl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2352,13 +2352,31 @@ for host in "${ALL_HOSTS[@]}"; do
23522352
echo "copying compiler-rt embedded builtins from ${HOST_CXX_BUILTINS_DIR} into the local clang build directory ${DEST_BUILTINS_DIR}."
23532353

23542354
for OS in ios watchos tvos; do
2355+
# Copy over the device .a
23552356
LIB_NAME="libclang_rt.$OS.a"
23562357
HOST_LIB_PATH="$HOST_CXX_BUILTINS_DIR/$LIB_NAME"
23572358
if [[ -f "${HOST_LIB_PATH}" ]]; then
23582359
call cp "${HOST_LIB_PATH}" "${DEST_BUILTINS_DIR}/${LIB_NAME}"
23592360
elif [[ "${VERBOSE_BUILD}" ]]; then
23602361
echo "no file exists at ${HOST_LIB_PATH}"
23612362
fi
2363+
# Copy over the simulator .a
2364+
SIM_LIB_NAME="libclang_rt.${OS}sim.a"
2365+
HOST_SIM_LIB_PATH="$HOST_CXX_BUILTINS_DIR/$SIM_LIB_NAME"
2366+
if [[ -f "${HOST_SIM_LIB_PATH}" ]]; then
2367+
call cp "${HOST_SIM_LIB_PATH}" "${DEST_BUILTINS_DIR}/${SIM_LIB_NAME}"
2368+
elif [[ "${HOST_LIB_PATH}" ]]; then
2369+
# The simulator .a might not exist if the host
2370+
# Xcode is old. In that case, copy over the
2371+
# device library to the simulator location to allow
2372+
# clang to find it. The device library has the simulator
2373+
# slices in Xcode that doesn't have the simulator .a, so
2374+
# the link is still valid.
2375+
echo "copying over faux-sim library ${HOST_LIB_PATH} to ${SIM_LIB_NAME}"
2376+
call cp "${HOST_LIB_PATH}" "${DEST_BUILTINS_DIR}/${SIM_LIB_NAME}"
2377+
elif [[ "${VERBOSE_BUILD}" ]]; then
2378+
echo "no file exists at ${HOST_SIM_LIB_PATH}"
2379+
fi
23622380
done
23632381
done
23642382
fi

0 commit comments

Comments
 (0)