Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

make it possible to disable debug symbols stripping #11265

Merged
merged 2 commits into from
Aug 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions shell/config.gni
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
declare_args() {
shell_enable_vulkan = false
shell_enable_metal = false
stripped_symbols = true
}
10 changes: 8 additions & 2 deletions shell/platform/android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand All @@ -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",
]
Expand Down
6 changes: 6 additions & 0 deletions tools/gn
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,8 @@ def to_gn_args(args):
if args.build_glfw_shell:
gn_args['build_glfw_shell'] = True

gn_args['stripped_symbols'] = args.stripped

return gn_args

def parse_args(args):
Expand Down Expand Up @@ -333,6 +335,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',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you change the flag name to something that indicates that this only affects the contents of flutter.jar on Android? (e.g. --flutter-jar-unstripped)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the fact that it's not on iOS is probably more of a bug than a feature right? I think we should ideally not create one off features and stripping symbols is a generic feature.

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):
Expand Down