xtensa: xcc: add a dummy atexit()
Some XCC toolchains do not provide atexit() which results in undefined reference error. So add a weak dummy atexit() for this siutation. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
parent
b6854d0cbc
commit
35c1d3615f
2 changed files with 18 additions and 0 deletions
|
@ -22,6 +22,10 @@ zephyr_library_sources_ifdef(CONFIG_DEBUG_COREDUMP coredump.c)
|
|||
|
||||
zephyr_library_sources_ifdef(CONFIG_GDBSTUB gdbstub.c)
|
||||
|
||||
if("${ZEPHYR_TOOLCHAIN_VARIANT}" STREQUAL "xcc")
|
||||
zephyr_library_sources(xcc_stubs.c)
|
||||
endif()
|
||||
|
||||
zephyr_library_include_directories(include)
|
||||
|
||||
add_subdirectory(startup)
|
||||
|
|
14
arch/xtensa/core/xcc_stubs.c
Normal file
14
arch/xtensa/core/xcc_stubs.c
Normal file
|
@ -0,0 +1,14 @@
|
|||
/*
|
||||
* Copyright (c) 2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <toolchain.h>
|
||||
|
||||
__weak int atexit(void (*function)(void))
|
||||
{
|
||||
ARG_UNUSED(function);
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue