Skip to content
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

Make Picolibc the default libc and Newlib an optional component for SDK GNU toolchain #833

Open
stephanosio opened this issue Nov 1, 2024 · 2 comments
Assignees
Labels
area: crosstool-ng Issues related to crosstool-ng area: GCC Issues related to GCC (GNU Compiler Collection) area: Newlib Issues related to Newlib (C Library) area: Picolibc Issues related to Picolibc enhancement

Comments

@stephanosio
Copy link
Member

Since Picolibc is now the default libc for Zephyr serving as a complete replacement of Newlib and only niche applications are using Newlib, there is no good reason to ship Newlib in the SDK GNU toolchain distribution by default in spite of its significant download size and disk space requirements.

With the above in mind, this proposes to rearrange the SDK GNU toolchain distribution such that:

  1. Picolibc is the default libc under the toolchain prefix (i.e. (TOOLCHAIN_PREFIX)/(TARGET)/lib/lib{c,m}.a and the headers under (PREFIX)/(TARGET)/include will be from Picolibc).
  2. Newlib is placed under its own prefix, (TOOLCHAIN_PREFIX)/newlib, and distributed as a separate "overlay" archive, toolchain_overlay_(TARGET).{tar.xz,7z}, that can be downloaded optionally.
@stephanosio stephanosio added area: GCC Issues related to GCC (GNU Compiler Collection) area: Newlib Issues related to Newlib (C Library) area: crosstool-ng Issues related to crosstool-ng area: Picolibc Issues related to Picolibc labels Nov 1, 2024
@stephanosio stephanosio self-assigned this Nov 1, 2024
@stephanosio
Copy link
Member Author

cc @keith-packard

@keith-packard
Copy link
Collaborator

Yup, this might take a bit of re-arranging inside crosstool-ng, but we've already demonstrated we can make newlib work this way for newlib-nano.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: crosstool-ng Issues related to crosstool-ng area: GCC Issues related to GCC (GNU Compiler Collection) area: Newlib Issues related to Newlib (C Library) area: Picolibc Issues related to Picolibc enhancement
Projects
None yet
Development

No branches or pull requests

2 participants