How to disable optimization when building AOSP?

688 views
Skip to first unread message

Xie Wu

unread,
May 11, 2017, 11:15:08 PM5/11/17
to Android Building
Hi, I found some optimized variables when debugging so, such as libart.so.
I tried "mma LOCAL_CFLAGS="-O0 -g"", but it does not work. (reference: How to make debug build of specific module under AOSP tree?)
How can I disable optimization?
Thanks.

Colin Cross

unread,
May 12, 2017, 12:31:09 AM5/12/17
to android-...@googlegroups.com
There is no generic way to disable optimization for a specific module.
For art-related modules you can use mma -j ART_DEBUG_OPT_FLAG=-O0, and
then use the version suffixed with "d", for example dex2oatd or
dalvikvm -XXlib:libartd.so
> --
> --
> You received this message because you are subscribed to the "Android
> Building" mailing list.
> To post to this group, send email to android-...@googlegroups.com
> To unsubscribe from this group, send email to
> android-buildi...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-building?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Android Building" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-buildi...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Xie Wu

unread,
May 12, 2017, 10:16:02 AM5/12/17
to Android Building
Thank you for your reply. if I want to build the whole AOSP without optimization, what should I do?

Colin Cross

unread,
May 14, 2017, 9:43:24 PM5/14/17
to android-...@googlegroups.com
You can try changing the default flags for the architecture you are
about, for example
https://android.git.corp.google.com/platform/build/soong/+/master/cc/config/arm64_device.go#49,
but it is likley to cause build problems in a few modules. For
example, ART sets strict stack frame size limits that will probably
fail with global -O0.

Xie Wu

unread,
May 16, 2017, 10:45:19 AM5/16/17
to Android Building
The url you provided can not be accessed because it requires authentication, then I found a similar web site.


thank you for your reply.
Reply all
Reply to author
Forward
0 new messages