Skip to content

Commit cc2c424

Browse files
committed
[Build System] Remove tvOS i386 slice from compiler-rt lib
To fix this issue: ld: building for tvOS, but linking in object file built for tvOS Simulator, file '/tmp/strip.rgKCdx' for architecture i386 fatal error: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip: internal link edit command failed rdar://70443440 (cherry picked from commit cc542c0)
1 parent ade7c73 commit cc2c424

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

utils/build-script-impl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1425,7 +1425,12 @@ function copy_embedded_compiler_rt_builtins_from_darwin_host_toolchain() {
14251425
# slices in Xcode that doesn't have the simulator .a, so
14261426
# the link is still valid.
14271427
echo "copying over faux-sim library ${HOST_LIB_PATH} to ${SIM_LIB_NAME}"
1428-
call cp "${HOST_LIB_PATH}" "${DEST_SIM_LIB_PATH}"
1428+
if [[ "$OS" == "tvos" ]]; then
1429+
echo "Remove i386 from tvOS ${DEST_SIM_LIB_PATH}"
1430+
call lipo -remove i386 "${HOST_LIB_PATH}" -output "${DEST_SIM_LIB_PATH}"
1431+
else
1432+
call cp "${HOST_LIB_PATH}" "${DEST_SIM_LIB_PATH}"
1433+
fi
14291434
elif [[ "${VERBOSE_BUILD}" ]]; then
14301435
echo "no file exists at ${HOST_SIM_LIB_PATH}"
14311436
fi

0 commit comments

Comments
 (0)