GSoC Final Submission report — LibreOffice for Android
My project goals were to work behind the scenes to improve the LibreOffice Android build system. I worked on switching from deprecated NDK GCC toolchain to a relatively newer and better toolchain-Clang, used to compile the native code in LibreOffice. I also fixed the failures caused in the code because of compiler switching.
Apart from this, I worked on cross-compiling Mozilla’s NSS(Network Security Services) library for ARM and supporting it with LO Android which was using OpenSSL instead.
Note: My tasks lineup was shifted to what I originally proposed because two students were working on the same project and some of our proposed work overlapped.
I accepted my change of tasks because they challenged me with a better and different set of learnings to what I already knew.
In chronological order — June to August
- LO Android build was only tested upto NDK r13b, updated and tested configure script to use NDK r14b — https://gerrit.libreoffice.org/#/c/38359/
- By the time I was completing clang switch, NDK r15b was released, updated configure again before switching the toolchain — https://gerrit.libreoffice.org/#/c/39127/
- Fixed bridges/ module crash with Clang because the following patches were to set Clang as default — https://gerrit.libreoffice.org/#/c/39050/
- Updated the configure to support building with Clang 5.0 toolchain coming with latest NDK — https://gerrit.libreoffice.org/#/c/39122/
- Set Clang as default compiler on Android instead of GCC — https://gerrit.libreoffice.org/#/c/39123/
- Removed the support for building with GCC — https://gerrit.libreoffice.org/#/c/39125/
Clang switch completed, moving on to the NSS part…
NSS still likes NDK’s GCC toolchain. I worked incrementally, first of all tried to tweak NSS sources to build for Android as target OS with existing build system. When it was successful, I modified configure and Makefiles to use Clang toolchain and fixed other errors breaking the build.
I had to prepare a patch file to support NSS building for Android and hope is that NSS upstream will accept those changes so that we won’t have to worry about managing the patch forever with LO code.
7. Combined all the NSS changes into one patch, fixed and enabled NSS building for Android — https://gerrit.libreoffice.org/#/c/40645/
8. Android used to use OpenSSL for security features in LO, we have now switched to NSS — https://gerrit.libreoffice.org/#/c/41308/
All GSoC related Patches
- android: Update configure.ac for NDK r14b version
- Clean up declaration of __cxa_get_globals in linux_arm bridge
- android: Bump NDK version to 15 in configure.ac
- android:Supress the Clang’s unneeded-internal-declaration warning
- android:update safeint header to use the else implementation with clang
- Android Viewer: Listen for changes in editing preference settings
- add factory function mapping for libspelllo archive
- android: Fix bridges/ module for building with Clang
- android: update configure.ac to support building only with NDK>=15
- android: update configure.ac for supporting Clang5.0
- Supress unused variable warning in gcc arm bridge
- android: Set clang as default compiler for building
- android: Remove GCC support for building
- Clean up android specific template functions defined in std namespace
- android:Update configure.ac to support NDK 15.1.x
- android: remove unused GCC related code from configure.ac
- Fix and enable NSS build for Android
- Fix and enable libxmlsec build for Android
- Enable HAVE_FEATURE_NSS and package the NSS libraries with apk
- We want to switch to libc++ as STL from GNU libstdc++. We couldn’t do so in GSoC timeline because NDK does not have a stable implementation of libc++ right now.
- Next step in NSS task would be to submit the Android/ARM specific changes to Mozilla repository so that LO won’t have to take care of patch all the time.
- Summer Of Code Project Page — https://summerofcode.withgoogle.com/projects/#6637875643809792
- My GSoC Proposal —https://docs.google.com/document/d/1eVEyyAnJ5a7-Byotje6x-mlWBEIGR2cIKnP_EA_qsXM/
- Beta app to test: http://dev-builds.libreoffice.org/daily/master/Android-ARM@24-Bytemark-Hosting/current/
- Ideas page for LibreOffice Android Viewer: https://wiki.documentfoundation.org/Development/GSoC/Ideas#LibreOffice_for_Android