Skip to content

Commit

Permalink
kernel: native_posix: Don't run global C++ constructors
Browse files Browse the repository at this point in the history
On the native_posix board global object constructors
are run by the underlying OS runtime init prior to
Zephyr kernel init. Thus Zephyr should not run global
object constructors a second time. Doing so breaks
application behavior that relies on global
constructors doing work that must be done only once.
See bug #36858 for more information.

Signed-off-by: David Palchak <palchak@google.com>
  • Loading branch information
palchak-google committed Jul 12, 2021
1 parent 9bc9e15 commit d10b46d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/init.c
Expand Up @@ -197,7 +197,7 @@ static void bg_thread_main(void *unused1, void *unused2, void *unused3)
#endif
boot_banner();

#ifdef CONFIG_CPLUSPLUS
#if defined(CONFIG_CPLUSPLUS) && !defined(CONFIG_ARCH_POSIX)
/* Process the .ctors and .init_array sections */
extern void __do_global_ctors_aux(void);
extern void __do_init_array_aux(void);
Expand Down

0 comments on commit d10b46d

Please sign in to comment.