OLD | NEW |
---|---|
(Empty) | |
1 # Copyright 2017 The Chromium Authors. All rights reserved. | |
2 # Use of this source code is governed by a BSD-style license that can be | |
3 # found in the LICENSE file. | |
4 | |
Nico
2017/07/11 18:59:39
add a comment giving a short overview of what this
peria
2017/07/12 02:38:37
Done.
| |
5 import("//build/config/c++/c++.gni") | |
6 import("//v8/snapshot_toolchain.gni") | |
7 | |
8 if (is_android) { | |
9 import("//build/config/android/rules.gni") | |
10 } | |
11 | |
12 if (is_android) { | |
13 android_assets("v8_context_snapshot_assets") { | |
14 deps = [ | |
15 ":v8_context_snapshot", | |
16 ] | |
17 sources = [ | |
18 "$root_out_dir/v8_context_snapshot.bin", | |
19 ] | |
20 disable_compression = true | |
21 } | |
22 } | |
23 | |
24 group("v8_context_snapshot") { | |
25 if (!is_chromeos) { | |
26 public_deps = [ | |
27 ":generate_v8_context_snapshot", | |
28 ] | |
29 } | |
30 } | |
31 | |
32 if (!is_chromeos) { | |
33 action("generate_v8_context_snapshot") { | |
34 script = "run.py" | |
35 output_file = "$root_out_dir/v8_context_snapshot.bin" | |
36 output_path = rebase_path(output_file, root_build_dir) | |
37 | |
38 args = [ | |
39 "./" + rebase_path( | |
40 get_label_info( | |
41 ":v8_context_snapshot_generator($v8_snapshot_toolchain)", | |
42 "root_out_dir") + "/v8_context_snapshot_generator", | |
43 root_build_dir), | |
44 "--output_file=$output_path", | |
45 ] | |
46 | |
47 outputs = [ | |
48 output_file, | |
49 ] | |
50 | |
51 deps = [ | |
52 ":v8_context_snapshot_generator($v8_snapshot_toolchain)", | |
53 ] | |
54 } | |
55 | |
56 # This config disables a link time optimization "ICF", which may merge differe nt | |
57 # functions into one if the function signature and body of them are identical. | |
Nico
2017/07/11 18:59:39
why?
peria
2017/07/12 02:38:37
The reason to disable ICF is on #83-84.
| |
58 config("disable_icf") { | |
59 visibility = [ ":*" ] # Only targets in this file can depend on this. | |
60 if (is_win) { | |
61 ldflags = [ "/OPT:NOICF" ] | |
62 } else if (is_posix && !is_mac) { | |
63 ldflags = [ "-Wl,--icf=none" ] | |
64 } | |
65 } | |
66 | |
67 executable("v8_context_snapshot_generator") { | |
68 sources = [ | |
69 "v8_context_snapshot_generator.cc", | |
70 ] | |
71 | |
72 deps = [ | |
73 "//gin:gin", | |
74 "//mojo/edk/system:system", | |
75 "//third_party/WebKit/public:blink", | |
76 "//v8", | |
77 ] | |
78 | |
79 if (is_linux) { | |
80 deps += [ "//buildtools/third_party/libc++:libcxx_proxy" ] | |
81 } | |
82 | |
83 # Link time optimization "ICF" breaks 1:1 mappings of the external reference s | |
84 # for V8 snapshot. So, we disable it while taking a V8 snapshot. | |
Nico
2017/07/11 18:59:39
Aha. Put this comment at the end of the comment on
peria
2017/07/12 02:38:37
Done.
| |
85 configs += [ | |
86 "//v8:external_startup_data", | |
87 ":disable_icf", | |
88 ] | |
89 } | |
90 } | |
OLD | NEW |