-
Notifications
You must be signed in to change notification settings - Fork 135
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
picolibc: long-long print support not enabled on prebuilt library #684
Comments
The pre-built library follows the default configuration for picolibc so that it matches other toolchains that include picolibc, including ARM LLVM, Debian, crosstool-ng and the ARM GNU toolchains. Note that if you select the floating point printf option, that version does include long long support. We could change that easily enough; it would increase the size of printf modestly, but still be smaller than the minimal C library. Alternatively, selecting IO_LONG_LONG could switch to the floating point version of the code, but that is pretty large (several kB). |
I can appreciate the complexities of managing a default configuration for all users, but isn't |
Yup, I'm not saying the sdk config shouldn't be changed to match what Zephyr users expect, just explaining where the current settings came from. |
Looks like this will potentially be fixed with picolibc 1.8.5 https://github.com/picolibc/picolibc#picolibc-version-185 |
Yup, version 1.8.5 provides pre-built versions of all of the printf modes supported by current Zephyr configurations. |
Picolibc depends on
io-long-long=true
to support%lld
format specifiers, which does not appear to be enabled in the prebuilt library.As a result, the following code (all with
CONFIG_CBPRINTF_FULL_INTEGRAL=y
):Outputs this with
CONFIG_PICOLIBC
:This with
CONFIG_PICOLIBC=y CONFIG_PICOLIBC_USE_MODULE=y CONFIG_PICOLIBC_IO_LONG_LONG=y
And this with
CONFIG_NEWLIB_LIBC
:I think that the support should be enabled by default for the pre-built library.
Tested on Zephyr SDK v0.16.0, but I haven't seen any notes about it on newer releases and this line doesn't have the option enabled: https://github.com/zephyrproject-rtos/sdk-ng/blob/4a824f648c39c494bfc016241c44243c7a599048/configs/common.config#LL75
https://github.com/picolibc/picolibc/blob/main/doc/printf.md
The text was updated successfully, but these errors were encountered: