@@ -1420,7 +1420,11 @@ function copy_embedded_compiler_rt_builtins_from_darwin_host_toolchain() {
1420
1420
DEST_LIB_PATH=" ${DEST_BUILTINS_DIR} /${LIB_NAME} "
1421
1421
if [[ ! -f " ${DEST_LIB_PATH} " ]]; then
1422
1422
if [[ -f " ${HOST_LIB_PATH} " ]]; then
1423
- call cp " ${HOST_LIB_PATH} " " ${DEST_LIB_PATH} "
1423
+ if [[ " $OS " == " tvos" ]]; then
1424
+ call lipo -remove i386 " ${HOST_LIB_PATH} " -output " ${DEST_LIB_PATH} "
1425
+ else
1426
+ call cp " ${HOST_LIB_PATH} " " ${DEST_LIB_PATH} "
1427
+ fi
1424
1428
elif [[ " ${VERBOSE_BUILD} " ]]; then
1425
1429
echo " no file exists at ${HOST_LIB_PATH} "
1426
1430
fi
@@ -1432,7 +1436,11 @@ function copy_embedded_compiler_rt_builtins_from_darwin_host_toolchain() {
1432
1436
DEST_SIM_LIB_PATH=" ${DEST_BUILTINS_DIR} /${SIM_LIB_NAME} "
1433
1437
if [[ ! -f " ${DEST_SIM_LIB_PATH} " ]]; then
1434
1438
if [[ -f " ${HOST_SIM_LIB_PATH} " ]]; then
1435
- call cp " ${HOST_SIM_LIB_PATH} " " ${DEST_SIM_LIB_PATH} "
1439
+ if [[ " $OS " == " tvos" ]]; then
1440
+ call lipo -remove i386 " ${HOST_SIM_LIB_PATH} " -output " ${DEST_SIM_LIB_PATH} "
1441
+ else
1442
+ call cp " ${HOST_SIM_LIB_PATH} " " ${DEST_SIM_LIB_PATH} "
1443
+ fi
1436
1444
elif [[ -f " ${HOST_LIB_PATH} " ]]; then
1437
1445
# The simulator .a might not exist if the host
1438
1446
# Xcode is old. In that case, copy over the
@@ -1441,7 +1449,12 @@ function copy_embedded_compiler_rt_builtins_from_darwin_host_toolchain() {
1441
1449
# slices in Xcode that doesn't have the simulator .a, so
1442
1450
# the link is still valid.
1443
1451
echo " copying over faux-sim library ${HOST_LIB_PATH} to ${SIM_LIB_NAME} "
1444
- call cp " ${HOST_LIB_PATH} " " ${DEST_SIM_LIB_PATH} "
1452
+ if [[ " $OS " == " tvos" ]]; then
1453
+ echo " Remove i386 from tvOS ${DEST_SIM_LIB_PATH} "
1454
+ call lipo -remove i386 " ${HOST_LIB_PATH} " -output " ${DEST_SIM_LIB_PATH} "
1455
+ else
1456
+ call cp " ${HOST_LIB_PATH} " " ${DEST_SIM_LIB_PATH} "
1457
+ fi
1445
1458
elif [[ " ${VERBOSE_BUILD} " ]]; then
1446
1459
echo " no file exists at ${HOST_SIM_LIB_PATH} "
1447
1460
fi
0 commit comments