diff options
author | Tor Lillqvist <tml@iki.fi> | 2012-11-16 16:17:27 +0200 |
---|---|---|
committer | Tor Lillqvist <tlillqvist@suse.com> | 2012-11-16 16:25:17 +0200 |
commit | 26b8cd2b3ef8fed72ba52e0b8f9b002f7cfd23c4 (patch) | |
tree | cf30b0a0b264678ed468572d2686492a510aee24 /android | |
parent | 25dd02d8b9ad66e06fb2f6e9d38e27753af2817d (diff) |
Reduce dynamic symbols and strip all local ones from the Android single .so
Use a version script ("version map") that exports only the Java_* and
JNI_OnLoad symbols that the JNI machinery needs. No non-dynamic
symbols are needed (in the .so that goes into the .apk; the one kept
locally for debugging is not stripped).
Change-Id: Ie874e59c593ec9e5d08ba369612cef1a3ea85fe4
Diffstat (limited to 'android')
-rw-r--r-- | android/Bootstrap/version.map | 7 | ||||
-rw-r--r-- | android/experimental/DocumentLoader/Makefile | 5 | ||||
-rw-r--r-- | android/experimental/LibreOffice4Android/Makefile | 5 |
3 files changed, 11 insertions, 6 deletions
diff --git a/android/Bootstrap/version.map b/android/Bootstrap/version.map new file mode 100644 index 000000000000..1b65003eeaaa --- /dev/null +++ b/android/Bootstrap/version.map @@ -0,0 +1,7 @@ +dummy { + global: + Java_*; + JNI_OnLoad; + local: + *; +}; diff --git a/android/experimental/DocumentLoader/Makefile b/android/experimental/DocumentLoader/Makefile index 15c6a0a11339..afc5241e2577 100644 --- a/android/experimental/DocumentLoader/Makefile +++ b/android/experimental/DocumentLoader/Makefile @@ -49,10 +49,9 @@ properties: link-so: # Build the single .so for this app mkdir -p $(OBJLOCAL) - $(CXX) -Wl,-Map,liblo-native-code.map -Wl,--gc-sections -Wl,--stats -Wl,--no-keep-files-mapped -Wl,--no-undefined -DANDROID -DDISABLE_DYNLOADING -shared -o $(OBJLOCAL)/liblo-native-code.so -I$(OUTDIR)/inc native-code.cxx -L$(OUTDIR)/lib $(WHOLELIBS) $(LIBS) -lgnustl_static -landroid -llog -lz + $(CXX) -Wl,-Map,liblo-native-code.map -Wl,--gc-sections -Wl,--version-script=../../Bootstrap/version.map -Wl,--stats -Wl,--no-keep-files-mapped -Wl,--no-undefined -DANDROID -DDISABLE_DYNLOADING -shared -o $(OBJLOCAL)/liblo-native-code.so -I$(OUTDIR)/inc native-code.cxx -L$(OUTDIR)/lib $(WHOLELIBS) $(LIBS) -lgnustl_static -landroid -llog -lz mkdir -p $(SODEST) - cp $(OBJLOCAL)/liblo-native-code.so $(SODEST) - $(STRIP) --strip-debug $(SODEST)/liblo-native-code.so + $(STRIP) -o $(SODEST)/liblo-native-code.so $(OBJLOCAL)/liblo-native-code.so copy-stuff: # Then "assets". Let the directory structure under assets mimic diff --git a/android/experimental/LibreOffice4Android/Makefile b/android/experimental/LibreOffice4Android/Makefile index c823ebf2b425..bbe1587a2252 100644 --- a/android/experimental/LibreOffice4Android/Makefile +++ b/android/experimental/LibreOffice4Android/Makefile @@ -24,10 +24,9 @@ APP_PACKAGE=org.libreoffice link-so: # Build the single .so for this app mkdir -p $(OBJLOCAL) - $(CXX) -Wl,-Map,liblo-native-code.map -Wl,--gc-sections -Wl,--stats -Wl,--no-keep-files-mapped -Wl,--no-undefined -DANDROID -DDISABLE_DYNLOADING -shared -o $(OBJLOCAL)/liblo-native-code.so -I$(OUTDIR)/inc native-code.cxx -L$(OUTDIR)/lib $(WHOLELIBS) $(LIBS) -lgnustl_static -landroid -llog -lz + $(CXX) -Wl,-Map,liblo-native-code.map -Wl,--gc-sections -Wl,--version-script=../../Bootstrap/version.map -Wl,--stats -Wl,--no-keep-files-mapped -Wl,--no-undefined -DANDROID -DDISABLE_DYNLOADING -shared -o $(OBJLOCAL)/liblo-native-code.so -I$(OUTDIR)/inc native-code.cxx -L$(OUTDIR)/lib $(WHOLELIBS) $(LIBS) -lgnustl_static -landroid -llog -lz mkdir -p $(SODEST) - cp $(OBJLOCAL)/liblo-native-code.so $(SODEST) - $(STRIP) --strip-debug $(SODEST)/liblo-native-code.so + $(STRIP) -o $(SODEST)/liblo-native-code.so $(OBJLOCAL)/liblo-native-code.so copy-stuff: # Then "assets". Let the directory structure under assets mimic |