From 5fc7e54900619518beaa3ab5638197f8691b27ce Mon Sep 17 00:00:00 2001 From: Alex Salcianu Date: Fri, 24 Mar 2017 16:54:05 -0400 Subject: [smart-select:] Use a linker version script, to remove even more deadcode. The size of our 32-bit lib went down 264K -> 180K (1K = 1024 bytes). $ mmma -j32 external/libtextclassifier $ ls -sh $OUT/system/lib/libtextclassifier.so 180K /system/lib/libtextclassifier.so $ # :) Treemap info: https://cnsviewer.corp.google.com/cns/ig-d/home/salcianu/libtextclassifier/treemap/android_03_24.3/index.html The gap between the treemap measured code size and the .so file size is now down to 40K, i.e., 22% (down from 43% this morning). Previously, we were using only -fvisibility=hidden for our code. That impacted only the symbols exported from our code, not the symbols from the static libs we depend on. The linker script handles everything. Test: manual test that everything builds + inspection of treemap info. All required code seems to be linked in. Change-Id: I00bfea854a80ef365b229632d2af259c938159c2 --- jni.lds | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 jni.lds (limited to 'jni.lds') diff --git a/jni.lds b/jni.lds new file mode 100644 index 0000000..75d5bc5 --- /dev/null +++ b/jni.lds @@ -0,0 +1,9 @@ +{ + # Export symbols that correspond to our JNIEXPORTed functions. + global: + Java_android_view_textclassifier_*; + + # Hide everything else. + local: + *; +}; -- cgit v1.2.3