From f229389d4d74c7e51ef263cd0c678aa291583bfe Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 10 Jan 2023 21:17:32 -0800 Subject: [PATCH 1/2] libc: Default to picolibc where supported This switches the default C library to picolibc for all targets which support it. Signed-off-by: Keith Packard --- lib/libc/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/Kconfig b/lib/libc/Kconfig index b864f5b34f103b..522bd4a57b3cb2 100644 --- a/lib/libc/Kconfig +++ b/lib/libc/Kconfig @@ -54,8 +54,8 @@ menu "C Library" choice LIBC_IMPLEMENTATION prompt "C Library Implementation" default EXTERNAL_LIBC if NATIVE_BUILD + default PICOLIBC default NEWLIB_LIBC if REQUIRES_FULL_LIBC - default PICOLIBC if REQUIRES_FULL_LIBC default MINIMAL_LIBC config MINIMAL_LIBC From 1cf5b432a78167a3915c5a7663bd0100273ba5ed Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 10 Aug 2023 10:24:51 -0700 Subject: [PATCH 2/2] tests/kernel: Also run tests using minimallibc With picolibc being the default C library, we need to explicitly include testing against the minimal C library for kernel components. Signed-off-by: Keith Packard --- tests/kernel/cache/testcase.yaml | 12 ++++++++++++ tests/kernel/context/testcase.yaml | 7 +++++++ tests/kernel/device/testcase.yaml | 8 ++++++++ tests/kernel/early_sleep/testcase.yaml | 8 ++++++++ tests/kernel/interrupt/testcase.yaml | 21 +++++++++++++++++++++ tests/kernel/mp/testcase.yaml | 10 ++++++++++ tests/kernel/obj_tracking/testcase.yaml | 6 ++++++ tests/kernel/pending/testcase.yaml | 5 +++++ tests/kernel/poll/testcase.yaml | 13 +++++++++++++ tests/kernel/queue/testcase.yaml | 9 +++++++++ tests/kernel/sleep/testcase.yaml | 8 ++++++++ tests/kernel/smp/testcase.yaml | 9 +++++++++ tests/kernel/smp_boot_delay/testcase.yaml | 11 +++++++++++ tests/kernel/spinlock/testcase.yaml | 12 ++++++++++++ tests/kernel/xip/testcase.yaml | 10 ++++++++++ 15 files changed, 149 insertions(+) diff --git a/tests/kernel/cache/testcase.yaml b/tests/kernel/cache/testcase.yaml index 9bde7491e7b9b6..31a35f92e1af0c 100644 --- a/tests/kernel/cache/testcase.yaml +++ b/tests/kernel/cache/testcase.yaml @@ -8,3 +8,15 @@ tests: - qemu_xtensa - qemu_cortex_a53 - nsim_em + kernel.cache.api.minimallibc: + tags: + - kernel + - cache + - libc + filter: CONFIG_CACHE_MANAGEMENT and CONFIG_MINIMAL_LIBC_SUPPORTED + integration_platforms: + - qemu_xtensa + - qemu_cortex_a53 + - nsim_em + extra_configs: + - CONFIG_MINIMAL_LIBC=y diff --git a/tests/kernel/context/testcase.yaml b/tests/kernel/context/testcase.yaml index 859287597e2189..4ce2d62fefb195 100644 --- a/tests/kernel/context/testcase.yaml +++ b/tests/kernel/context/testcase.yaml @@ -4,6 +4,13 @@ tests: extra_configs: - CONFIG_TEST_EXTRA_STACK_SIZE=1024 min_ram: 16 + kernel.context.minimallibc: + filter: CONFIG_MINIMAL_LIBC_SUPPORTED + tags: kernel libc + extra_configs: + - CONFIG_TEST_EXTRA_STACK_SIZE=1024 + - CONFIG_MINIMAL_LIBC=y + min_ram: 16 linker.linker_generator: platform_allow: qemu_cortex_m3 tags: diff --git a/tests/kernel/device/testcase.yaml b/tests/kernel/device/testcase.yaml index 4bbc8cade6dd5e..8634e2746edcf2 100644 --- a/tests/kernel/device/testcase.yaml +++ b/tests/kernel/device/testcase.yaml @@ -9,6 +9,14 @@ tests: tags: - kernel - device + kernel.device.minimallibc: + filter: CONFIG_MINIMAL_LIBC_SUPPORTED + tags: + - kernel + - device + - libc + extra_configs: + - CONFIG_MINIMAL_LIBC=y kernel.device.pm: tags: - kernel diff --git a/tests/kernel/early_sleep/testcase.yaml b/tests/kernel/early_sleep/testcase.yaml index 4f7bf7e16739d1..fc5f3fa552caa5 100644 --- a/tests/kernel/early_sleep/testcase.yaml +++ b/tests/kernel/early_sleep/testcase.yaml @@ -3,3 +3,11 @@ tests: tags: - kernel - sleep + kernel.common.sleep.minimallibc: + filter: CONFIG_MINIMAL_LIBC_SUPPORTED + tags: + - kernel + - sleep + - libc + extra_configs: + - CONFIG_MINIMAL_LIBC=y diff --git a/tests/kernel/interrupt/testcase.yaml b/tests/kernel/interrupt/testcase.yaml index 3ad8ba176e05fc..bdec3a794eef0e 100644 --- a/tests/kernel/interrupt/testcase.yaml +++ b/tests/kernel/interrupt/testcase.yaml @@ -15,3 +15,24 @@ tests: filter: not CONFIG_TRUSTED_EXECUTION_NONSECURE extra_configs: - CONFIG_QEMU_ICOUNT=y + arch.interrupt.minimallibc: + filter: not CONFIG_TRUSTED_EXECUTION_NONSECURE and CONFIG_MINIMAL_LIBC_SUPPORTED + # nios2 excluded, see #22956 + arch_exclude: nios2 + platform_exclude: qemu_cortex_m0 + tags: + - kernel + - interrupt + - libc + extra_configs: + - CONFIG_MINIMAL_LIBC=y + arch.interrupt.qemu_cortex_m0.minimallibc: + filter: not CONFIG_TRUSTED_EXECUTION_NONSECURE and CONFIG_MINIMAL_LIBC_SUPPORTED + platform_allow: qemu_cortex_m0 + tags: + - kernel + - interrupt + - libc + extra_configs: + - CONFIG_QEMU_ICOUNT=y + - CONFIG_MINIMAL_LIBC=y diff --git a/tests/kernel/mp/testcase.yaml b/tests/kernel/mp/testcase.yaml index 65c98f378d0dbf..aea4eff4e1cb45 100644 --- a/tests/kernel/mp/testcase.yaml +++ b/tests/kernel/mp/testcase.yaml @@ -6,3 +6,13 @@ tests: filter: CONFIG_MP_MAX_NUM_CPUS > 1 depends_on: - smp + kernel.multiprocessing.minimallibc: + tags: + - kernel + - smp + - libc + filter: CONFIG_MP_MAX_NUM_CPUS > 1 and CONFIG_MINIMAL_LIBC_SUPPORTED + depends_on: + - smp + extra_configs: + - CONFIG_MINIMAL_LIBC=y diff --git a/tests/kernel/obj_tracking/testcase.yaml b/tests/kernel/obj_tracking/testcase.yaml index aa190a9d4b232a..f3bcd6eedc834e 100644 --- a/tests/kernel/obj_tracking/testcase.yaml +++ b/tests/kernel/obj_tracking/testcase.yaml @@ -2,3 +2,9 @@ tests: kernel.objects.tracking: tags: kernel platform_exclude: qemu_x86_tiny + kernel.objects.tracking.minimallibc: + filter: CONFIG_MINIMAL_LIBC_SUPPORTED + tags: kernel libc + platform_exclude: qemu_x86_tiny + extra_configs: + - CONFIG_MINIMAL_LIBC=y diff --git a/tests/kernel/pending/testcase.yaml b/tests/kernel/pending/testcase.yaml index 8fa2bee1aeaadf..19569417530055 100644 --- a/tests/kernel/pending/testcase.yaml +++ b/tests/kernel/pending/testcase.yaml @@ -1,3 +1,8 @@ tests: kernel.objects: tags: kernel + kernel.objects.minimallibc: + filter: CONFIG_MINIMAL_LIBC_SUPPORTED + tags: kernel libc + extra_configs: + - CONFIG_MINIMAL_LIBC=y diff --git a/tests/kernel/poll/testcase.yaml b/tests/kernel/poll/testcase.yaml index 75a898711f1d3e..5eb5fc9a6262c3 100644 --- a/tests/kernel/poll/testcase.yaml +++ b/tests/kernel/poll/testcase.yaml @@ -8,3 +8,16 @@ tests: platform_exclude: - nrf52dk_nrf52810 - qemu_arc_hs6x + kernel.poll.minimallibc: + filter: CONFIG_MINIMAL_LIBC_SUPPORTED + ignore_faults: true + tags: + - kernel + - userspace + - libc + # FIXME: qemu_arc_hs6x is excluded due to a run-time failure, see #49492 + platform_exclude: + - nrf52dk_nrf52810 + - qemu_arc_hs6x + extra_configs: + - CONFIG_MINIMAL_LIBC=y diff --git a/tests/kernel/queue/testcase.yaml b/tests/kernel/queue/testcase.yaml index d3ef6338587742..b757cc43b45b11 100644 --- a/tests/kernel/queue/testcase.yaml +++ b/tests/kernel/queue/testcase.yaml @@ -4,3 +4,12 @@ tests: - kernel - userspace ignore_faults: true + kernel.queue.minimallibc: + filter: CONFIG_MINIMAL_LIBC_SUPPORTED + tags: + - kernel + - userspace + - libc + ignore_faults: true + extra_configs: + - CONFIG_MINIMAL_LIBC=y diff --git a/tests/kernel/sleep/testcase.yaml b/tests/kernel/sleep/testcase.yaml index ebc9854fd2bd4f..eceb053d08236a 100644 --- a/tests/kernel/sleep/testcase.yaml +++ b/tests/kernel/sleep/testcase.yaml @@ -3,3 +3,11 @@ tests: tags: - kernel - sleep + kernel.common.timing.minimallibc: + filter: CONFIG_MINIMAL_LIBC_SUPPORTED + tags: + - kernel + - sleep + - libc + extra_configs: + - CONFIG_MINIMAL_LIBC=y diff --git a/tests/kernel/smp/testcase.yaml b/tests/kernel/smp/testcase.yaml index 70d0331122e871..e0ca7e924673ec 100644 --- a/tests/kernel/smp/testcase.yaml +++ b/tests/kernel/smp/testcase.yaml @@ -5,3 +5,12 @@ tests: - smp ignore_faults: true filter: (CONFIG_MP_MAX_NUM_CPUS > 1) + kernel.multiprocessing.smp.minimallibc: + tags: + - kernel + - smp + - libc + ignore_faults: true + filter: (CONFIG_MP_MAX_NUM_CPUS > 1) and CONFIG_MINIMAL_LIBC_SUPPORTED + extra_configs: + - CONFIG_MINIMAL_LIBC=y diff --git a/tests/kernel/smp_boot_delay/testcase.yaml b/tests/kernel/smp_boot_delay/testcase.yaml index 85d95141962a30..4b4954aef37d22 100644 --- a/tests/kernel/smp_boot_delay/testcase.yaml +++ b/tests/kernel/smp_boot_delay/testcase.yaml @@ -6,3 +6,14 @@ tests: platform_allow: intel_adsp_cavs25 integration_platforms: - intel_adsp_cavs25 + kernel.multiprocessing.smp_boot_delay.minimallibc: + filter: CONFIG_MINIMAL_LIBC_SUPPORTED + tags: + - kernel + - smp + - libc + platform_allow: intel_adsp_cavs25 + integration_platforms: + - intel_adsp_cavs25 + extra_configs: + - CONFIG_MINIMAL_LIBC=y diff --git a/tests/kernel/spinlock/testcase.yaml b/tests/kernel/spinlock/testcase.yaml index ed03f11cd3799d..7844db39e61ac7 100644 --- a/tests/kernel/spinlock/testcase.yaml +++ b/tests/kernel/spinlock/testcase.yaml @@ -7,3 +7,15 @@ tests: filter: CONFIG_SMP and CONFIG_MP_MAX_NUM_CPUS > 1 and CONFIG_MP_MAX_NUM_CPUS <= 4 depends_on: - smp + kernel.multiprocessing.spinlock.minimallibc: + tags: + - kernel + - smp + - spinlock + - libc + filter: CONFIG_SMP and CONFIG_MP_MAX_NUM_CPUS > 1 and CONFIG_MP_MAX_NUM_CPUS <= 4 and + CONFIG_MINIMAL_LIBC_SUPPORTED + depends_on: + - smp + extra_configs: + - CONFIG_MINIMAL_LIBC=y diff --git a/tests/kernel/xip/testcase.yaml b/tests/kernel/xip/testcase.yaml index 3497ffdb1342fe..0992d21906475f 100644 --- a/tests/kernel/xip/testcase.yaml +++ b/tests/kernel/xip/testcase.yaml @@ -7,3 +7,13 @@ tests: integration_platforms: - qemu_arc_em - qemu_x86_xip + arch.common.xip.minimallibc: + filter: CONFIG_XIP and CONFIG_MINIMAL_LIBC_SUPPORTED + tags: + - kernel + - xip + integration_platforms: + - qemu_arc_em + - qemu_x86_xip + extra_configs: + - CONFIG_MINIMAL_LIBC=y