From f8a627f6448e6bd436445ca906114bc587b3d789 Mon Sep 17 00:00:00 2001 From: Ioannis Glaropoulos Date: Fri, 15 Nov 2019 12:20:45 +0100 Subject: [PATCH 1/3] tests: lib: mem_alloc: minor typo fixes in README file Some minor typo and style fixes in the README file of tests/lib/mem_alloc test-suite. Signed-off-by: Ioannis Glaropoulos --- tests/lib/mem_alloc/README.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/lib/mem_alloc/README.txt b/tests/lib/mem_alloc/README.txt index 40e7e375360dd..1e996cb81d60b 100644 --- a/tests/lib/mem_alloc/README.txt +++ b/tests/lib/mem_alloc/README.txt @@ -3,7 +3,7 @@ Standard Libraries Description: -This test verifies kernel access to the dynamic memory allocation funtions +This test verifies kernel access to the dynamic memory allocation functions provided by standard C libraries supported in Zephyr: NEWLIB and MINIMAL_LIB. It is intended to catch issues in which a library is completely absent @@ -23,7 +23,7 @@ on QEMU as follows: Troubleshooting: -Problems caused by out-dated project information can be addressed by +Problems caused by outdated project information can be addressed by issuing one of the following commands then rebuilding the project: make clean # discard results of previous builds From 470d07293a315fa842bac886a2c6ce0b6567e280 Mon Sep 17 00:00:00 2001 From: Ioannis Glaropoulos Date: Fri, 15 Nov 2019 12:23:59 +0100 Subject: [PATCH 2/3] test: lib: mem_alloc: enable user mode in newlibcnano test libc.newlibcnano test-case shall run with user mode enabled, similarly to the remainder of the test-cases in the tests/lib/mem_alloc test-suite. Signed-off-by: Ioannis Glaropoulos --- tests/lib/mem_alloc/prj_newlibnano.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/lib/mem_alloc/prj_newlibnano.conf b/tests/lib/mem_alloc/prj_newlibnano.conf index 2f301e7ae4b79..c7ee608b62722 100644 --- a/tests/lib/mem_alloc/prj_newlibnano.conf +++ b/tests/lib/mem_alloc/prj_newlibnano.conf @@ -1,3 +1,5 @@ CONFIG_ZTEST=y CONFIG_NEWLIB_LIBC=y CONFIG_NEWLIB_LIBC_NANO=y +CONFIG_NEWLIB_LIBC_ALIGNED_HEAP_SIZE=512 +CONFIG_TEST_USERSPACE=y From b055d8c6061676565e57ccc817743ed9bd403ea8 Mon Sep 17 00:00:00 2001 From: Ioannis Glaropoulos Date: Fri, 15 Nov 2019 14:07:51 +0100 Subject: [PATCH 3/3] cmake: copy globals from libc_nano.a to z_libc_partition When building with NEWLIB_LIBC_NANO we need to copy the globals from libc_nano.a into application memory partition z_libc_partition, exactly as we do for libc.a globals. This is required so that these globals are accessible by nPRIV code, when building with user mode support. Signed-off-by: Ioannis Glaropoulos --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 90e0d4f40b195..561a9469b7689 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1057,6 +1057,9 @@ if(CONFIG_USERSPACE) if(CONFIG_NEWLIB_LIBC) set(NEWLIB_PART -l libc.a z_libc_partition) endif() + if(CONFIG_NEWLIB_LIBC_NANO) + set(NEWLIB_PART -l libc_nano.a z_libc_partition) + endif() if(CONFIG_MBEDTLS) set(MBEDTLS_PART -l lib..__modules__crypto__mbedtls.a k_mbedtls_partition) endif()