-
Notifications
You must be signed in to change notification settings - Fork 2k
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: model as a feature #15011
picolibc: model as a feature #15011
Conversation
On `samr21-xpro` this saves 5624 bytes of ROM and 108 bytes of RAM.
73a0357
to
69dd791
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.
ACK, dependencies against FEATURES_USED
and USEMODULE
is the way to go.
Hm something is missing in Riotdocker 🤔 |
Looks like we have to blacklist |
But why did this not fail before? |
We never compiled picolibc on CI before. |
Aha! |
This is fixed now: the workers have been updated on riotbuild. There are still a couple of issues on the Breeze workers, but I can't reproduce locally and it doesn't seem to be related to this PR. Maybe it also needs an update ? |
a4f4139
to
529e21e
Compare
cpu/fe310/Kconfig
Outdated
@@ -8,6 +8,7 @@ | |||
config CPU_ARCH_RISCV | |||
bool | |||
select HAS_ARCH_RISCV | |||
select HAS_PICOLIBC if !'$(RIOT_CI_BUILD)' |
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.
This doesn't seem to work. @leandrolanzieri do you know how to check if RIOT_CI_BUILD is set from Kconfig ?
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.
I think comparing strings would be the way. Like so:
Line 44 in ac097bb
default y if '$(TEST_KCONFIG)' = '1' |
Maybe select HAS_PICOLIBC if '$(RIOT_CI_BUILD)' != '1'
?
The RISC-V toolchain in riotdocker has issues with picolibc and will still include newlib headers. This leads to conflicts like ``` In file included from [01m[Knanostubs.c:22[m[K: [01m[K/usr/local/picolibc/riscv-none-embed/include/stdio.h:270:23:[m[K [01;31m[Kerror: [m[Kconflicting types for '[01m[K__FILE[m[K' typedef struct __file [01;31m[K__FILE[m[K; [01;31m[K^~~~~~[m[K In file included from [01m[K/opt/gnu-mcu-eclipse/riscv-none-gcc/8.2.0-2.2-20190521-0004/riscv-none-embed/include/reent.h:93[m[K, from [01m[Knanostubs.c:20[m[K: [01m[K/opt/gnu-mcu-eclipse/riscv-none-gcc/8.2.0-2.2-20190521-0004/riscv-none-embed/include/sys/reent.h:287:26:[m[K [01;36m[Knote: [m[Kprevious declaration of '[01m[K__FILE[m[K' was here typedef struct __sFILE [01;36m[K__FILE[m[K; [01;36m[K^~~~~~[m[K ``` The problem does not occur when installing both the toolchain and picolibc directly from the Debian / Ubuntu repositories, but CI uses an older Ubuntu version that does not have those packages yet, so it builds them manually. Blacklist RISC-V until CI has been updated.
529e21e
to
45270da
Compare
@benpicco While developing a board definition for the LilyGO-T-Display-GD32 board, I was wondering why I got a Kconfig feature mismatch for |
19824: boards/sipeed_longan_nano: separate board definition for Sipeed Longan Nano TFT r=benpicco a=gschorcht ### Contribution description This PR provides a minimal separate board definition for the Sipeed Longan Nano version with TFT display which is just an extension of `boards/sipeed-longan-nano` with enabled TFT display module. From the lessons we had to learn with the Kconfig modelling of optional hardware, the TFT version of the Sipeed Longan Nano board has been split off into its own board definition based on the existing Siepeed Longan Nano board. Commits ba29a5e, 237819e, 6d8b56d and c5faf34 are small cleanups of peripheral configurations and could be split from this PR as follow-up PR (changes +70 -36). ### Testing procedure Green CI ``` BOARD=sipeed-longan-nano-tft make -j8 -C tests/drivers/st77xx flash ``` should work ### Issues/PRs references Follow up to PR #19813 and PR #19814 Prerequisite for PR #19825 and PR #19827 19855: gnrc_static: fix static PID assignment r=benpicco a=benpicco 19862: cpu/riscv_common: remove picolibc from blacklisting in CI r=benpicco a=gschorcht ### Contribution description `picolibc` is now supported by the RISC-V toolchain in `riotdocker`. It is not necessary to blacklist it in CI any longer. Reference: `picolib` was blacklisted by commit 45270da in PR #15011. ### Testing procedure 1. Green CI 2. Check feature list for CI compilation: ``` BUILD_IN_DOCKER=1 RIOT_CI_BUILD=1 FEATURES_OPTIONAL=picolibc \ BOARD=sipeed-longan-nano make -j8 -C tests/sys/shell info-modules | grep picolib picolibc picolibc_stdout_buffered picolibc_syscalls_default ``` ### Issues/PRs references Co-authored-by: Gunar Schorcht <[email protected]> Co-authored-by: Benjamin Valentin <[email protected]>
Contribution description
Previously picolibc was selected via the
PICOLIBC=1
command line parameter.This changes that to modelling picolibc as a platform feature (as picolibc is not available yet for all architectures supported by RIOT).
Testing procedure
Add
FEATURES_OPTIONAL += picolibc
to yourMakefile
to opportunistically use picolibc.Issues/PRs references
suggested in #14830 (comment)