mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 07:12:54 +08:00
toolchain/lto: enable lto flags only on GNU toolchain
Some commercial customized toolchains do not support these options Signed-off-by: chao an <anchao@lixiang.com>
This commit is contained in:
@@ -24,10 +24,12 @@ ifeq ($(CONFIG_STACK_CANARIES),y)
|
|||||||
CSRCS += lib_stackchk.c
|
CSRCS += lib_stackchk.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_ARCH_TOOLCHAIN_GNU),y)
|
||||||
ifeq ($(CONFIG_LTO_NONE),n)
|
ifeq ($(CONFIG_LTO_NONE),n)
|
||||||
assert/lib_assert.c_CFLAGS += -fno-lto
|
assert/lib_assert.c_CFLAGS += -fno-lto
|
||||||
assert/lib_stackchk.c_CFLAGS += -fno-lto
|
assert/lib_stackchk.c_CFLAGS += -fno-lto
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
# Add the assert directory to the build
|
# Add the assert directory to the build
|
||||||
|
|
||||||
|
|||||||
@@ -24,8 +24,12 @@ CSRCS += kasan.c
|
|||||||
|
|
||||||
# Disable kernel-address in mm subsystem
|
# Disable kernel-address in mm subsystem
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_ARCH_TOOLCHAIN_GNU),y)
|
||||||
CFLAGS += -fno-sanitize=kernel-address
|
CFLAGS += -fno-sanitize=kernel-address
|
||||||
|
ifeq ($(CONFIG_LTO_NONE),n)
|
||||||
CFLAGS += -fno-lto
|
CFLAGS += -fno-lto
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
# Add the core heap directory to the build
|
# Add the core heap directory to the build
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user