-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Add POSIX times() support #51978
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
Comments
|
Converted to enhancement since newlib cannot map a POSIX function to the POSIX subsystem when it is not implemented by the POSIX subsystem. |
I did a brief investigation and the ISO C function p.s. ISO C |
Just added the modules label, as this blocks the Lua module |
Just dropping this link here for myself mainly. I'm trying to recall how I tied this into |
@stephanosio - do you still want to provide a fix for this, or would #57800 work? Also, not sure if we should consider this an enhancement or a bug. |
I think that #57800 would fix the problems I am having. |
Describe the bug
Using the newlib libc in Zephyr, the clock() and/or time() functions call the _times_r function which requires the _times function to be supplied, but this function is missing and the compilation fails at link time.
I have tested this while trying to create a lua module for Zephyr. Lua uses both the clock() and the time() function and the compilation fails with the following error:
... zephyr-sdk-0.15.0/arm-zephyr-eabi/arm-zephyr-eabi/lib/thumb/v7e-m/nofp/libc.a(lib_a-timesr.o): in function
_times_r': timesr.c:(.text._times_r+0x2): undefined reference to
_times'collect2: error: ld returned 1 exit status
To Reproduce
I prepared a hello_world example available at: https://github.com/tenllado/zephyr_hello_world_lua
The README.md file contains instructions to compile it as a west workspace. The project includes a file src/missing_stubs.c a definition of _times (and also _unlink, which is also missing in Zephyr). If you comment the _times definition you will obtain the error mentioned above.
Expected behavior
Zephyr should be including a definition of the _times function for the newlib libc library.
Impact
The absence of this function prevents the full support of the lua library for the zephyr project.
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: