diff options
| author | Alejandro Hernandez Samaniego <alejandro@enedino.org> | 2024-06-18 12:12:26 -0600 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-07-26 12:28:42 +0100 |
| commit | 09b49a35e1cd68f2e7aac35c8094adfc3ca38685 (patch) | |
| tree | 0dca38b6f20a5f90d89c339ebc675bae6e3c0715 /meta/lib/oeqa/selftest | |
| parent | beabc787cacb9b399f19eac39903948154dcce18 (diff) | |
| download | poky-09b49a35e1cd68f2e7aac35c8094adfc3ca38685.tar.gz | |
tclibc-picolibc: Adds a new TCLIBC variant to build with picolibc as C library
Enables usage of TCLIBC=picolibc extending OE functionality to build and use
picolibc based toolchains to build baremetal applications.
Picolibc is a set of standard C libraries, both libc and libm, designed for
smaller embedded systems with limited ROM and RAM. Picolibc includes code
from Newlib and AVR Libc, but adresses some of newlibs concerns, it retains
newlibs directory structure, math, string and locale implementations, but
removed the GPL bits used to build the library, swiches old C style code for
C18 and replaces autotools with meson.
This patch adds a picolibc recipe for the C library, a picolibc-helloworld
recipe that contains an example application and a testcase that builds it.
Picolibc can be built for ARM and RISCV architectures, its been tested both
for 32 and 64 bits, the provided example recipe produces the following output:
hello, world
Runqemu does not automatically show any output since it hides QEMU stderr which
is where the QEMU monitors output is directed to when using semihosting, but,
manually running the same QEMU command does work properly.
(From OE-Core rev: c7535ecaccb72ef21a61f9aec5c68e61fb4f6fb6)
Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandro@enedino.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/selftest')
| -rw-r--r-- | meta/lib/oeqa/selftest/cases/distrodata.py | 2 | ||||
| -rw-r--r-- | meta/lib/oeqa/selftest/cases/picolibc.py | 18 |
2 files changed, 19 insertions, 1 deletions
diff --git a/meta/lib/oeqa/selftest/cases/distrodata.py b/meta/lib/oeqa/selftest/cases/distrodata.py index bd37552364..7771a42e2b 100644 --- a/meta/lib/oeqa/selftest/cases/distrodata.py +++ b/meta/lib/oeqa/selftest/cases/distrodata.py | |||
| @@ -55,7 +55,7 @@ but their recipes claim otherwise by setting UPSTREAM_VERSION_UNKNOWN. Please re | |||
| 55 | return False | 55 | return False |
| 56 | 56 | ||
| 57 | def is_maintainer_exception(entry): | 57 | def is_maintainer_exception(entry): |
| 58 | exceptions = ["musl", "newlib", "linux-yocto", "linux-dummy", "mesa-gl", "libgfortran", "libx11-compose-data", | 58 | exceptions = ["musl", "newlib", "picolibc", "linux-yocto", "linux-dummy", "mesa-gl", "libgfortran", "libx11-compose-data", |
| 59 | "cve-update-nvd2-native",] | 59 | "cve-update-nvd2-native",] |
| 60 | for i in exceptions: | 60 | for i in exceptions: |
| 61 | if i in entry: | 61 | if i in entry: |
diff --git a/meta/lib/oeqa/selftest/cases/picolibc.py b/meta/lib/oeqa/selftest/cases/picolibc.py new file mode 100644 index 0000000000..e40b4fc3d3 --- /dev/null +++ b/meta/lib/oeqa/selftest/cases/picolibc.py | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | # | ||
| 2 | # Copyright OpenEmbedded Contributors | ||
| 3 | # | ||
| 4 | # SPDX-License-Identifier: MIT | ||
| 5 | # | ||
| 6 | |||
| 7 | from oeqa.selftest.case import OESelftestTestCase | ||
| 8 | from oeqa.utils.commands import bitbake, get_bb_var | ||
| 9 | |||
| 10 | class PicolibcTest(OESelftestTestCase): | ||
| 11 | |||
| 12 | def test_picolibc(self): | ||
| 13 | compatible_machines = ['qemuarm', 'qemuarm64', 'qemuriscv32', 'qemuriscv64'] | ||
| 14 | machine = get_bb_var('MACHINE') | ||
| 15 | if machine not in compatible_machines: | ||
| 16 | self.skipTest('This test only works with machines : %s' % ' '.join(compatible_machines)) | ||
| 17 | self.write_config('TCLIBC = "picolibc"') | ||
| 18 | bitbake("picolibc-helloworld") | ||
