Skip to content

Commit b4f9af7

Browse files
Added patch for extracting corpora from Chromium with ThinLTO
1 parent f9826eb commit b4f9af7

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
2+
index fc399785a8..a6d3656cc7 100644
3+
--- a/build/config/compiler/BUILD.gn
4+
+++ b/build/config/compiler/BUILD.gn
5+
@@ -552,6 +552,13 @@ config("compiler") {
6+
}
7+
}
8+
9+
+ if (use_lld && use_thin_lto && lld_emit_index) {
10+
+ ldflags += [
11+
+ "-Wl,--save-temps=import",
12+
+ "-Wl,--thinlto-emit-index-files"
13+
+ ]
14+
+ }
15+
+
16+
# Rust compiler setup (for either clang or rustc).
17+
if (enable_rust) {
18+
defines += [ "RUST_ENABLED" ]
19+
diff --git a/build/config/compiler/compiler.gni b/build/config/compiler/compiler.gni
20+
index 11c015b303..5f8213d4cf 100644
21+
--- a/build/config/compiler/compiler.gni
22+
+++ b/build/config/compiler/compiler.gni
23+
@@ -141,6 +141,11 @@ declare_args() {
24+
# enables the ML inliner when targeting Android.
25+
# Currently the ML inliner is only supported on linux hosts
26+
use_ml_inliner = host_os == "linux" && is_android
27+
+
28+
+ # Set to true to enable output of ThinLTO index files used for training
29+
+ # ML models that can enhance characteristics of clang generated native
30+
+ # code.
31+
+ lld_emit_index = false
32+
}
33+
34+
assert(!is_cfi || use_thin_lto, "CFI requires ThinLTO")
35+

0 commit comments

Comments
 (0)