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:
Daniel Leung 2022-01-20 16:27:46 -08:00 committed by Anas Nashif
commit 35c1d3615f
2 changed files with 18 additions and 0 deletions

View file

@ -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)

View 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;
}