Android symbol level = 1

190 views
Skip to first unread message

dan...@chromium.org

unread,
Nov 16, 2021, 3:57:37 PM11/16/21
to chromium-dev
Hello,

The other day keishi@ pointed out to me that Android Chrome builds with symbol_level = 1.

I was surprised so I looked at the history. We used to use symbol_level = 0 for Android release builds, like we do for Linux. The reason we use 0 for Linux is because the symbols end up inside the binary, unlike Windows and Mac where they are separate.

I would think Android is the same as Linux, and the comments here seem to agree: https://codereview.chromium.org/2481523002/diff/40001/build/config/compiler/compiler.gni

In the CL, we introduced symbol_level = 1 on Android, for gcc compilers, claiming it was "reducing" the symbol level. I must admit it looks like it takes it from 0 to 1 in release builds, but since it's for non-clang, perhaps it didn't affect our official builds? This branch looks intended to shortcut before the symbol level = 2 when !is_linux.

These days, we only support and use clang, so the branch for !is_clang is gone, but the symbol_level = 1 for Android remains.


Is this intentional? Our binary size on Android is super important, and I wondered if this is a mistake costing us a lot, or is meant to be this way.

Cheers,
Dana

dan...@chromium.org

unread,
Nov 16, 2021, 4:09:37 PM11/16/21
to Joshua Peraza, Andrew Grieve, chromium-dev
On Tue, Nov 16, 2021 at 4:05 PM Joshua Peraza <jpe...@google.com> wrote:
I think setting symbol_level = 2 on Android requires first enabling split dwarf. We had enabled split dwarf for Android, but there were problems with thinlto's cache producing invalid debug_info, so it was reverted: https://chromium-review.googlesource.com/c/chromium/src/+/3111290https://bugs.chromium.org/p/chromium/issues/detail?id=1263177

If we had split dwarf, we could use symbol_level = 2 like Windows. I didn't realize that's a thing we were trying, thanks.

But when we don't have split dwarf, I am wondering why we don't set symbol_level = 0 in our release binaries, as we do on Linux. 
 
--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAHtyhaTQ%3DsE40JY%3DEqrAXLsXUZNuqpdiEKLi%3DG1HGBqw_HtT-w%40mail.gmail.com.

Joshua Peraza

unread,
Nov 16, 2021, 6:51:30 PM11/16/21
to dan...@chromium.org, Andrew Grieve, chromium-dev
I think setting symbol_level = 2 on Android requires first enabling split dwarf. We had enabled split dwarf for Android, but there were problems with thinlto's cache producing invalid debug_info, so it was reverted: https://chromium-review.googlesource.com/c/chromium/src/+/3111290https://bugs.chromium.org/p/chromium/issues/detail?id=1263177





On Tue, Nov 16, 2021 at 12:57 PM <dan...@chromium.org> wrote:
--

Andrew Grieve

unread,
Nov 16, 2021, 8:40:11 PM11/16/21
to dan...@chromium.org, Joshua Peraza, chromium-dev
In terms of binary size, it doesn't matter what symbol_level is set since we strip binaries before putting them into .apk files.

I believe symbol_level=1 in release builds rather than 0 so that stacks can be symbolized.

dan...@chromium.org

unread,
Nov 17, 2021, 11:05:45 AM11/17/21
to Andrew Grieve, Joshua Peraza, chromium-dev
On Tue, Nov 16, 2021 at 8:38 PM Andrew Grieve <agr...@google.com> wrote:
In terms of binary size, it doesn't matter what symbol_level is set since we strip binaries before putting them into .apk files.

Cool, thanks for clarifying that.
Reply all
Reply to author
Forward
0 new messages