Skip to content

Commit 66c57db

Browse files
[Android] Strip .so for Release build (#6443)
ghstack-source-id: bd8ae69 Pull Request resolved: #6441 --------- Co-authored-by: Hansong Zhang <[email protected]>
1 parent d192b1f commit 66c57db

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

build/build_android_llm_demo.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ build_aar() {
112112
# Rename libexecutorch_jni.so to libexecutorch.so for soname consistency
113113
# between Java and JNI
114114
find jni -type f -name "libexecutorch_jni.so" -exec bash -c 'mv "$1" "${1/_jni/}"' bash {} \;
115+
if [ "$EXECUTORCH_CMAKE_BUILD_TYPE" == "Release" ]; then
116+
find jni -type f -name "*.so" -exec "$ANDROID_NDK"/toolchains/llvm/prebuilt/*/bin/llvm-strip {} \;
117+
fi
115118
# Zip all necessary files into the AAR file
116119
zip -r executorch.aar libs jni/*/libexecutorch.so jni/*/libqnn*.so jni/*/libQnn*.so jni/*/libneuron_backend.so jni/*/libneuron_buffer_allocator.so jni/*/libneuronusdk_adapter.mtk.so AndroidManifest.xml
117120
popd

0 commit comments

Comments
 (0)