Skip to content

Commit 7af2ceb

Browse files
authored
Merge pull request #37889 from apple/strip-i386-tvos
Strip i386 arch from tvOS simulator lib
2 parents 50fa6cf + a8ae401 commit 7af2ceb

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

utils/build-script-impl

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1457,7 +1457,11 @@ function copy_embedded_compiler_rt_builtins_from_darwin_host_toolchain() {
14571457
DEST_LIB_PATH="${DEST_BUILTINS_DIR}/${LIB_NAME}"
14581458
if [[ ! -f "${DEST_LIB_PATH}" ]]; then
14591459
if [[ -f "${HOST_LIB_PATH}" ]]; then
1460-
call cp "${HOST_LIB_PATH}" "${DEST_LIB_PATH}"
1460+
if [[ "$OS" == "tvos" ]]; then
1461+
call lipo -remove i386 "${HOST_LIB_PATH}" -output "${DEST_LIB_PATH}" || call cp "${HOST_LIB_PATH}" "${DEST_LIB_PATH}"
1462+
else
1463+
call cp "${HOST_LIB_PATH}" "${DEST_LIB_PATH}"
1464+
fi
14611465
elif [[ "${VERBOSE_BUILD}" ]]; then
14621466
echo "no file exists at ${HOST_LIB_PATH}"
14631467
fi
@@ -1469,7 +1473,11 @@ function copy_embedded_compiler_rt_builtins_from_darwin_host_toolchain() {
14691473
DEST_SIM_LIB_PATH="${DEST_BUILTINS_DIR}/${SIM_LIB_NAME}"
14701474
if [[ ! -f "${DEST_SIM_LIB_PATH}" ]]; then
14711475
if [[ -f "${HOST_SIM_LIB_PATH}" ]]; then
1472-
call cp "${HOST_SIM_LIB_PATH}" "${DEST_SIM_LIB_PATH}"
1476+
if [[ "$OS" == "tvos" ]]; then
1477+
call lipo -remove i386 "${HOST_SIM_LIB_PATH}" -output "${DEST_SIM_LIB_PATH}" || call cp "${HOST_SIM_LIB_PATH}" "${DEST_SIM_LIB_PATH}"
1478+
else
1479+
call cp "${HOST_SIM_LIB_PATH}" "${DEST_SIM_LIB_PATH}"
1480+
fi
14731481
elif [[ -f "${HOST_LIB_PATH}" ]]; then
14741482
# The simulator .a might not exist if the host
14751483
# Xcode is old. In that case, copy over the

0 commit comments

Comments
 (0)