summaryrefslogtreecommitdiff
path: root/zephyr/cmake
diff options
context:
space:
mode:
authorPatrick Georgi <pgeorgi@google.com>2021-01-25 21:51:49 +0100
committerCommit Bot <commit-bot@chromium.org>2021-01-26 11:07:52 +0000
commite40faf973d39a9d30d1333a482ee60943dcf8283 (patch)
tree2397661527170b6bab09ab0898bd2717f28c89e2 /zephyr/cmake
parent774e4bfab7119909e04ecec6c34b6cc85d979c22 (diff)
downloadchrome-ec-e40faf973d39a9d30d1333a482ee60943dcf8283.tar.gz
zephyr: Use Chrome EC's libgcc implementation over the compiler's
gcc's libgcc is built with a compile time notion of what an architecture's ABI will look like. If that happens to be wrong, you're out of luck. Instead, use our own implementation which, while written in assembly (and as such not as flexible as it could be) is processed with the right set of flags. BUG=b:178363068 BRANCH=none TEST=zephyr boots on kohaku when built with coreboot-sdk. Signed-off-by: Patrick Georgi <pgeorgi@google.com> Change-Id: I6d27bb48478081b6c2ff8927734492282e55e898 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2648666 Tested-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Patrick Georgi <pgeorgi@chromium.org>
Diffstat (limited to 'zephyr/cmake')
-rw-r--r--zephyr/cmake/toolchain/coreboot-sdk/target.cmake8
1 files changed, 8 insertions, 0 deletions
diff --git a/zephyr/cmake/toolchain/coreboot-sdk/target.cmake b/zephyr/cmake/toolchain/coreboot-sdk/target.cmake
index cf3a6ec736..5f3d86459b 100644
--- a/zephyr/cmake/toolchain/coreboot-sdk/target.cmake
+++ b/zephyr/cmake/toolchain/coreboot-sdk/target.cmake
@@ -29,3 +29,11 @@ set(CMAKE_OBJCOPY "${CROSS_COMPILE}objcopy")
set(CMAKE_OBJDUMP "${CROSS_COMPILE}objdump")
set(CMAKE_RANLIB "${CROSS_COMPILE}ranlib")
set(CMAKE_READELF "${CROSS_COMPILE}readelf")
+
+# On ARM, we don't use libgcc: It's built against a fixed target (e.g.
+# used instruction set, ABI, ISA extensions) and doesn't adapt when
+# compiler flags change any of these assumptions. Use our own mini-libgcc
+# instead.
+if("${ARCH}" STREQUAL "arm")
+ set(no_libgcc True)
+endif()