-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
libC kconfig: default to PICOLIBC for NATIVE_LIBRARY if POSIX_API or GETOPT #63855
Conversation
Is there any case for which we prefer the host C library with native_sim? It seems like we should always use a C library that sits atop Zephyr OS APIs instead of the host C library which sits atop the host OS APIs? |
It is a trade off: The argument for always using picolibc is the uniformity with other targets, testing in native_sim being more comparable to testing in real targets, and avoiding developers calling by mistake into the host OS.
When 1. is solved, I would still give the option to build with the host library for 2. and 3., but I would be quite inclined to default to PICOLIBC in native_sim. |
When building with the POSIX_API we cannot use the host libC. When using GETOPT it is similarly quite difficult for users to use the host libC. So to make it easier for users, let's just default to PICOBLIC in those cases, while we continue defaulting to the host library in other cases so users can use the Linux APIs for whatever test functionality they want. Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
f2a0e6d
to
3bd5df5
Compare
I just changed the commit to also default to picolibc for native library when getopt is set, as that config is quite tricky to get working with the host libC |
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.
This seems like a reasonable migration plan.
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.
LGTM
The nsi_foo() approach is interesting. I was going to approach that problem slightly differently, but that seems to be working well. |
When building with the POSIX_API we cannot use the host libC.
When using GETOPT it is similarly quite difficult for users
to use the host libC.
So to make it easier for users, let's just default to PICOBLIC
in those cases,
while we continue defaulting to the host library in other cases
so users can use the Linux APIs for whatever test functionality
they want.