Skip to content

picolibc: Add initial support for picolibc#109

Merged
kaspar030 merged 1 commit intoRIOT-OS:masterfrom
bergzand:pr/picolibc/initial
Aug 25, 2020
Merged

picolibc: Add initial support for picolibc#109
kaspar030 merged 1 commit intoRIOT-OS:masterfrom
bergzand:pr/picolibc/initial

Conversation

@bergzand
Copy link
Member

@bergzand bergzand commented Jul 7, 2020

Add support for picolibc in the docker image.

This builds the picolibc implementation for arm, esp32 and riscv32. The riscv implementation seems to work with RIOT-OS/RIOT#12305, but I haven't tested it yet on actual hardware as I don't own one of the hifive boards.

Meson is grabbed from pip and not from the bionic repos because the version in bionic is too old (0.45 vs 0.50)

An alternative approach would be to simply grab the debian buster deb's and install those. Please let me know what is preferred here.

@bergzand bergzand requested a review from aabadie July 7, 2020 13:15
@aabadie
Copy link
Contributor

aabadie commented Jul 7, 2020

I tested the build in Docker using this PR and the PR in RIOT. It works on samr21 and simplify things when one just wants to do a quick test.

@aabadie
Copy link
Contributor

aabadie commented Jul 7, 2020

Do you think the cross-riscv-none-embed.txt file could be contributed upstream (with a do-riscv-none-embed-configure script similar to other architecture) ?

@kaspar030
Copy link
Contributor

please rebase

@bergzand bergzand force-pushed the pr/picolibc/initial branch from 9504759 to 58138f4 Compare August 12, 2020 12:48
@bergzand
Copy link
Member Author

please rebase

Rebased

@kaspar030
Copy link
Contributor

Rebased

and please squash. the way I see it, this is not used in master, so we cannot break much.

@bergzand bergzand force-pushed the pr/picolibc/initial branch from 0786dcd to 828c078 Compare August 13, 2020 09:05
@bergzand
Copy link
Member Author

Squashed!

@benpicco
Copy link
Contributor

Would be great if we can test the picolibc code paths in CI :)

Not sure how long this takes to compile, but there is also a Debian package.

Copy link
Contributor

@kaspar030 kaspar030 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK.

@kaspar030 kaspar030 merged commit a2e6972 into RIOT-OS:master Aug 25, 2020
@kaspar030
Copy link
Contributor

Let's see...

@bergzand bergzand deleted the pr/picolibc/initial branch August 25, 2020 09:41
@benpicco
Copy link
Contributor

Looks like there is a conflict with the RISC-V toolchain: examples/gnrc_minimal/hifive1:gnu.txt

@benpicco
Copy link
Contributor

benpicco commented Sep 30, 2020

When I try to build RIOT-OS/RIOT#15011 with BUILD_IN_DOCKER=1 I get

/data/riotbuild/riotbase/sys/picolibc_syscalls_default/syscalls.c:236:5: error: implicit declaration of function 'FDEV_SETUP_STREAM' [-Werror=implicit-function-declaration]
  236 |     FDEV_SETUP_STREAM(picolibc_put, picolibc_get, picolibc_flush, _FDEV_SETUP_RW);
      |     ^~~~~~~~~~~~~~~~~
/data/riotbuild/riotbase/sys/picolibc_syscalls_default/syscalls.c:236:67: error: '_FDEV_SETUP_RW' undeclared here (not in a function)
  236 |     FDEV_SETUP_STREAM(picolibc_put, picolibc_get, picolibc_flush, _FDEV_SETUP_RW);
      |                                                                   ^~~~~~~~~~~~~~
cc1: all warnings being treated as errors

This does not happen when I use the host-installed picolibc from the Debian package.

FDEV_SETUP_STREAM is provided by picolibc's stdio.h

bors bot added a commit that referenced this pull request Dec 15, 2022
116: Dockerfile: install picolibc & ARM/RISC-V GCC via package manager r=maribu a=benpicco

There seems to be a problem with the picolibc install in riotdocker. (#109 (comment))
Instead of trying to sort that out by ourself, just use the package [provided by Debian](https://packages.debian.org/search?suite=bullseye&searchon=names&keywords=picolibc). It has ~~no dependencies~~ the respective gcc packages as dependencies. 

So instead of manually downloading the toolchain, also install that from the repository. 

Co-authored-by: Benjamin Valentin <benpicco@googlemail.com>
Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
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.

4 participants