greenhills: fix the no-lto link warning

ccarm: Warning: Unknown option "-fno-lto" passed to linker
CC:  assert/lib_stackchk.c ccarm: Warning: Unknown option "-fno-lto" passed to linker

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
This commit is contained in:
guoshichao 2024-08-03 18:13:25 +08:00 committed by archer
parent 4a4725386d
commit 634159a5e6

View file

@ -20,8 +20,11 @@
CSRCS += lib_assert.c lib_stackchk.c
ifeq ($(CONFIG_ARCH_TOOLCHAIN_GNU),y)
ifeq ($(CONFIG_LTO_NONE),n)
ifeq ($(CONFIG_LTO_NONE),n)
ifeq ($(CONFIG_ARCH_TOOLCHAIN_GHS),y)
assert/lib_assert.c_CFLAGS += -Onolink
assert/lib_stackchk.c_CFLAGS += -Onolink
else ifeq ($(CONFIG_ARCH_TOOLCHAIN_GNU),y)
assert/lib_assert.c_CFLAGS += -fno-lto
assert/lib_stackchk.c_CFLAGS += -fno-lto
endif