How to disable Execute-only Memory in Android Studio project with gradle and cmake?

Viewed 641

Begin with API level 29, Execute-only Memory is enabled by default for all 64-bit binaries on Android platform. Unfortunately, our project depends on a lot of third-party libraries that don't support this and will cause the app crash. We need to disable Execute-only Memory globally for our project. The document says we can disable it with make -j ENABLE_XOM=false. How can we do this in gradle or cmake?

1 Answers

The XOM is enabled by default with target API 29. Kernel disables XOM for compatibility with older target APIs.

Have you tried using cmake in the build tool mode? Options specified after -- are passed to the native tool.

cmake --build <dir> [<options>] -- ENABLE_XOM=false

Related