[Android]: Don't omit the frame pointer on Arm64.

If we omit the frame pointer on Arm64 there is no way for
breakpad to correctly symbolize stack traces which contain
stack frames for which we don't have CFI information (e.g.,
system libraries like libc.so).  This is because the Arm64
ABI does not specify where a frame pointer should be in a
stack frame, so, without CFI information, there is no way 
to calculate the start of the caller's frame if the caller
omits the frame pointer.

More details are on the bug.

BUG=391706

Review URL: https://codereview.chromium.org/381923002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@282370 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/build/common.gypi b/build/common.gypi
index 44ef70aa..a091703 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -3439,7 +3439,6 @@
                   'debug_optimize%': 's',
                 },
                 'cflags': [
-                  '-fomit-frame-pointer',
                   '-fdata-sections',
                   '-ffunction-sections',
                 ],
@@ -3448,6 +3447,14 @@
                   '-Wl,--as-needed',
                 ],
               }],
+              ['OS=="android" and android_full_debug==0 and target_arch!="arm64"', {
+                # We don't omit frame pointers on arm64 since they are required
+                # to correctly unwind stackframes which contain system library
+                # function frames (crbug.com/391706).
+                'cflags': [
+                  '-fomit-frame-pointer',
+                ],
+              }],
               ['OS=="linux" and target_arch=="ia32"', {
                 'ldflags': [
                   '-Wl,--no-as-needed',
@@ -3503,13 +3510,18 @@
                   '-Wl,--gc-sections',
                 ],
               }],
+              ['OS=="android" and target_arch!="arm64"', {
+                # We don't omit frame pointers on arm64 since they are required
+                # to correctly unwind stackframes which contain system library
+                # function frames (crbug.com/391706).
+                'cflags': [
+                  '-fomit-frame-pointer',
+                ]
+              }],
               ['OS=="android"', {
                 'variables': {
                   'release_optimize%': 's',
                 },
-                'cflags': [
-                  '-fomit-frame-pointer',
-                ],
                 'ldflags': [
                   # Warn in case of text relocations.
                   '-Wl,--warn-shared-textrel',