Skip to content

fix(cbor): Fix build with picolibc (IEC-512)#718

Open
abobija wants to merge 1 commit intoespressif:masterfrom
abobija:cbor-fix-picolibc
Open

fix(cbor): Fix build with picolibc (IEC-512)#718
abobija wants to merge 1 commit intoespressif:masterfrom
abobija:cbor-fix-picolibc

Conversation

@abobija
Copy link
Copy Markdown

@abobija abobija commented Apr 2, 2026

Checklist

  • Component contains License
  • Component contains README.md
  • Component contains idf_component.yml file with url field defined
  • Component was added to upload job
  • Component was added to build job
  • Optional: Component contains unit tests
  • CI passing

Change description

Build of project that uses espressif/cbor^0.6.1~4 component and picolibc (with idf v6+) fails since picolibc does not have implementation of fopencookie function and cookie_io_functions_t typedef.

By defining __APPLE__ we are switching to picolibc supported funopen alternative that makes project successfully compiled on idf v6+ using picolibc. Note that CONFIG_LIBC_PICOLIBC_NEWLIB_COMPATIBILITY still needs to be enabled to compile with picolibc, even if we switch to __APPLE__.

It would be nice if cbor component could work without defining CONFIG_LIBC_PICOLIBC_NEWLIB_COMPATIBILITY and rely completely on picolibc without any hacks.

I've opened a PR in origin tinycbor's repo as well to support picolibc, so maybe we will accomplish something:
intel/tinycbor#319

Maybe to wait if intel's tinycbor is going to support picolibc...

Build of project that uses `espressif/cbor^0.6.1~4` component
fails with esp-idf v6.0+ using picolibc since picolibc does
not have implementation of fopencookie function.
By defining `__APPLE__` we are switching to
picolibc supported `funopen` alternative.
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions github-actions bot changed the title cbor: Fix build for idf v6+ and picolibc cbor: Fix build for idf v6+ and picolibc (IEC-512) Apr 2, 2026
@abobija abobija changed the title cbor: Fix build for idf v6+ and picolibc (IEC-512) cbor: Fix build for picolibc (IEC-512) Apr 2, 2026
@abobija abobija changed the title cbor: Fix build for picolibc (IEC-512) fix(cbor): Fix build with picolibc (IEC-512) Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants