summaryrefslogtreecommitdiff
path: root/scripts/strip.sh
diff options
context:
space:
mode:
author Wei Li <weiwli@google.com> 2023-12-12 18:08:40 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2023-12-12 18:08:40 +0000
commitb22fb3598107e8ec8851f901b03404f24e812d3a (patch)
treec7d895a398a18bf76f31214cc3c3e4c352d1b787 /scripts/strip.sh
parent284ec6a2d7631db621179837301410258103e294 (diff)
parent26d380bf2292eb2d4c3b3ed492291373bbecc14c (diff)
Merge "Build native libraries used by layoutlib." into main am: c1fb159206 am: 1529f7f8de am: 26d380bf22
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2868429 Change-Id: I39c8c98c0ac4612ce1acdc9629ae7e5866d8e80c Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'scripts/strip.sh')
-rwxr-xr-xscripts/strip.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/scripts/strip.sh b/scripts/strip.sh
index 71cb1c682..8d69f0d12 100755
--- a/scripts/strip.sh
+++ b/scripts/strip.sh
@@ -29,6 +29,7 @@
# --keep-symbols
# --keep-symbols-and-debug-frame
# --remove-build-id
+# --windows
set -o pipefail
@@ -43,6 +44,7 @@ Options:
--keep-symbols Keep symbols in out-file
--keep-symbols-and-debug-frame Keep symbols and .debug_frame in out-file
--remove-build-id Remove the gnu build-id section in out-file
+ --windows Input file is Windows DLL or executable
EOF
exit 1
}
@@ -50,7 +52,11 @@ EOF
do_strip() {
# GNU strip --strip-all does not strip .ARM.attributes,
# so we tell llvm-strip to keep it too.
- "${CLANG_BIN}/llvm-strip" --strip-all --keep-section=.ARM.attributes "${infile}" -o "${outfile}.tmp"
+ local keep_section=--keep-section=.ARM.attributes
+ if [ -n "${windows}" ]; then
+ keep_section=
+ fi
+ "${CLANG_BIN}/llvm-strip" --strip-all ${keep_section} "${infile}" -o "${outfile}.tmp"
}
do_strip_keep_symbols_and_debug_frame() {
@@ -149,6 +155,7 @@ while getopts $OPTSTRING opt; do
keep-symbols) keep_symbols=true ;;
keep-symbols-and-debug-frame) keep_symbols_and_debug_frame=true ;;
remove-build-id) remove_build_id=true ;;
+ windows) windows=true ;;
*) echo "Unknown option --${OPTARG}"; usage ;;
esac;;
?) usage ;;