Skip to content

Commit 39ee89f

Browse files
committed
[Apple Silicon] Build system configuration to support arm64 macOS
1 parent 824a3e6 commit 39ee89f

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

utils/build-script-impl

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -975,6 +975,9 @@ function get_host_install_destdir() {
975975
if [[ $(should_include_host_in_lipo ${host}) ]]; then
976976
# If this is one of the hosts we should lipo, install in to a temporary subdirectory.
977977
local host_install_destdir="${BUILD_DIR}/intermediate-install/${host}"
978+
elif [[ "${host}" == "merged-hosts" ]]; then
979+
# This assumes that all hosts are merged to the lipo.
980+
local host_install_destdir="${INSTALL_DESTDIR}"
978981
else
979982
local host_install_destdir="${INSTALL_DESTDIR}/${host}"
980983
fi
@@ -1036,7 +1039,7 @@ function should_include_host_in_lipo() {
10361039
local host="$1"
10371040
if [[ $(has_cross_compile_hosts) ]] && [[ -z "${SKIP_MERGE_LIPO_CROSS_COMPILE_TOOLS}" ]]; then
10381041
case ${host} in
1039-
iphone* | appletv* | watch* )
1042+
macosx* | iphone* | appletv* | watch* )
10401043
echo 1
10411044
;;
10421045
esac
@@ -2831,6 +2834,15 @@ for host in "${ALL_HOSTS[@]}"; do
28312834
if [[ "${DARWIN_INSTALL_EXTRACT_SYMBOLS}" ]] && [[ $(host_has_darwin_symbols ${host}) ]]; then
28322835
echo "--- Extracting symbols ---"
28332836

2837+
# The usage for this script says that lipo happens before
2838+
# dsym extraction but that's not really what happens. At this point,
2839+
# we're processing an individual host (eg macosx-x86_64) but targeting
2840+
# the (shared) SYMROOT which can cause mutliple hosts to stomp on each
2841+
# other. As a hack, I'm segregating the hosts in the symroot but it
2842+
# would probably be better to make the script behave as the usage
2843+
# descibes
2844+
host_symroot="${INSTALL_SYMROOT}/${host}"
2845+
28342846
# FIXME: Since it's hard to trace output pipe call,
28352847
# For now, We don't support dry-run trace for this block
28362848
# Instead, just echo we do "darwin_intall_extract_symbols".
@@ -2845,7 +2857,7 @@ for host in "${ALL_HOSTS[@]}"; do
28452857
# Copy executables and shared libraries from the `host_install_destdir` to
28462858
# INSTALL_SYMROOT and run dsymutil on them.
28472859
(cd "${CURRENT_INSTALL_DIR}" &&
2848-
find ./"${CURRENT_PREFIX}" -perm -0111 -type f -print | cpio --insecure -pdm "${INSTALL_SYMROOT}")
2860+
find ./"${CURRENT_PREFIX}" -perm -0111 -type f -print | cpio --insecure -pdm "${host_symroot}")
28492861

28502862
dsymutil_path=
28512863
if [[ -n "${DARWIN_INSTALL_EXTRACT_SYMBOLS_USE_JUST_BUILT_DSYMUTIL}" ]]; then
@@ -2858,7 +2870,7 @@ for host in "${ALL_HOSTS[@]}"; do
28582870
#
28592871
# Exclude shell scripts and static archives.
28602872
# Exclude swift-api-digester dSYM to reduce debug toolchain size.
2861-
(cd "${INSTALL_SYMROOT}" &&
2873+
(cd "${host_symroot}" &&
28622874
find ./"${CURRENT_PREFIX}" -perm -0111 -type f -print | \
28632875
grep -v '.py$' | \
28642876
grep -v '.a$' | \

0 commit comments

Comments
 (0)