Skip to content

Commit 1fda005

Browse files
committed
Just cp compiler-rt Files If lipo Fails
This workaround to remove legacy architectures from the .a's can fail. When that happens, it usually means i386 was not among any of the slices to begin with, so just copy the library out to its destination.
1 parent 59a218a commit 1fda005

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

utils/build-script-impl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1416,7 +1416,7 @@ function copy_embedded_compiler_rt_builtins_from_darwin_host_toolchain() {
14161416
if [[ ! -f "${DEST_LIB_PATH}" ]]; then
14171417
if [[ -f "${HOST_LIB_PATH}" ]]; then
14181418
if [[ "$OS" == "tvos" ]]; then
1419-
call lipo -remove i386 "${HOST_LIB_PATH}" -output "${DEST_LIB_PATH}"
1419+
call lipo -remove i386 "${HOST_LIB_PATH}" -output "${DEST_LIB_PATH}" || call cp "${HOST_LIB_PATH}" "${DEST_LIB_PATH}"
14201420
else
14211421
call cp "${HOST_LIB_PATH}" "${DEST_LIB_PATH}"
14221422
fi
@@ -1432,7 +1432,7 @@ function copy_embedded_compiler_rt_builtins_from_darwin_host_toolchain() {
14321432
if [[ ! -f "${DEST_SIM_LIB_PATH}" ]]; then
14331433
if [[ -f "${HOST_SIM_LIB_PATH}" ]]; then
14341434
if [[ "$OS" == "tvos" ]]; then
1435-
call lipo -remove i386 "${HOST_SIM_LIB_PATH}" -output "${DEST_SIM_LIB_PATH}"
1435+
call lipo -remove i386 "${HOST_SIM_LIB_PATH}" -output "${DEST_SIM_LIB_PATH}" || call cp "${HOST_SIM_LIB_PATH}" "${DEST_SIM_LIB_PATH}"
14361436
else
14371437
call cp "${HOST_SIM_LIB_PATH}" "${DEST_SIM_LIB_PATH}"
14381438
fi

0 commit comments

Comments
 (0)