@@ -1404,7 +1404,11 @@ function copy_embedded_compiler_rt_builtins_from_darwin_host_toolchain() {
1404
1404
DEST_LIB_PATH=" ${DEST_BUILTINS_DIR} /${LIB_NAME} "
1405
1405
if [[ ! -f " ${DEST_LIB_PATH} " ]]; then
1406
1406
if [[ -f " ${HOST_LIB_PATH} " ]]; then
1407
- call cp " ${HOST_LIB_PATH} " " ${DEST_LIB_PATH} "
1407
+ if [[ " $OS " == " tvos" ]]; then
1408
+ call lipo -remove i386 " ${HOST_LIB_PATH} " -output " ${DEST_LIB_PATH} "
1409
+ else
1410
+ call cp " ${HOST_LIB_PATH} " " ${DEST_LIB_PATH} "
1411
+ fi
1408
1412
elif [[ " ${VERBOSE_BUILD} " ]]; then
1409
1413
echo " no file exists at ${HOST_LIB_PATH} "
1410
1414
fi
@@ -1416,7 +1420,11 @@ function copy_embedded_compiler_rt_builtins_from_darwin_host_toolchain() {
1416
1420
DEST_SIM_LIB_PATH=" ${DEST_BUILTINS_DIR} /${SIM_LIB_NAME} "
1417
1421
if [[ ! -f " ${DEST_SIM_LIB_PATH} " ]]; then
1418
1422
if [[ -f " ${HOST_SIM_LIB_PATH} " ]]; then
1419
- call cp " ${HOST_SIM_LIB_PATH} " " ${DEST_SIM_LIB_PATH} "
1423
+ if [[ " $OS " == " tvos" ]]; then
1424
+ call lipo -remove i386 " ${HOST_SIM_LIB_PATH} " -output " ${DEST_SIM_LIB_PATH} "
1425
+ else
1426
+ call cp " ${HOST_SIM_LIB_PATH} " " ${DEST_SIM_LIB_PATH} "
1427
+ fi
1420
1428
elif [[ -f " ${HOST_LIB_PATH} " ]]; then
1421
1429
# The simulator .a might not exist if the host
1422
1430
# Xcode is old. In that case, copy over the
@@ -1425,7 +1433,12 @@ function copy_embedded_compiler_rt_builtins_from_darwin_host_toolchain() {
1425
1433
# slices in Xcode that doesn't have the simulator .a, so
1426
1434
# the link is still valid.
1427
1435
echo " copying over faux-sim library ${HOST_LIB_PATH} to ${SIM_LIB_NAME} "
1428
- call cp " ${HOST_LIB_PATH} " " ${DEST_SIM_LIB_PATH} "
1436
+ if [[ " $OS " == " tvos" ]]; then
1437
+ echo " Remove i386 from tvOS ${DEST_SIM_LIB_PATH} "
1438
+ call lipo -remove i386 " ${HOST_LIB_PATH} " -output " ${DEST_SIM_LIB_PATH} "
1439
+ else
1440
+ call cp " ${HOST_LIB_PATH} " " ${DEST_SIM_LIB_PATH} "
1441
+ fi
1429
1442
elif [[ " ${VERBOSE_BUILD} " ]]; then
1430
1443
echo " no file exists at ${HOST_SIM_LIB_PATH} "
1431
1444
fi
0 commit comments