aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2018-09-19 15:09:26 -0700
committerColin Cross <ccross@android.com>2018-09-19 23:23:51 +0000
commit8e877af5f48d5ba9419026eb8d1578a311b2af51 (patch)
tree09beae202b6aa2693555dfe03bcba3eda7e2631e /scripts
parent2b2b6a72d39f08c6c7f9e3be8ae62035f170d484 (diff)
downloadbuild_soong-8e877af5f48d5ba9419026eb8d1578a311b2af51.tar.gz
build_soong-8e877af5f48d5ba9419026eb8d1578a311b2af51.tar.bz2
build_soong-8e877af5f48d5ba9419026eb8d1578a311b2af51.zip
Hide warning on static executables in strip.sh
Stripping static executables prints a warning: bash: prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/bin/arm-linux-androideabi-nm: No such file or directory The message is harmless, just hide it. Also turn on pipefail so that the script will exit if the command returns an error. Bug: 24409581 Test: m checkbuild Change-Id: I9647c55c3509e4573e6d4f2f6d88119bdf31e9fb
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/strip.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/strip.sh b/scripts/strip.sh
index cf8f6314..bfc66ee2 100755
--- a/scripts/strip.sh
+++ b/scripts/strip.sh
@@ -29,6 +29,8 @@
# --keep-symbols
# --use-llvm-strip
+set -o pipefail
+
OPTSTRING=d:i:o:-:
usage() {
@@ -83,7 +85,7 @@ do_strip_keep_mini_debug_info() {
# For the following use cases, ${CROSS_COMPILE}objcopy does fine with lld linked files,
# except the --add-section flag.
"${CROSS_COMPILE}objcopy" --only-keep-debug "${infile}" "${outfile}.debug"
- "${CROSS_COMPILE}nm" -D "${infile}" --format=posix --defined-only | awk '{ print $1 }' | sort >"${outfile}.dynsyms"
+ "${CROSS_COMPILE}nm" -D "${infile}" --format=posix --defined-only 2> /dev/null | awk '{ print $1 }' | sort >"${outfile}.dynsyms"
"${CROSS_COMPILE}nm" "${infile}" --format=posix --defined-only | awk '{ if ($2 == "T" || $2 == "t" || $2 == "D") print $1 }' | sort > "${outfile}.funcsyms"
comm -13 "${outfile}.dynsyms" "${outfile}.funcsyms" > "${outfile}.keep_symbols"
echo >> "${outfile}.keep_symbols" # Ensure that the keep_symbols file is not empty.