Skip to content

[build-script] copy over the simulator libclang_rt.*.a libraries to a… #33133

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 28, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions utils/build-script-impl
Original file line number Diff line number Diff line change
Expand Up @@ -2375,13 +2375,31 @@ for host in "${ALL_HOSTS[@]}"; do
echo "copying compiler-rt embedded builtins from ${HOST_CXX_BUILTINS_DIR} into the local clang build directory ${DEST_BUILTINS_DIR}."

for OS in ios watchos tvos; do
# Copy over the device .a
LIB_NAME="libclang_rt.$OS.a"
HOST_LIB_PATH="$HOST_CXX_BUILTINS_DIR/$LIB_NAME"
if [[ -f "${HOST_LIB_PATH}" ]]; then
call cp "${HOST_LIB_PATH}" "${DEST_BUILTINS_DIR}/${LIB_NAME}"
elif [[ "${VERBOSE_BUILD}" ]]; then
echo "no file exists at ${HOST_LIB_PATH}"
fi
# Copy over the simulator .a
SIM_LIB_NAME="libclang_rt.${OS}sim.a"
HOST_SIM_LIB_PATH="$HOST_CXX_BUILTINS_DIR/$SIM_LIB_NAME"
if [[ -f "${HOST_SIM_LIB_PATH}" ]]; then
call cp "${HOST_SIM_LIB_PATH}" "${DEST_BUILTINS_DIR}/${SIM_LIB_NAME}"
elif [[ "${HOST_LIB_PATH}" ]]; then
# The simulator .a might not exist if the host
# Xcode is old. In that case, copy over the
# device library to the simulator location to allow
# clang to find it. The device library has the simulator
# slices in Xcode that doesn't have the simulator .a, so
# the link is still valid.
echo "copying over faux-sim library ${HOST_LIB_PATH} to ${SIM_LIB_NAME}"
call cp "${HOST_LIB_PATH}" "${DEST_BUILTINS_DIR}/${SIM_LIB_NAME}"
elif [[ "${VERBOSE_BUILD}" ]]; then
echo "no file exists at ${HOST_SIM_LIB_PATH}"
fi
done
done
fi
Expand Down