From efe086ab30ded7f6d6e0a7df8cbcdcdf64c8bae7 Mon Sep 17 00:00:00 2001 From: Zachary Anderson Date: Fri, 24 Jun 2022 08:45:19 -0700 Subject: [PATCH] Adds a flag to the gn script to build with -fstack-protector (flutter/engine#34257) --- DEPS | 2 +- engine/src/flutter/tools/gn | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/DEPS b/DEPS index 95f3eb3cc83..d3aaeef3b12 100644 --- a/DEPS +++ b/DEPS @@ -111,7 +111,7 @@ allowed_hosts = [ ] deps = { - 'src': 'https://github.com/flutter/buildroot.git' + '@' + '87d5dcb98983da54257f6f39d3beee2989cb0e47', + 'src': 'https://github.com/flutter/buildroot.git' + '@' + 'e27b16edf1fd54c358cc9499aa02297100375354', # Fuchsia compatibility # diff --git a/engine/src/flutter/tools/gn b/engine/src/flutter/tools/gn index 84bbf4a6142..47f80aab765 100755 --- a/engine/src/flutter/tools/gn +++ b/engine/src/flutter/tools/gn @@ -495,6 +495,9 @@ def to_gn_args(args): if args.ubsan: gn_args['is_ubsan'] = True + if args.fstack_protector: + gn_args['use_fstack_protector'] = True + if args.enable_vulkan_validation_layers: if args.target_os != 'fuchsia': print( @@ -860,6 +863,13 @@ def parse_args(args): parser.add_argument('--tsan', default=False, action='store_true') parser.add_argument('--ubsan', default=False, action='store_true') + parser.add_argument( + '--fstack-protector', + default=False, + action='store_true', + help='Whether the -fstack-protector flag should be passed unconditionally.' + ) + parser.add_argument( '--trace-gn', default=False,