zephyr/subsys/cpp/cpp_init.c
Evgeniy Paltsev 60fdec616b ARC: MWDT: get rid of MWDT startup libs
__cxa_atexit implementation provided by MWDT startup code calls
malloc which isn't supported right now. As we don't support
calling static destructors in Zephyr let's provide our own
__cxa_atexit stub and get rid of MWDT startup libs
entirely.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
2021-09-01 17:08:32 -04:00

32 lines
483 B
C

/*
* Copyright (c) 2021 Synopsys, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*
* Author: Evgeniy Paltsev
*/
#ifdef CONFIG_CPP_STATIC_INIT_GNU
void __do_global_ctors_aux(void);
void __do_init_array_aux(void);
void z_cpp_init_static(void)
{
__do_global_ctors_aux();
__do_init_array_aux();
}
#else
#ifdef __CCAC__
void __do_global_ctors_aux(void);
void z_cpp_init_static(void)
{
__do_global_ctors_aux();
}
#endif /* __CCAC__ */
#endif /* CONFIG_CPP_STATIC_INIT_GNU */