How to disable Execute-only Memory globally with gradle and cmake?

690 views
Skip to first unread message

zhang kai

unread,
Jun 25, 2020, 11:43:29 AM6/25/20
to android-ndk
Hi, with API level 29 or higher, Execute-only Memory is enabled by default for all 64-bit binaries in the build system. Unfortunately, our project uses a lot of third-party libraries that don't support this. So we need to disable Execute-only Memory(XOM) globally for our project. The document says we can disable it by:

make -j ENABLE_XOM=false

How can we do this with gradle and cmake?

Dan Albert

unread,
Jun 25, 2020, 3:39:02 PM6/25/20
to android-ndk, Elliott Hughes
I'm a little confused by the history here. It seems that that support got removed in https://android-review.googlesource.com/c/platform/build/soong/+/1232532 (I filed a doc bug for that). Is this actually required in 29?

+enh might know the requirements.

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/a1545612-b8e6-47e4-828a-b23f51198265o%40googlegroups.com.

enh

unread,
Jun 25, 2020, 3:40:40 PM6/25/20
to Dan Albert, android-ndk
yeah, XOM conflicts with ("breaks") PAN, which is the more important
mitigation, so was removed.

Dan Albert

unread,
Jun 25, 2020, 3:54:49 PM6/25/20
to enh, android-ndk
Thanks for confirming. I couldn't really pick apart the timeline. Was it removed in 30, but required in 29? Does this affect apps, or just system components? I suspect it doesn't affect apps since I really should have heard something if it did...

enh

unread,
Jun 25, 2020, 4:00:03 PM6/25/20
to Dan Albert, android-ndk
http://b/147300048 was the internal bug. they did say "we'll probably
need to update the documentation at
https://source.android.com/devices/tech/debug/execute-only-memory to
reflect that this was only a Q feature", but apparently never did :-(

i've reopened the bug to get the docs fixed.

Glenn Kasten

unread,
Jun 26, 2020, 12:18:35 PM6/26/20
to android-ndk
FYI there's a good public article here that defines XOM, PAN, and explains the interaction problem:
>> >> To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+unsubscribe@googlegroups.com.

zhang kai

unread,
Jun 27, 2020, 11:41:55 AM6/27/20
to android-ndk
When our app builds with target API level 30, the app randomly crashes with message: "Cause: execute-only (no-read) memory access error; likely due to data in .text.". When we change the API level to 28 the app runs fine. Do we need to update something? like ndk version?


在 2020年6月26日星期五 UTC+8上午3:54:49,Dan Albert写道:
Thanks for confirming. I couldn't really pick apart the timeline. Was it removed in 30, but required in 29? Does this affect apps, or just system components? I suspect it doesn't affect apps since I really should have heard something if it did...

On Thu, Jun 25, 2020 at 12:40 PM enh <e...@google.com> wrote:
yeah, XOM conflicts with ("breaks") PAN, which is the more important
mitigation, so was removed.

On Thu, Jun 25, 2020 at 12:38 PM Dan Albert <dana...@google.com> wrote:
>
> I'm a little confused by the history here. It seems that that support got removed in https://android-review.googlesource.com/c/platform/build/soong/+/1232532 (I filed a doc bug for that). Is this actually required in 29?
>
> +enh might know the requirements.
>
> On Thu, Jun 25, 2020 at 8:43 AM zhang kai <kylerz...@gmail.com> wrote:
>>
>> Hi, with API level 29 or higher, Execute-only Memory is enabled by default for all 64-bit binaries in the build system. Unfortunately, our project uses a lot of third-party libraries that don't support this. So we need to disable Execute-only Memory(XOM) globally for our project. The document says we can disable it by:
>>
>> make -j ENABLE_XOM=false
>>
>>
>> How can we do this with gradle and cmake?
>>
>> --
>> You received this message because you are subscribed to the Google Groups "android-ndk" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to andro...@googlegroups.com.

seal2002

unread,
Jan 21, 2021, 6:08:55 AM1/21/21
to android-ndk
Hi @kylerz, do you have any news regarding the disabled XOM with Gradle and Cmake?

On my project, I have no problem with the release version, only got the crash with the debug.
The main difference configuration between debug and release is -O0 & -Os (which is many compiler flags inside)

Do you know how to check where is the code makes the device crash?

Regards,
Seal

Reply all
Reply to author
Forward
0 new messages