Skip to content

Commit 0883836

Browse files
authored
Merge pull request #34361 from apple/shahmishal/r70443440
[Build System] Remove tvOS i386 slice from compiler-rt lib
2 parents 6b1f6c1 + 73dc49f commit 0883836

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

utils/build-script-impl

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1385,7 +1385,11 @@ function copy_embedded_compiler_rt_builtins_from_darwin_host_toolchain() {
13851385
DEST_LIB_PATH="${DEST_BUILTINS_DIR}/${LIB_NAME}"
13861386
if [[ ! -f "${DEST_LIB_PATH}" ]]; then
13871387
if [[ -f "${HOST_LIB_PATH}" ]]; then
1388-
call cp "${HOST_LIB_PATH}" "${DEST_LIB_PATH}"
1388+
if [[ "$OS" == "tvos" ]]; then
1389+
call lipo -remove i386 "${HOST_LIB_PATH}" -output "${DEST_LIB_PATH}"
1390+
else
1391+
call cp "${HOST_LIB_PATH}" "${DEST_LIB_PATH}"
1392+
fi
13891393
elif [[ "${VERBOSE_BUILD}" ]]; then
13901394
echo "no file exists at ${HOST_LIB_PATH}"
13911395
fi
@@ -1397,7 +1401,11 @@ function copy_embedded_compiler_rt_builtins_from_darwin_host_toolchain() {
13971401
DEST_SIM_LIB_PATH="${DEST_BUILTINS_DIR}/${SIM_LIB_NAME}"
13981402
if [[ ! -f "${DEST_SIM_LIB_PATH}" ]]; then
13991403
if [[ -f "${HOST_SIM_LIB_PATH}" ]]; then
1400-
call cp "${HOST_SIM_LIB_PATH}" "${DEST_SIM_LIB_PATH}"
1404+
if [[ "$OS" == "tvos" ]]; then
1405+
call lipo -remove i386 "${HOST_SIM_LIB_PATH}" -output "${DEST_SIM_LIB_PATH}"
1406+
else
1407+
call cp "${HOST_SIM_LIB_PATH}" "${DEST_SIM_LIB_PATH}"
1408+
fi
14011409
elif [[ -f "${HOST_LIB_PATH}" ]]; then
14021410
# The simulator .a might not exist if the host
14031411
# Xcode is old. In that case, copy over the
@@ -1406,7 +1414,12 @@ function copy_embedded_compiler_rt_builtins_from_darwin_host_toolchain() {
14061414
# slices in Xcode that doesn't have the simulator .a, so
14071415
# the link is still valid.
14081416
echo "copying over faux-sim library ${HOST_LIB_PATH} to ${SIM_LIB_NAME}"
1409-
call cp "${HOST_LIB_PATH}" "${DEST_SIM_LIB_PATH}"
1417+
if [[ "$OS" == "tvos" ]]; then
1418+
echo "Remove i386 from tvOS ${DEST_SIM_LIB_PATH}"
1419+
call lipo -remove i386 "${HOST_LIB_PATH}" -output "${DEST_SIM_LIB_PATH}"
1420+
else
1421+
call cp "${HOST_LIB_PATH}" "${DEST_SIM_LIB_PATH}"
1422+
fi
14101423
elif [[ "${VERBOSE_BUILD}" ]]; then
14111424
echo "no file exists at ${HOST_SIM_LIB_PATH}"
14121425
fi

0 commit comments

Comments
 (0)