3 ms·
What debloating tools are there for the Android NDK? For any code that ends up dexed, R8 takes care of it, so it's not terrible if I add a library dependency wi
by lern_too_spel 6y ago
What debloating tools are there for the Android NDK? For any code that ends up dexed, R8 takes care of it, so it's not terrible if I add a library dependency with a lot of code I don't need. I haven't found anything similar for native libraries.
- chenxiaolong 6y agoOne thing I've done in a project before was statically linking all of my native library's dependencies into the library itself. Everything would be compiled with `-ffunction-sections -fdata-sections` and the final shared library linked with `-Wl,--gc-sections`. I'd call `strip` on the `.so` as well. This worked well because the JVM code only ever called the native API I exposed and did not need to access the dependencies' APIs.
- lern_too_spel 6y agoI'm specifically looking for what R8 calls "tree-shaking."