Skip to content

Commit

Permalink
Adapt to Makefile changes in ChromeOS EC repository
Browse files Browse the repository at this point in the history
The build system has been slightly changed, requiring a slight change in
how to specify the path to the cross compiler.

Also, the EC codebase now assumes GCC 11 or above, while even the newest
lowRISC/crt provides gcc 10.3.1.  So a small patch was required, as the
older GCC does not recognize the `min-pagesize` parameter for
controlling GCC warnings.
  • Loading branch information
jesultra committed Dec 6, 2024
1 parent 80f9727 commit 18a1063
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion third_party/chromium/BUILD.ec_src.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ make(
"BOARD=hyperdebug",
"ALLOW_CONFIG=1",
"BUILDCC_PREFIX={}".format(host_prefix),
"CROSS_COMPILE_arm={}/{}".format(bazel_root, arm_prefix),
"CROSS_COMPILE={}/{}".format(bazel_root, arm_prefix),
"out=$$INSTALLDIR$$",
],
build_data = [
Expand Down
1 change: 1 addition & 0 deletions third_party/chromium/repos.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def chromium_repos():
build_file = "//third_party/chromium:BUILD.ec_src.bazel",
patches = [
"//third_party/chromium:ec-custom-version.patch",
"//third_party/chromium:work-with-old-gcc-10.patch",
],
patch_args = ["-p1"],
)
13 changes: 13 additions & 0 deletions third_party/chromium/work-with-old-gcc-10.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/Makefile.toolchain b/Makefile.toolchain
index 76a0504e35..97b1267e3d 100644
--- a/Makefile.toolchain
+++ b/Makefile.toolchain
@@ -210,7 +210,7 @@ ifneq ($(CROSS_COMPILE_CC_NAME),clang)
# is set to 0 such that GCC never generates any warnings for the constant
# address pointers. For more details, refer to the GCC PR99578.
ifneq ($(BOARD), host)
-CFLAGS+= --param min-pagesize=0
+
endif
endif
ifneq ($(CROSS_COMPILE_CC_NAME),clang)

0 comments on commit 18a1063

Please sign in to comment.