Skip to content

Commit ecbe758

Browse files
authored
Merge pull request #71986 from kubamracek/dont-strip-builtins
[build-script] Avoid stripping clang builtin .a libraries when extracting dSYMs on Darwin
2 parents cc50cc8 + 0f2cbbf commit ecbe758

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

utils/build-script-impl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3230,20 +3230,21 @@ for host in "${ALL_HOSTS[@]}"; do
32303230
printJSONStartTimestamp dsymutil
32313231
(cd "${host_symroot}" &&
32323232
find ./"${CURRENT_PREFIX}" -perm -0111 -type f -not -name "*.a" -not -name "*.py" -print | \
3233-
xargs -n 1 -P ${DSYMUTIL_JOBS} ${dsymutil_path})
3233+
xargs -t -n 1 -P ${DSYMUTIL_JOBS} ${dsymutil_path})
32343234
printJSONEndTimestamp dsymutil
32353235

32363236
# Strip executables, shared libraries and static libraries in
3237-
# `host_install_destdir`.
3237+
# `host_install_destdir`. Avoid touching clang builtins .a files.
32383238
find "${CURRENT_INSTALL_DIR}${CURRENT_PREFIX}/" \
32393239
'(' -perm -0111 -or -name "*.a" ')' -type f -print | \
3240-
xargs -n 1 -P ${BUILD_JOBS} $(xcrun_find_tool strip) -S
3240+
grep_that_allows_no_matches -v "/clang/lib/darwin/" | \
3241+
xargs -t -n 1 -P ${BUILD_JOBS} $(xcrun_find_tool strip) -S
32413242

32423243
# Codesign dylibs and executables in usr/bin after strip tool
32433244
# rdar://45388785
32443245
find "${CURRENT_INSTALL_DIR}${CURRENT_PREFIX}/" \
32453246
'(' '(' -path "*/usr/bin/*" -and -perm -0111 ')' -or -name "*.dylib" ')' -type f -print | \
3246-
xargs -n 1 -P ${BUILD_JOBS} $(xcrun_find_tool codesign) -f -s -
3247+
xargs -t -n 1 -P ${BUILD_JOBS} $(xcrun_find_tool codesign) -f -s -
32473248
fi
32483249

32493250
{ set +x; } 2>/dev/null

validation-test/BuildSystem/dsymutil_jobs.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88

99
# CHECK: --- Extracting symbols ---
1010
# CHECK: { "command": "dsymutil", "start": "
11-
# CHECK: xargs -n 1 -P 5 {{.*}}dsymutil
11+
# CHECK: xargs -t -n 1 -P 5 {{.*}}dsymutil
1212
# CHECK: { "command": "dsymutil", "end": "

0 commit comments

Comments
 (0)