Google warning: .so files must align to 16KB – Release build config & performance issue

  • You’ll need to relink the native libraries with a linker that supports 16 KB ELF page alignment — using objcopy after the fact generally won’t change the p_align values in the program headers (Android Developers).
  • Use the LLD/Clang linker and pass the ELF page-size options at link time, for example: -Wl,-z,max-page-size=16384 -Wl,-z,common-page-size=16384. Then verify with readelf -l libfoo.so to check the p_align values (Fuchsia source).

I’m not sure how your build is currently configured, but I found this discussion on the Collabora forum where other users have tried various flags that might help as well.