-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kernel kconfig: Do not enable STATIC_INIT_GNU w the old native_posix #75404
kernel kconfig: Do not enable STATIC_INIT_GNU w the old native_posix #75404
Conversation
native_posix (unlike native_sim) or its breathen (NATIVE_APPLICATION) link together the "runner" code and the embedded code. This means that when CONFIG_STATIC_INIT_GNU is set, any host library code (like the llvm fuzzer) constructors will get postponed to the Zephyr initialization. These libraries are unlikely to work if we do this. (the llvm fuzzer does not) So let's instead not enable STATIC_INIT_GNU for these targets. This means possible embedded library constructors will continue to be picked during the link and be still called during the native runner initialization instead of during the Zephyr OS initialization as they were just before we introduced STATIC_INIT_GNU in 6e977ae Note that native_posix will be deprecated shortly and its users are strongly encouraged to move to native_sim. Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me.
Note the board swap seems to be working in SOF for me (thesofproject/sof#9280), so no rush on this. Whether it's worth merging for any other hypothetical native_posix users is not something I'll argue about. :) |
Thanks @andyross I think it will be best to merge this before 3.7. We still support native_posix, and just like the fuzzer failed, other host libraries may also. |
native_posix (unlike native_sim) or its brethren (NATIVE_APPLICATION) link together the "runner" code and the embedded code in one pass. This means that when CONFIG_STATIC_INIT_GNU is set, any host library code (like the llvm fuzzer) constructors will get postponed to the Zephyr initialization.
These libraries are unlikely to work if we do this. (the llvm fuzzer does not)
So let's instead not enable STATIC_INIT_GNU for these targets. This means possible embedded library constructors will continue to be picked during the link and be still called during the native runner initialization instead of during the Zephyr OS initialization as they were just before we introduced STATIC_INIT_GNU in
6e977ae
Note that native_posix will be deprecated shortly and its users are strongly encouraged to move to native_sim.
Fixes #75407
Related to #74682