Skip to content

Commit f352660

Browse files
committed
[build-script-impl] By default use the just built dsymutil to ensure that when we use the newer LLVM, the dsymutil supports newer debug info.
This can be disabled via the build-script-impl flag: darwin-install-extract-symbols-use-just-built-dsymutil
1 parent 67b2e7f commit f352660

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

utils/build-script-impl

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ KNOWN_SETTINGS=(
101101
darwin-deployment-version-tvos "9.0" "minimum deployment target version for tvOS"
102102
darwin-deployment-version-watchos "2.0" "minimum deployment target version for watchOS"
103103
darwin-install-extract-symbols "" "whether to extract symbols with dsymutil during installations"
104+
darwin-install-extract-symbols-use-just-built-dsymutil "1" "whether we should extract symbols using the just built dsymutil"
104105
darwin-overlay-target "" "single overlay target to build, dependencies are computed later"
105106
darwin-sdk-deployment-targets "xctest-ios-8.0" "semicolon-separated list of triples like 'fookit-ios-9.0;barkit-watchos-9.0'"
106107
darwin-stdlib-install-name-dir "" "the directory of the install_name for standard library dylibs"
@@ -866,6 +867,10 @@ function xcrun_find_tool() {
866867
xcrun --sdk macosx --toolchain "${DARWIN_XCRUN_TOOLCHAIN}" --find "$@"
867868
}
868869

870+
function find_just_built_local_host_llvm_tool() {
871+
find $(build_directory "${LOCAL_HOST}" llvm) -name "$1" -type f -print
872+
}
873+
869874
function not() {
870875
if [[ ! "$1" ]] ; then
871876
echo 1
@@ -2846,14 +2851,21 @@ for host in "${ALL_HOSTS[@]}"; do
28462851
(cd "${CURRENT_INSTALL_DIR}" &&
28472852
find ./"${CURRENT_PREFIX}" -perm -0111 -type f -print | cpio --insecure -pdm "${INSTALL_SYMROOT}")
28482853

2854+
dsymutil_path=
2855+
if [[ -n "${DARWIN_INSTALL_EXTRACT_SYMBOLS_USE_JUST_BUILT_DSYMUTIL}" ]]; then
2856+
dsymutil_path=$(find_just_built_local_host_llvm_tool dsymutil)
2857+
else
2858+
dsymutil_path=$(xcrun_find_tool dsymutil)
2859+
fi
2860+
28492861
# Run dsymutil on executables and shared libraries.
28502862
#
28512863
# Exclude shell scripts and static archives.
28522864
(cd "${INSTALL_SYMROOT}" &&
28532865
find ./"${CURRENT_PREFIX}" -perm -0111 -type f -print | \
28542866
grep -v '.py$' | \
28552867
grep -v '.a$' | \
2856-
xargs -n 1 -P ${BUILD_JOBS} $(xcrun_find_tool dsymutil))
2868+
xargs -n 1 -P ${BUILD_JOBS} ${dsymutil_path})
28572869

28582870
# Strip executables, shared libraries and static libraries in
28592871
# `host_install_destdir`.

0 commit comments

Comments
 (0)