summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2021-09-23 12:41:55 -0600
committerCommit Bot <commit-bot@chromium.org>2021-09-23 21:58:55 +0000
commit53f99af30ce81bbcffeba30906a68d61fcd5701d (patch)
treeb631da5bec15687d488e87088acbd494f7e7c843
parent0c7fa10264ca27807e46c2d7ba562fdcf1fc17cc (diff)
downloadchrome-ec-53f99af30ce81bbcffeba30906a68d61fcd5701d.tar.gz
zephyr: Bring no_libgcc back to v2.7
no_libgcc support was removed in upstream Zephyr OS, and we still depend on it to make coreboot-sdk work, as well as to add EC software panic handling for divide by zero. This hack emulates how no_libgcc used to function by removing -lgcc from the linker flags if no_libgcc is set. BUG=b:198824039 BRANCH=none TEST=compile volteer with v2.7_rc2 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I9e67277dd9f1f1b0dc36687b5255a99f82117a3b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3179311 Commit-Queue: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org>
-rw-r--r--zephyr/cmake/compiler/gcc/target.cmake7
1 files changed, 7 insertions, 0 deletions
diff --git a/zephyr/cmake/compiler/gcc/target.cmake b/zephyr/cmake/compiler/gcc/target.cmake
index 39e5839eba..5bdb6fc5f6 100644
--- a/zephyr/cmake/compiler/gcc/target.cmake
+++ b/zephyr/cmake/compiler/gcc/target.cmake
@@ -5,3 +5,10 @@
# Zephyr cmake system looks into ${TOOLCHAIN_ROOT}, but we just send
# this out to the copy in ${ZEPHYR_BASE}.
include("${ZEPHYR_BASE}/cmake/compiler/gcc/target.cmake")
+
+# no_libgcc support has been removed in upstream zephyr, but we still
+# depend on it. This ugly hack emulates what it used to do by undoing
+# what some of target.cmake does.
+if(no_libgcc)
+ list(REMOVE_ITEM TOOLCHAIN_LIBS gcc)
+endif()