libc: compile stackchk function by default

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
This commit is contained in:
yinshengkai 2024-05-30 11:40:04 +08:00 committed by Xiang Xiao
parent 279a676978
commit 272248de37
3 changed files with 2 additions and 14 deletions

View File

@ -18,11 +18,7 @@
#
# ##############################################################################
set(SRCS lib_assert.c)
if(CONFIG_STACK_CANARIES)
list(APPEND SRCS lib_stackchk.c)
endif()
set(SRCS lib_assert.c lib_stackchk.c)
if(CONFIG_ARCH_TOOLCHAIN_GNU AND NOT CONFIG_LTO_NONE)
set_source_files_properties(lib_assert.c DIRECTORY .. PROPERTIES COMPILE_FLAGS

View File

@ -18,11 +18,7 @@
#
############################################################################
CSRCS += lib_assert.c
ifeq ($(CONFIG_STACK_CANARIES),y)
CSRCS += lib_stackchk.c
endif
CSRCS += lib_assert.c lib_stackchk.c
ifeq ($(CONFIG_ARCH_TOOLCHAIN_GNU),y)
ifeq ($(CONFIG_LTO_NONE),n)

View File

@ -24,8 +24,6 @@
#include <assert.h>
#ifdef CONFIG_STACK_CANARIES
/****************************************************************************
* Public Data
****************************************************************************/
@ -56,5 +54,3 @@ void __stack_chk_fail(void)
{
PANIC();
}
#endif /* CONFIG_STACK_CANARIES */