summaryrefslogtreecommitdiff
path: root/zephyr/shim/src/CMakeLists.txt
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/src/CMakeLists.txt
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/src/CMakeLists.txt')
-rw-r--r--zephyr/shim/src/CMakeLists.txt58
1 files changed, 29 insertions, 29 deletions
diff --git a/zephyr/shim/src/CMakeLists.txt b/zephyr/shim/src/CMakeLists.txt
index 84def1f5f9..ce4ed14323 100644
--- a/zephyr/shim/src/CMakeLists.txt
+++ b/zephyr/shim/src/CMakeLists.txt
@@ -2,37 +2,37 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-zephyr_sources(console.c)
-zephyr_sources(crc.c)
-zephyr_sources(gpio.c)
-zephyr_sources(util.c)
+zephyr_library_sources(console.c)
+zephyr_library_sources(crc.c)
+zephyr_library_sources(gpio.c)
+zephyr_library_sources(util.c)
if (DEFINED CONFIG_ARCH_POSIX)
- zephyr_sources(ztest_system.c)
+ zephyr_library_sources(ztest_system.c)
else()
- zephyr_sources(system.c)
- zephyr_sources("${PLATFORM_EC}/common/system.c")
+ zephyr_library_sources(system.c)
+ zephyr_library_sources("${PLATFORM_EC}/common/system.c")
endif()
-zephyr_sources_ifdef(no_libgcc libgcc_${ARCH}.S)
+zephyr_library_sources_ifdef(no_libgcc libgcc_${ARCH}.S)
-zephyr_sources_ifdef(CONFIG_PLATFORM_EC_ADC adc.c)
-zephyr_sources_ifdef(CONFIG_PLATFORM_EC_ESPI espi.c)
-zephyr_sources_ifdef(CONFIG_PLATFORM_EC_FAN fan.c)
-zephyr_sources_ifdef(CONFIG_PLATFORM_EC_FLASH flash.c)
-zephyr_sources_ifdef(CONFIG_PLATFORM_EC_HOOKS hooks.c)
-zephyr_sources_ifdef(CONFIG_PLATFORM_EC_HOSTCMD host_command.c)
-zephyr_sources_ifdef(CONFIG_PLATFORM_EC_HOSTCMD_CONSOLE
- console_buffer.c)
-zephyr_sources_ifdef(CONFIG_PLATFORM_EC_MKBP_EVENT mkbp_event.c)
-zephyr_sources_ifdef(CONFIG_PLATFORM_EC_MOTIONSENSE
- motionsense_sensors.c)
-zephyr_sources_ifdef(CONFIG_PLATFORM_EC_MPU mpu.c)
-zephyr_sources_ifdef(CONFIG_PLATFORM_EC_PANIC panic.c)
-zephyr_sources_ifdef(CONFIG_PLATFORM_EC_PWM pwm.c)
-zephyr_sources_ifdef(CONFIG_PLATFORM_EC_RTC rtc.c)
-zephyr_sources_ifdef(CONFIG_PLATFORM_EC_TEMP_SENSOR temp_sensors.c
- thermal.c)
-zephyr_sources_ifdef(CONFIG_PLATFORM_EC_TIMER hwtimer.c)
-zephyr_sources_ifdef(CONFIG_PLATFORM_EC_I2C i2c.c)
-zephyr_sources_ifdef(CONFIG_SHIMMED_TASKS tasks.c)
-zephyr_sources_ifdef(CONFIG_PLATFORM_EC_WATCHDOG watchdog.c)
+zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_ADC adc.c)
+zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_ESPI espi.c)
+zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_FAN fan.c)
+zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_FLASH flash.c)
+zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_HOOKS hooks.c)
+zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_HOSTCMD host_command.c)
+zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_HOSTCMD_CONSOLE
+ console_buffer.c)
+zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_MKBP_EVENT mkbp_event.c)
+zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_MOTIONSENSE
+ motionsense_sensors.c)
+zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_MPU mpu.c)
+zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_PANIC panic.c)
+zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_PWM pwm.c)
+zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_RTC rtc.c)
+zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_TEMP_SENSOR temp_sensors.c
+ thermal.c)
+zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_TIMER hwtimer.c)
+zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_I2C i2c.c)
+zephyr_library_sources_ifdef(CONFIG_SHIMMED_TASKS tasks.c)
+zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_WATCHDOG watchdog.c)