From 634159a5e66918dd4ffbb8dabd9c781d8c9845bc Mon Sep 17 00:00:00 2001 From: guoshichao Date: Sat, 3 Aug 2024 18:13:25 +0800 Subject: [PATCH] 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 --- libs/libc/assert/Make.defs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libs/libc/assert/Make.defs b/libs/libc/assert/Make.defs index 83f6dbf493..843b3793e5 100644 --- a/libs/libc/assert/Make.defs +++ b/libs/libc/assert/Make.defs @@ -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