summaryrefslogtreecommitdiff
path: root/zephyr/shim/chip
diff options
context:
space:
mode:
authorKeith Short <keithshort@chromium.org>2021-03-19 10:20:27 -0600
committerCommit Bot <commit-bot@chromium.org>2021-03-24 20:19:48 +0000
commitd3468b111247e43ffdc1855f1c07ad802f1c3cc2 (patch)
treed781083a272121adeadd3b5f3f821f92e2a52dc0 /zephyr/shim/chip
parent5eb23205dd023a738a9cbc0ae90661a898274180 (diff)
downloadchrome-ec-d3468b111247e43ffdc1855f1c07ad802f1c3cc2.tar.gz
zephyr: Enable link time optimization (LTO)
The upstream Zephyr repo does not support LTO. Reconfigure the platform/ec source files into a cmake library so the LTO option can be enabled for all the platorm/ec sources. This reduces the Volteer flash image size by 9176 bytes. BUG=none BRANCH=none TEST=zmake testall TEST=boot zephyr-ec on Volteer, verfiy AP boots Cq-Depend: chromium:2776218 Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I8312773c8b21c498ec8116a8558b7571831159ff Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2776217 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'zephyr/shim/chip')
-rw-r--r--zephyr/shim/chip/CMakeLists.txt4
-rw-r--r--zephyr/shim/chip/npcx/CMakeLists.txt10
2 files changed, 7 insertions, 7 deletions
diff --git a/zephyr/shim/chip/CMakeLists.txt b/zephyr/shim/chip/CMakeLists.txt
index 1089552837..57ca829e24 100644
--- a/zephyr/shim/chip/CMakeLists.txt
+++ b/zephyr/shim/chip/CMakeLists.txt
@@ -13,8 +13,8 @@ endif()
# which are still being used. It is possible that eventually (when we also no
# longer require the platform/ec/chip/... headers) that we'll be able to get
# rid of this.
-zephyr_compile_definitions("CHIP_FAMILY_${CHIP_FAMILY}")
-zephyr_compile_definitions("CHIP_VARIANT_${CHIP_VARIANT}")
+zephyr_library_compile_definitions("CHIP_FAMILY_${CHIP_FAMILY}")
+zephyr_library_compile_definitions("CHIP_VARIANT_${CHIP_VARIANT}")
if (DEFINED CONFIG_SOC_FAMILY_NPCX)
add_subdirectory(npcx)
diff --git a/zephyr/shim/chip/npcx/CMakeLists.txt b/zephyr/shim/chip/npcx/CMakeLists.txt
index 3c841da1fe..93732b9154 100644
--- a/zephyr/shim/chip/npcx/CMakeLists.txt
+++ b/zephyr/shim/chip/npcx/CMakeLists.txt
@@ -2,11 +2,11 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-zephyr_include_directories(include)
+zephyr_library_include_directories(include)
-zephyr_sources(clock.c)
-zephyr_sources_ifdef(CONFIG_CROS_KB_RAW_NPCX keyboard_raw.c)
-zephyr_sources_ifdef(CONFIG_CROS_EC system.c)
+zephyr_library_sources(clock.c)
+zephyr_library_sources_ifdef(CONFIG_CROS_KB_RAW_NPCX keyboard_raw.c)
+zephyr_library_sources_ifdef(CONFIG_CROS_EC system.c)
-zephyr_sources_ifdef(CONFIG_PLATFORM_EC_EXTERNAL_STORAGE
+zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_EXTERNAL_STORAGE
system_external_storage.c)