Skip to content

[Build System] Remove tvOS i386 slice from compiler-rt lib #34361

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 2 commits into from
Oct 20, 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
19 changes: 16 additions & 3 deletions utils/build-script-impl
Original file line number Diff line number Diff line change
Expand Up @@ -1385,7 +1385,11 @@ function copy_embedded_compiler_rt_builtins_from_darwin_host_toolchain() {
DEST_LIB_PATH="${DEST_BUILTINS_DIR}/${LIB_NAME}"
if [[ ! -f "${DEST_LIB_PATH}" ]]; then
if [[ -f "${HOST_LIB_PATH}" ]]; then
call cp "${HOST_LIB_PATH}" "${DEST_LIB_PATH}"
if [[ "$OS" == "tvos" ]]; then
call lipo -remove i386 "${HOST_LIB_PATH}" -output "${DEST_LIB_PATH}"
else
call cp "${HOST_LIB_PATH}" "${DEST_LIB_PATH}"
fi
elif [[ "${VERBOSE_BUILD}" ]]; then
echo "no file exists at ${HOST_LIB_PATH}"
fi
Expand All @@ -1397,7 +1401,11 @@ function copy_embedded_compiler_rt_builtins_from_darwin_host_toolchain() {
DEST_SIM_LIB_PATH="${DEST_BUILTINS_DIR}/${SIM_LIB_NAME}"
if [[ ! -f "${DEST_SIM_LIB_PATH}" ]]; then
if [[ -f "${HOST_SIM_LIB_PATH}" ]]; then
call cp "${HOST_SIM_LIB_PATH}" "${DEST_SIM_LIB_PATH}"
if [[ "$OS" == "tvos" ]]; then
call lipo -remove i386 "${HOST_SIM_LIB_PATH}" -output "${DEST_SIM_LIB_PATH}"
else
call cp "${HOST_SIM_LIB_PATH}" "${DEST_SIM_LIB_PATH}"
fi
elif [[ -f "${HOST_LIB_PATH}" ]]; then
# The simulator .a might not exist if the host
# Xcode is old. In that case, copy over the
Expand All @@ -1406,7 +1414,12 @@ function copy_embedded_compiler_rt_builtins_from_darwin_host_toolchain() {
# 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_SIM_LIB_PATH}"
if [[ "$OS" == "tvos" ]]; then
echo "Remove i386 from tvOS ${DEST_SIM_LIB_PATH}"
call lipo -remove i386 "${HOST_LIB_PATH}" -output "${DEST_SIM_LIB_PATH}"
else
call cp "${HOST_LIB_PATH}" "${DEST_SIM_LIB_PATH}"
fi
elif [[ "${VERBOSE_BUILD}" ]]; then
echo "no file exists at ${HOST_SIM_LIB_PATH}"
fi
Expand Down