From 26590a0f6bd82d491a820e7f965096f1ea9b9564 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 10 Oct 2024 14:49:13 -0700 Subject: [PATCH 1/2] picolibc: Enable dual-mode picolibc builds This provides both minsize and release versions of picolibc in the SDK, allowing users to select between them while building their application. Signed-off-by: Keith Packard --- cmake/zephyr/generic.cmake | 1 + configs/common.config | 1 + contrib/linux_build_toolchain.sh | 0 crosstool-ng | 2 +- 4 files changed, 3 insertions(+), 1 deletion(-) mode change 100644 => 100755 contrib/linux_build_toolchain.sh diff --git a/cmake/zephyr/generic.cmake b/cmake/zephyr/generic.cmake index 2c914d8e..f76d5c9d 100644 --- a/cmake/zephyr/generic.cmake +++ b/cmake/zephyr/generic.cmake @@ -31,3 +31,4 @@ set(CROSS_COMPILE ${one_toolchain_root}/${CROSS_COMPILE_TARGET}/bin/${CROSS_COMP set(SYSROOT_DIR ${one_toolchain_root}/${SYSROOT_TARGET}/${SYSROOT_TARGET}) set(TOOLCHAIN_HAS_NEWLIB ON CACHE BOOL "True if toolchain supports newlib") set(TOOLCHAIN_HAS_PICOLIBC ON CACHE BOOL "True if toolchain supports picolibc") +set(TOOLCHAIN_HAS_PICOLIBC_DUAL ON CACHE BOOL "True if toolchain supports --picolibc-buildtype=release") diff --git a/configs/common.config b/configs/common.config index 9c317655..093101da 100644 --- a/configs/common.config +++ b/configs/common.config @@ -71,5 +71,6 @@ CT_COMP_LIBS_PICOLIBC=y CT_PICOLIBC_SRC_CUSTOM=y CT_PICOLIBC_CUSTOM_LOCATION="${GITHUB_WORKSPACE}/picolibc" CT_LIBC_PICOLIBC_GLOBAL_ATEXIT=y +CT_LIBC_PICOLIBC_ENABLE_TARGET_OPTBOTH=y CT_LIBC_PICOLIBC_EXTRA_SECTIONS=y CT_LIBC_PICOLIBC_EXTRA_CONFIG_ARRAY="-Dthread-local-storage=auto -Derrno-function=zephyr -Dsysroot-install=true -Dsysroot-install-skip-checks=true -Dassert-verbose=false" diff --git a/contrib/linux_build_toolchain.sh b/contrib/linux_build_toolchain.sh old mode 100644 new mode 100755 diff --git a/crosstool-ng b/crosstool-ng index 53b5327d..9f07f91c 160000 --- a/crosstool-ng +++ b/crosstool-ng @@ -1 +1 @@ -Subproject commit 53b5327d821a6b6949fa455f14a9631146af897c +Subproject commit 9f07f91c99cce5a0f2ff37986788f57360a9730d From 6fcbb43d61c5565a279cebb1d1f734b01529d5b5 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 11 Oct 2024 00:52:00 -0700 Subject: [PATCH 2/2] picolibc: Pull in ARC release build fix In release builds, several targets would get both asm and C versions of strchr included, which is a fatal picolibc build error. Pull in the fix for that. Signed-off-by: Keith Packard --- contrib/linux_build_toolchain.sh | 2 +- picolibc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/linux_build_toolchain.sh b/contrib/linux_build_toolchain.sh index d8fdeacf..386014a2 100755 --- a/contrib/linux_build_toolchain.sh +++ b/contrib/linux_build_toolchain.sh @@ -119,7 +119,7 @@ CT_LOG_EXTRA=y CT_LOG_LEVEL_MAX="EXTRA" CT_GDB_CROSS_PYTHON=y CT_GDB_CROSS_PYTHON_VARIANT=y -CT_GDB_CROSS_PYTHON_BINARY="python3.10" +CT_GDB_CROSS_PYTHON_BINARY="python3.12" CT_EXPERIMENTAL=y CT_ALLOW_BUILD_AS_ROOT=y CT_ALLOW_BUILD_AS_ROOT_SURE=y diff --git a/picolibc b/picolibc index 21d8fed7..5a0c482e 160000 --- a/picolibc +++ b/picolibc @@ -1 +1 @@ -Subproject commit 21d8fed73c34bfaf406ebedab2db46474baa1f20 +Subproject commit 5a0c482eb59c72dadae52eff54c867d2b3a02b7b