# Copyright 2020 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

# 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")

# Copyright 2020 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

# 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()

Bring no_libgcc back to v2.7
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 <d3f605bef1867f59845d4ce6e4f83b8dc9e4e0ae@chromium.org>
Change-Id: I9e67277dd9f1f1b0dc36687b5255a99f82117a3b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3179311
Commit-Queue: Denis Brockus <6b21e8190fb5e373363fb95271367073a16474ef@chromium.org>
Reviewed-by: Denis Brockus <6b21e8190fb5e373363fb95271367073a16474ef@chromium.org>
