@@ -1385,7 +1385,11 @@ function copy_embedded_compiler_rt_builtins_from_darwin_host_toolchain() {
1385
1385
DEST_LIB_PATH=" ${DEST_BUILTINS_DIR} /${LIB_NAME} "
1386
1386
if [[ ! -f " ${DEST_LIB_PATH} " ]]; then
1387
1387
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
1389
1393
elif [[ " ${VERBOSE_BUILD} " ]]; then
1390
1394
echo " no file exists at ${HOST_LIB_PATH} "
1391
1395
fi
@@ -1397,7 +1401,11 @@ function copy_embedded_compiler_rt_builtins_from_darwin_host_toolchain() {
1397
1401
DEST_SIM_LIB_PATH=" ${DEST_BUILTINS_DIR} /${SIM_LIB_NAME} "
1398
1402
if [[ ! -f " ${DEST_SIM_LIB_PATH} " ]]; then
1399
1403
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
1401
1409
elif [[ -f " ${HOST_LIB_PATH} " ]]; then
1402
1410
# The simulator .a might not exist if the host
1403
1411
# Xcode is old. In that case, copy over the
@@ -1406,7 +1414,12 @@ function copy_embedded_compiler_rt_builtins_from_darwin_host_toolchain() {
1406
1414
# slices in Xcode that doesn't have the simulator .a, so
1407
1415
# the link is still valid.
1408
1416
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
1410
1423
elif [[ " ${VERBOSE_BUILD} " ]]; then
1411
1424
echo " no file exists at ${HOST_SIM_LIB_PATH} "
1412
1425
fi
0 commit comments