linker: ensure global constructors only run once Rename the symbols used to denote the locations of the global constructor lists and modify the Zephyr start-up code accordingly. On POSIX systems this ensures that the native libc init code won't find any constructors to run before Zephyr loads. Fixes #39347, #36858 Signed-off-by: David Palchak <palchak@google.com>
diff --git a/kernel/init.c b/kernel/init.c index d4acea3..f6093ab 100644 --- a/kernel/init.c +++ b/kernel/init.c
@@ -216,7 +216,7 @@ #endif boot_banner(); -#if defined(CONFIG_CPLUSPLUS) && !defined(CONFIG_ARCH_POSIX) +#if defined(CONFIG_CPLUSPLUS) void z_cpp_init_static(void); z_cpp_init_static(); #endif