-
Notifications
You must be signed in to change notification settings - Fork 8.4k
modem: backend: tty: Support building with any C library #101355
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
base: main
Are you sure you want to change the base?
Conversation
Ensure we call into the host C library open/close/read/write independently of which embedded C library the code is built with. We do this by: a) Using the native simulator nsi_host* trampolines when we just want to call straight into the host libC. b) Building in the native_simulator runner context (and therefore with the host C library) two functions which we call from the embedded side. Signed-off-by: Alberto Escolar Piedras <[email protected]>
This test itself (not the code under test) needs to be build with the host C library as it calls into its open/close/read/write APIs. So let's ensure we build it with it, independently of what the default C library may be. Signed-off-by: Alberto Escolar Piedras <[email protected]>
|
|
The last push was just to please SonarCloud |
| CONFIG_MODEM_MODULES=y | ||
| CONFIG_MODEM_BACKEND_TTY=y | ||
|
|
||
| CONFIG_EXTERNAL_LIBC=y |
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.
Maybe I am missing something but shouldn't this already be the default for native_sim?
Line 80 in 72360f8
| default EXTERNAL_LIBC if NATIVE_BUILD && !NATIVE_LIBC_INCOMPATIBLE |

Ensure we call into the host C library open/close/read/write independently of which embedded C library the code is built with.
We do this by:
a) Using the native simulator nsi_host* trampolines when we just want to call straight into the host libC.
b) Building in the native_simulator runner context (and therefore with the host C library) two functions which we call from the embedded side.
&
tests/subsys/modem/backends/tty: Ensure it is built with proper C lib
This test itself (not the code under test) needs to be build with the host C library as it calls into its open/close/read/write APIs.
So let's ensure we build it with it, independently of what the default C library may be.
Note there is minor functional change, the code before would block during polls during 100ms and then wait 100ms until the next poll. Now it does not block during polls (it just checks and returns immediately) and then waits 100ms.