-
Notifications
You must be signed in to change notification settings - Fork 951
Picolibc #871
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 #871
Conversation
I've looked at several libraries and I think this is the best one for our purposes. Other libraries I've looked at:
Further information: |
Looks like it'll need an improvement for macOS:
|
144b9e1
to
e1d6814
Compare
The problem was that functions like This PR is now ready for review. |
Would it make sense to set a build tag for the libc implementation that is used? For example I am trying to implement malloc() and free() in the runtime and it might be useful to be able to protect that with a build tag. I think for now I can do it with the build tags for cortex-m/riscv/gba, but that might be a little fragile in the long run. |
I'm not sure what you mean. Why would you need a build tag? It's not the C library that defines these functions but the C specification (just like with You can use the |
@aykevl I suggest rebasing against |
This refactor makes adding a new library (such as a libc) much easier in the future as it avoids a lot of duplicate code. Additionally, CI should become a little bit faster (~15s) as build-builtins now uses the build cache.
This is necessary for better CGo support on bare metal. Existing libraries expect to be able to include parts of libc and expect to be able to link to those symbols. Because with this all targets have a working libc, it is now possible to add tests to check that a libc in fact works basically. Not all parts of picolibc are included, such as the math or stdio parts. These should be added later, when needed. This commit also avoids the need for the custom memcpy/memset/memcmp symbols that are sometimes emitted by LLVM. The C library will take care of that.
Okay, rebased. |
Now merging, as this does seem to be the best option. |
Great! |
This is necessary for better CGo support on bare metal. Existing libraries expect to be able to include parts of libc and expect to be able to link to those symbols.
Because with this all targets have a working libc, it is now possible to add tests to check that a libc in fact works basically.
Not all parts of picolibc are included, such as the math or stdio parts. These should be added later, when needed.
This PR also avoids the need for the custom memcpy/memset/memcmp symbols that are sometimes emitted by LLVM. The C library will take care of that.
(The first commit is basically #849).