Skip to content

Commit a58e8c1

Browse files
authored
Merge pull request swiftlang#37890 from apple/strip-i386-tvos-5.5
Strip i386 arch from tvOS simulator lib
2 parents 5190907 + 36c156e commit a58e8c1

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
@@ -1447,7 +1447,11 @@ function copy_embedded_compiler_rt_builtins_from_darwin_host_toolchain() {
14471447
DEST_LIB_PATH="${DEST_BUILTINS_DIR}/${LIB_NAME}"
14481448
if [[ ! -f "${DEST_LIB_PATH}" ]]; then
14491449
if [[ -f "${HOST_LIB_PATH}" ]]; then
1450-
call cp "${HOST_LIB_PATH}" "${DEST_LIB_PATH}"
1450+
if [[ "$OS" == "tvos" ]]; then
1451+
call lipo -remove i386 "${HOST_LIB_PATH}" -output "${DEST_LIB_PATH}" || call cp "${HOST_LIB_PATH}" "${DEST_LIB_PATH}"
1452+
else
1453+
call cp "${HOST_LIB_PATH}" "${DEST_LIB_PATH}"
1454+
fi
14511455
elif [[ "${VERBOSE_BUILD}" ]]; then
14521456
echo "no file exists at ${HOST_LIB_PATH}"
14531457
fi
@@ -1459,7 +1463,11 @@ function copy_embedded_compiler_rt_builtins_from_darwin_host_toolchain() {
14591463
DEST_SIM_LIB_PATH="${DEST_BUILTINS_DIR}/${SIM_LIB_NAME}"
14601464
if [[ ! -f "${DEST_SIM_LIB_PATH}" ]]; then
14611465
if [[ -f "${HOST_SIM_LIB_PATH}" ]]; then
1462-
call cp "${HOST_SIM_LIB_PATH}" "${DEST_SIM_LIB_PATH}"
1466+
if [[ "$OS" == "tvos" ]]; then
1467+
call lipo -remove i386 "${HOST_SIM_LIB_PATH}" -output "${DEST_SIM_LIB_PATH}" || call cp "${HOST_SIM_LIB_PATH}" "${DEST_SIM_LIB_PATH}"
1468+
else
1469+
call cp "${HOST_SIM_LIB_PATH}" "${DEST_SIM_LIB_PATH}"
1470+
fi
14631471
elif [[ -f "${HOST_LIB_PATH}" ]]; then
14641472
# The simulator .a might not exist if the host
14651473
# Xcode is old. In that case, copy over the

0 commit comments

Comments
 (0)