From 28127d1649c0ebe39a215bf8e84ff3a1de01707a Mon Sep 17 00:00:00 2001 From: shoryukenn Date: Tue, 27 Aug 2019 10:32:49 +0800 Subject: [PATCH 1/5] buildfix: support build windows release/profile mode(#32746) WHAT: buildbreak on Windows Release/Profile Mode. WHY: Windows platform does not link vm_snapshot_data.bin.o isolate_snapshot_instructions.bin.o vm_snapshot_instructions.bin.o vm_snapshot_data.bin.o generated by bin_to_coff. HOW: add deps to runtime build.gn --- AUTHORS | 1 + runtime/BUILD.gn | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/AUTHORS b/AUTHORS index 53ad592d738bf..12355a9457e43 100644 --- a/AUTHORS +++ b/AUTHORS @@ -14,3 +14,4 @@ Victor Choueiri Simon Lightfoot Dwayne Slater Tetsuhiro Ueda +shoryukenn diff --git a/runtime/BUILD.gn b/runtime/BUILD.gn index 87147abde0071..113f74ca865c3 100644 --- a/runtime/BUILD.gn +++ b/runtime/BUILD.gn @@ -87,6 +87,13 @@ source_set("runtime") { "//third_party/tonic", ] + if (is_win) { + if (flutter_runtime_mode == "profile" || + flutter_runtime_mode == "release") { + deps += [ "$flutter_root/lib/snapshot" ] + } + } + public_deps = [ "//third_party/rapidjson", ] From 677eb5bafabc2f490770f7e7648f70ac535ae5a3 Mon Sep 17 00:00:00 2001 From: shoryukenn Date: Tue, 27 Aug 2019 14:02:34 +0800 Subject: [PATCH 2/5] Add some comments(#32746) --- runtime/BUILD.gn | 3 +++ 1 file changed, 3 insertions(+) diff --git a/runtime/BUILD.gn b/runtime/BUILD.gn index 113f74ca865c3..73f4c090f3228 100644 --- a/runtime/BUILD.gn +++ b/runtime/BUILD.gn @@ -87,6 +87,9 @@ source_set("runtime") { "//third_party/tonic", ] + // naifu: On Windows and Android (in debug mode) the engine finds the Dart snapshot + // data through symbols that are statically linked into the executable. + // On other platforms this data is obtained by a dynamic symbol lookup. if (is_win) { if (flutter_runtime_mode == "profile" || flutter_runtime_mode == "release") { From 8738135099c71d8bbc3c96c343ef86e6a01902d6 Mon Sep 17 00:00:00 2001 From: shoryukenn Date: Tue, 27 Aug 2019 14:38:19 +0800 Subject: [PATCH 3/5] typofix --- runtime/BUILD.gn | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/BUILD.gn b/runtime/BUILD.gn index 73f4c090f3228..74ed8b466c37e 100644 --- a/runtime/BUILD.gn +++ b/runtime/BUILD.gn @@ -87,9 +87,9 @@ source_set("runtime") { "//third_party/tonic", ] - // naifu: On Windows and Android (in debug mode) the engine finds the Dart snapshot - // data through symbols that are statically linked into the executable. - // On other platforms this data is obtained by a dynamic symbol lookup. + # naifu: On Windows and Android (in debug mode) the engine finds the Dart snapshot + # data through symbols that are statically linked into the executable. + # On other platforms this data is obtained by a dynamic symbol lookup. if (is_win) { if (flutter_runtime_mode == "profile" || flutter_runtime_mode == "release") { From e536dc709913158c854c7155dafb7826aa135a45 Mon Sep 17 00:00:00 2001 From: shoryukenn Date: Fri, 30 Aug 2019 08:25:28 +0800 Subject: [PATCH 4/5] add comments --- runtime/BUILD.gn | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/runtime/BUILD.gn b/runtime/BUILD.gn index 74ed8b466c37e..a5ee1b05b31fb 100644 --- a/runtime/BUILD.gn +++ b/runtime/BUILD.gn @@ -87,9 +87,21 @@ source_set("runtime") { "//third_party/tonic", ] - # naifu: On Windows and Android (in debug mode) the engine finds the Dart snapshot - # data through symbols that are statically linked into the executable. - # On other platforms this data is obtained by a dynamic symbol lookup. + # naifu: On Windows the engine finds the Dart snapshot data through symbols + # that are statically linked into the executable. On other platforms this + # data is obtained by a dynamic symbol lookup. + # The current Windows platform uses static linking instead of dynamic lookups + # because: + # 1. The size of the executable on Windows is not as concerned as on mobile + # platforms. + # 2. If it is a dynamic lookup method, you need to modify the properties of + # the memory page after the *.bin is dynamically loaded at runtime and + # mark it as executable. This is feasible (similar to V8 on Windows), but + # this increases the complexity of the implementation(These operations + # involve the use of some system file/memory privilege APIs and there is + # a risk of failure). + # 3. In the executable can enjoy the advantages of the windows preload + # mechanism, speed up I/O. if (is_win) { if (flutter_runtime_mode == "profile" || flutter_runtime_mode == "release") { From 945503e1e9165708a40b3022c497b937d350cec3 Mon Sep 17 00:00:00 2001 From: shoryukenn Date: Sat, 31 Aug 2019 15:10:00 +0800 Subject: [PATCH 5/5] comment style --- runtime/BUILD.gn | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/BUILD.gn b/runtime/BUILD.gn index a5ee1b05b31fb..5e41f19f031e2 100644 --- a/runtime/BUILD.gn +++ b/runtime/BUILD.gn @@ -87,11 +87,11 @@ source_set("runtime") { "//third_party/tonic", ] - # naifu: On Windows the engine finds the Dart snapshot data through symbols + # On Windows the engine finds the Dart snapshot data through symbols # that are statically linked into the executable. On other platforms this # data is obtained by a dynamic symbol lookup. - # The current Windows platform uses static linking instead of dynamic lookups - # because: + # The current Windows platform uses static-link instead of dynamic lookups. + # Because: # 1. The size of the executable on Windows is not as concerned as on mobile # platforms. # 2. If it is a dynamic lookup method, you need to modify the properties of