From b4ec5f2028d914cc5d54b8e81bb078b69e7b2c47 Mon Sep 17 00:00:00 2001 From: Xiao Yu Date: Mon, 19 Aug 2019 23:18:18 -0700 Subject: [PATCH 1/2] make it possible to disable debug symbols stripping --- shell/config.gni | 1 + shell/platform/android/BUILD.gn | 10 ++++++++-- tools/gn | 8 ++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/shell/config.gni b/shell/config.gni index b578951627a95..ab82f26f24de2 100644 --- a/shell/config.gni +++ b/shell/config.gni @@ -5,4 +5,5 @@ declare_args() { shell_enable_vulkan = false shell_enable_metal = false + stripped_symbols = true } diff --git a/shell/platform/android/BUILD.gn b/shell/platform/android/BUILD.gn index 3d07b6a2cf58d..934120e0a563a 100644 --- a/shell/platform/android/BUILD.gn +++ b/shell/platform/android/BUILD.gn @@ -306,9 +306,15 @@ action("icudtl_object") { action("android") { script = "//build/android/gyp/create_flutter_jar.py" + if (stripped_symbols) { + engine_library = "lib.stripped/libflutter.so" + } else { + engine_library = "libflutter.so" + } + inputs = [ "$root_build_dir/$embedding_jar_filename", - "$root_build_dir/lib.stripped/libflutter.so", + "$root_build_dir/$engine_library", ] engine_artifact_id = @@ -329,7 +335,7 @@ action("android") { "--dist_jar", rebase_path(embedding_jar_filename, root_build_dir, root_build_dir), "--native_lib", - rebase_path("lib.stripped/libflutter.so", root_build_dir, root_build_dir), + rebase_path("$engine_library", root_build_dir, root_build_dir), "--android_abi", "$android_app_abi", ] diff --git a/tools/gn b/tools/gn index 7c90cbb8eab92..2e981dafec4bf 100755 --- a/tools/gn +++ b/tools/gn @@ -262,6 +262,10 @@ def to_gn_args(args): if args.build_glfw_shell: gn_args['build_glfw_shell'] = True + gn_args['stripped_symbols'] = args.stripped + + print(gn_args) + return gn_args def parse_args(args): @@ -333,6 +337,10 @@ def parse_args(args): parser.add_argument('--bitcode', default=False, action='store_true', help='Enable bitcode for iOS targets.') + parser.add_argument('--stripped', default=True, action='store_true', + help='Strip debug symbols from the output. This defaults to true and has no effect on iOS.') + parser.add_argument('--no-stripped', dest='stripped', action='store_false') + return parser.parse_args(args) def main(argv): From 483ddfcbcb5740be0a82dc600e5cfc55ea2a6a90 Mon Sep 17 00:00:00 2001 From: Xiao Yu Date: Tue, 20 Aug 2019 22:56:08 -0700 Subject: [PATCH 2/2] forgot to remove print --- tools/gn | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/gn b/tools/gn index 2e981dafec4bf..4c4182f3581d0 100755 --- a/tools/gn +++ b/tools/gn @@ -264,8 +264,6 @@ def to_gn_args(args): gn_args['stripped_symbols'] = args.stripped - print(gn_args) - return gn_args def parse_args(args):