-
Notifications
You must be signed in to change notification settings - Fork 46
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 #200
Picolibc #200
Conversation
7b811a6
to
ee3dc99
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Keith!
Just a few comments related to maybe de-duplicating some code here. Is there any way to get picolibc's shim library to use our existing libgloss implementations of _start
and sbrk
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
I'm happy with either version of sbrk, but the ifdef version might be slightly easier to maintain? |
let's use the ifdef one then; we can always switch back :-) |
49953fd
to
f86e328
Compare
This provides a definition of size_t Signed-off-by: Keith Packard <keithp@keithp.com>
I've rebased and tested this with Nate's updated BSP generation code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Some question for curiosity
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a spelling error to fix :)
This library hooks picolibc to libmetal, offering a small number of APIs. Signed-off-by: Keith Packard <keithp@keithp.com> --- v2: Initialize TLS base register from __tls_base and __tdata_size The RISC-V ABI sets the tp register between tls initialized data and tls uninitialized data areas. The linker sets __tls_base to the start of tls data and __tdata_size to the size of the initialized data area, so the correct tp value is the sum of these two symbols. libriscv__pico__metal.a → libmetal-pico.a Use the name that freedom-e-sdk wants Use gloss/crt0.S and gloss/sys_exit.c for libmetal-pico.a Share source code, especially the startup code, between the two C library users to avoid duplicating work between them. Expose sbrk/brk instead of _sbrk/_brk when compiled against picolibc This changes the names of these two functions when using picolibc instead of newlib. Otherwise, the implementation is the same. Use gloss/sys_sbrk.c with picolibc Instead of a separate copy with minor edits. v3: Use correct TLS initialization value. Risc-V places TP at the base of TLS storage, not between data and BSS values. v4: Fix spelling error in Makefile.am (libmetail-pico → libmetal-pico) Found-by: Nathaniel Graff <nathaniel.graff@sifive.com>
Support Debug/Release build configurations
Adds 'metal-pico' library which contains interfaces for picolibc to sit atop freedom-metal