Skip to content

Commit 9b790d0

Browse files
authored
Merge pull request swiftlang#33323 from apple/shahmishal/support-cross-compile-host
Fix cross compile for Apple Silicon toolchains
2 parents 0e03628 + 9adbace commit 9b790d0

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

utils/build-script-impl

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2468,13 +2468,15 @@ for host in "${ALL_HOSTS[@]}"; do
24682468
executable_target=
24692469
results_targets=
24702470
if ! [[ "${SKIP_TEST_SWIFT}" ]]; then
2471-
executable_target=SwiftUnitTests
2472-
results_targets=("${SWIFT_TEST_TARGETS[@]}")
2473-
if [[ "${STRESS_TEST_SOURCEKIT}" ]]; then
2474-
results_targets=(
2475-
"${results_targets[@]}"
2476-
stress-SourceKit
2477-
)
2471+
if ! [[ $(is_cross_tools_host ${host}) ]] ; then
2472+
executable_target=SwiftUnitTests
2473+
results_targets=("${SWIFT_TEST_TARGETS[@]}")
2474+
if [[ "${STRESS_TEST_SOURCEKIT}" ]]; then
2475+
results_targets=(
2476+
"${results_targets[@]}"
2477+
stress-SourceKit
2478+
)
2479+
fi
24782480
fi
24792481
fi
24802482
if ! [[ "${SKIP_TEST_BENCHMARKS}" ]]; then
@@ -2491,6 +2493,10 @@ for host in "${ALL_HOSTS[@]}"; do
24912493
if [[ "${SKIP_TEST_LLDB}" ]]; then
24922494
continue
24932495
fi
2496+
if [[ $(is_cross_tools_host ${host}) ]]; then
2497+
echo "--- Can't execute tests for ${host}, skipping... ---"
2498+
continue
2499+
fi
24942500
llvm_build_dir=$(build_directory ${host} llvm)
24952501
lldb_build_dir=$(build_directory ${host} lldb)
24962502
results_dir="${lldb_build_dir}/test-results"
@@ -2786,7 +2792,11 @@ for host in "${ALL_HOSTS[@]}"; do
27862792
if [[ "${LLVM_INSTALL_COMPONENTS}" == "all" ]] ; then
27872793
INSTALL_TARGETS=install
27882794
elif [[ -n "${LLVM_INSTALL_COMPONENTS}" ]] ; then
2789-
INSTALL_TARGETS=install-$(echo ${LLVM_INSTALL_COMPONENTS} | sed -E 's/;/ install-/g')
2795+
if [[ $(is_cross_tools_host ${host}) && "${LLVM_INSTALL_COMPONENTS}" == *"compiler-rt"* ]]; then
2796+
INSTALL_TARGETS=install-$(echo ${LLVM_INSTALL_COMPONENTS} | sed -E 's/compiler-rt;//g' |sed -E 's/;/ install-/g')
2797+
else
2798+
INSTALL_TARGETS=install-$(echo ${LLVM_INSTALL_COMPONENTS} | sed -E 's/;/ install-/g')
2799+
fi
27902800
fi
27912801
;;
27922802
libcxx)

0 commit comments

Comments
 (0)