Skip to content

Commit cc542c0

Browse files
authored
[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
1 parent 50e6ae0 commit cc542c0

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
@@ -1406,7 +1406,12 @@ function copy_embedded_compiler_rt_builtins_from_darwin_host_toolchain() {
14061406
# slices in Xcode that doesn't have the simulator .a, so
14071407
# the link is still valid.
14081408
echo "copying over faux-sim library ${HOST_LIB_PATH} to ${SIM_LIB_NAME}"
1409-
call cp "${HOST_LIB_PATH}" "${DEST_SIM_LIB_PATH}"
1409+
if [[ "$OS" == "tvos" ]]; then
1410+
echo "Remove i386 from tvOS ${DEST_SIM_LIB_PATH}"
1411+
call lipo -remove i386 "${HOST_LIB_PATH}" -output "${DEST_SIM_LIB_PATH}"
1412+
else
1413+
call cp "${HOST_LIB_PATH}" "${DEST_SIM_LIB_PATH}"
1414+
fi
14101415
elif [[ "${VERBOSE_BUILD}" ]]; then
14111416
echo "no file exists at ${HOST_SIM_LIB_PATH}"
14121417
fi

0 commit comments

Comments
 (0)