Skip to content

Commit ebbaa2f

Browse files
Rebase Chromium Patches (#213)
There have been some changes within the Chromium build system that have broken these patches, making work on Chromium with MLGO (especially through the demo) more difficult than it needs to be. This patch rebases these patches so they apply cleanly (when performed in order) against a current (as of this commit) checkout of the Chromium source code.
1 parent ac84c14 commit ebbaa2f

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed
Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
11
diff --git a/build/config/clang/clang.gni b/build/config/clang/clang.gni
2-
index 1e662184872b3..4aed699d271b4 100644
2+
index 7196fcf6c1..423ffbdd09 100644
33
--- a/build/config/clang/clang.gni
44
+++ b/build/config/clang/clang.gni
55
@@ -15,4 +15,7 @@ declare_args() {
66
default_toolchain != "//build/toolchain/cros:target"
77

88
clang_base_path = default_clang_base_path
99
+
10-
+ # Specifies whether or not bitcode should be embedded in all compiled targets
11-
+ clang_embed_bitcode = false
10+
+ # Specifies whether or not bitcode should be embedded in all compiled targets
11+
+ clang_embed_bitcode = false
1212
}
1313
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
14-
index 0272bf80f31fe..87ace0ffd345b 100644
14+
index d3adf9735c..6bad05bf7e 100644
1515
--- a/build/config/compiler/BUILD.gn
1616
+++ b/build/config/compiler/BUILD.gn
17-
@@ -817,6 +817,9 @@ config("compiler") {
18-
if (is_official_build) {
19-
rustflags += [ "-Ccodegen-units=1" ]
17+
@@ -838,6 +838,10 @@ config("compiler") {
18+
}
2019
}
20+
2121
+ if (is_clang && clang_embed_bitcode) {
2222
+ cflags += [ "-Xclang", "-fembed-bitcode=all" ]
2323
+ }
24-
}
25-
26-
# The BUILDCONFIG file sets this config on targets by default, which means when
24+
+
25+
# Pass the same C/C++ flags to the objective C/C++ compiler.
26+
cflags_objc += cflags_c
27+
cflags_objcc += cflags_cc
Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
2-
index fc399785a8..a6d3656cc7 100644
2+
index 6bad05bf7e..7938626865 100644
33
--- a/build/config/compiler/BUILD.gn
44
+++ b/build/config/compiler/BUILD.gn
5-
@@ -552,6 +552,13 @@ config("compiler") {
6-
}
5+
@@ -842,6 +842,13 @@ config("compiler") {
6+
cflags += [ "-Xclang", "-fembed-bitcode=all" ]
77
}
88

99
+ if (use_lld && use_thin_lto && lld_emit_index) {
@@ -13,23 +13,22 @@ index fc399785a8..a6d3656cc7 100644
1313
+ ]
1414
+ }
1515
+
16-
# Rust compiler setup (for either clang or rustc).
17-
if (enable_rust) {
18-
defines += [ "RUST_ENABLED" ]
16+
# Pass the same C/C++ flags to the objective C/C++ compiler.
17+
cflags_objc += cflags_c
18+
cflags_objcc += cflags_cc
1919
diff --git a/build/config/compiler/compiler.gni b/build/config/compiler/compiler.gni
20-
index 11c015b303..5f8213d4cf 100644
20+
index 4738ee80d3..57355e2098 100644
2121
--- a/build/config/compiler/compiler.gni
2222
+++ b/build/config/compiler/compiler.gni
23-
@@ -141,6 +141,11 @@ declare_args() {
24-
# enables the ML inliner when targeting Android.
23+
@@ -140,6 +140,11 @@ declare_args() {
2524
# Currently the ML inliner is only supported on linux hosts
26-
use_ml_inliner = false # To enable: host_os == "linux" && is_android
27-
+
25+
use_ml_inliner = host_os == "linux" && is_android
26+
2827
+ # Set to true to enable output of ThinLTO index files used for training
2928
+ # ML models that can enhance characteristics of clang generated native
3029
+ # code.
3130
+ lld_emit_index = false
32-
}
31+
+
32+
# Set to true to use the android unwinder V2 implementation.
33+
use_android_unwinder_v2 = true
3334

34-
assert(!is_cfi || use_thin_lto, "CFI requires ThinLTO")
35-

0 commit comments

Comments
 (0)