aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2018-09-05 13:14:09 -0700
committerColin Cross <ccross@android.com>2018-09-05 16:30:16 -0700
commit02b04bb2996b804b5fff148551f2e6cee71ce412 (patch)
tree5fb7f3af764c753bf97f946acae79fee203f8d4c /scripts
parentf843290eb84755b96adf8284ec91864b1ffdfec6 (diff)
downloadbuild_soong-02b04bb2996b804b5fff148551f2e6cee71ce412.tar.gz
build_soong-02b04bb2996b804b5fff148551f2e6cee71ce412.tar.bz2
build_soong-02b04bb2996b804b5fff148551f2e6cee71ce412.zip
Allow strip.sh --keep-mini-debug-info to work on non-elf files
strip.sh --keep-mini-debug-info matches the default for Make, and is currently used on lots of files that are not elf files. For now, just make the behavior match Make and skip files when strip --strip-all fails. Bug: 113936524 Test: m checkbuild Change-Id: I3648c914c0fd7cc9b68aa93fd3cb0b77504d42f6
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/strip.sh7
1 files changed, 4 insertions, 3 deletions
diff --git a/scripts/strip.sh b/scripts/strip.sh
index 8f89a925..d184a974 100755
--- a/scripts/strip.sh
+++ b/scripts/strip.sh
@@ -71,12 +71,13 @@ do_strip_keep_symbols() {
do_strip_keep_mini_debug_info() {
rm -f "${outfile}.dynsyms" "${outfile}.funcsyms" "${outfile}.keep_symbols" "${outfile}.debug" "${outfile}.mini_debuginfo" "${outfile}.mini_debuginfo.xz"
+ local fail=
if [ ! -z "${use_llvm_strip}" ]; then
- "${CLANG_BIN}/llvm-strip" --strip-all -keep=.ARM.attributes -remove-section=.comment "${infile}" "${outfile}.tmp"
+ "${CLANG_BIN}/llvm-strip" --strip-all -keep=.ARM.attributes -remove-section=.comment "${infile}" "${outfile}.tmp" || fail=true
else
- "${CROSS_COMPILE}strip" --strip-all -R .comment "${infile}" -o "${outfile}.tmp"
+ "${CROSS_COMPILE}strip" --strip-all -R .comment "${infile}" -o "${outfile}.tmp" || fail=true
fi
- if [ "$?" == "0" ]; then
+ if [ -z $fail ]; then
# Current prebult llvm-objcopy does not support the following flags:
# --only-keep-debug --rename-section --keep-symbols
# For the following use cases, ${CROSS_COMPILE}objcopy does fine with lld linked files,