|
| 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