Overview

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 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.

Work

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

All commits — https://github.com/LibreOffice/core/commits/master?author=gautamprajapati06@gmail.com

Future Work

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.

Other Links